simon-git: tilings (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Wed Jun 19 13:04:59 BST 2024


TL;DR:
  5bcadbd Give Diagram a method to estimate the tile count.
  fa2b34b Allow SVGs to contain auxiliary data per polygon.
  9b772b1 Add a command-line interface to the coordinate finder.
  acb7525 Coordinate finder: find the simplest rho-shaped sequence.

Repository:     https://git.tartarus.org/simon/tilings.git
On the web:     https://git.tartarus.org/?p=simon/tilings.git
Branch updated: main
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2024-06-19 13:04:59

commit 5bcadbd352575530ec23d578f841e1b26a67d7c5
web diff https://git.tartarus.org/?p=simon/tilings.git;a=commitdiff;h=5bcadbd352575530ec23d578f841e1b26a67d7c5;hp=78a5f54d9a820114d5f98b0d42b51527689fdde8
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Jun 19 07:11:25 2024 +0100

    Give Diagram a method to estimate the tile count.
    
    If you're doing really big plots using this code, you might like to
    know how long you expect to wait. We can't know that for absolute sure
    - you never quite know how many tiles intersect the grid edge until
    the generation gets there and finds out. But we can at least estimate
    the total number of tiles by dividing the target area by the area of
    one tile.
    
    Except that in systems with multiple types of tile, we have to take
    the _average_ tile area, weighted by the relative frequency with which
    each tile type shows up. Happily, the Analysis class can already
    compute those relative frequencies for us.

 draw.sage | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

commit fa2b34b977deb9338615fc1e99eae67f4b442669
web diff https://git.tartarus.org/?p=simon/tilings.git;a=commitdiff;h=fa2b34b977deb9338615fc1e99eae67f4b442669;hp=5bcadbd352575530ec23d578f841e1b26a67d7c5
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Jun 19 07:17:15 2024 +0100

    Allow SVGs to contain auxiliary data per polygon.
    
    This means we can output an SVG picture of a tiling in which each tile
    is annotated with information about its combinatorial coordinates, and
    you can look up the coordinates for a particular tile by loading it
    into Inkscape and using the XML view, or loading it into Firefox and
    using the 'Inspect' feature (and I don't doubt other browsers will
    have similar things).
    
    Nothing uses this yet, but the next commit will.
    
    (It might also be useful to add an option to emit this data in --patch
    mode, but for the moment, I haven't.)

 svg.py    | 19 ++++++++++++-------
 util.sage |  4 ++--
 2 files changed, 14 insertions(+), 9 deletions(-)

commit 9b772b12da2eade862882a83338ac33463df5cd4
web diff https://git.tartarus.org/?p=simon/tilings.git;a=commitdiff;h=9b772b12da2eade862882a83338ac33463df5cd4;hp=fa2b34b977deb9338615fc1e99eae67f4b442669
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Jun 19 07:17:32 2024 +0100

    Add a command-line interface to the coordinate finder.
    
    The input format describes a piece of tiling in a combinatorial way,
    and you optionally specify the identifier of a tile whose coordinates
    you want to know (otherwise it picks arbitrarily). As output, you get
    the full DFA of the selected tile and whatever prefix of its
    coordinates the system is certain of. But you can also ask for the
    input patch to be rendered as SVG, with _every_ tile annotated with as
    many of its coordinates as are known.

 README.txt    |  43 +++++++++++++++++++++++
 toplevel.sage | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 151 insertions(+), 1 deletion(-)

commit acb752582935a11fdef1df6238b161f6344b0908
web diff https://git.tartarus.org/?p=simon/tilings.git;a=commitdiff;h=acb752582935a11fdef1df6238b161f6344b0908;hp=9b772b12da2eade862882a83338ac33463df5cd4
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Jun 19 12:42:29 2024 +0100

    Coordinate finder: find the simplest rho-shaped sequence.
    
    This feature searches the raw output NFA to find an eventually
    periodic sequence of coordinates that the NFA permits. It will search
    for the 'simplest' such sequence, which I define (somewhat
    arbitrarily) as having the smallest total number of coordinates in
    both the initial segment and the repeating segment, and as a tie-
    breaker, prefer a longer repeating segment and a smaller initial one.
    
    That was surprisingly tricky, because you can't do it just by
    searching forward from the start of the NFA to find the first path
    that revisits a previous state. That would certainly return _an_
    eventually periodic sequence, but it doesn't reliably return the
    simplest, because the path through the NFA might repeat a simple thing
    multiple times _explicitly_ (via separate NFA states) before settling
    down to a repeating state. So if you have possibilities ABBB(C)* and
    ABBBB(B)*, the former looks better by the 'earliest repeat of a state'
    metric, but the latter is _really_ better, because it rolls up into
    the much shorter A(B)* once you forget about the NFA state numbers.
    
    So instead I've written a function which takes the two size
    parameters (number of initial symbols, number of repeating ones), and
    searches for any path through the NFA which fills those slots in
    consistently and ends up repeating itself. Then I try that search at
    larger and larger sizes until one succeeds.

 README.txt    |  4 ++++
 finder.sage   | 45 +++++++++++++++++++++++++++++++++++++++++++++
 toplevel.sage |  3 +++
 3 files changed, 52 insertions(+)



More information about the tartarus-commits mailing list