N-gons
To start, let's make a class that can render any regular n-gon. Luckily, the plane can only be tiled with triangles, squares, hexagons, octagons (8 sides), and dodecagons (12 sides).
k-Uniform Tilings
Now let's start working on implementing an applet that could render any semi-regular tiling. First, some notation. Each tiling is represented with its vertex notation. The idea is simple, for each type (or genus) of vertex, I list the n-gons that appear around this vertex. So '3.4.6.4' means that that genus of vertex has a triangle, a square, a hexagon, and a square, in that order. Further on in the list, there are cases where the same n-gon can appear in multiple circumstances, in which case I use letter suffixes to differentiate between them. Each 'genus' is defined uniquely by its vertex genus sequence. So '3a.3a.3b.3a.6' means that there are two types of triangles, '3a' and '3b', and they must appear in this order.
- Pick a point, this will be the initial vertex.
- Surround that vertex by the polygons contained in the pattern for that vertex. Usually this is the first pattern in the vertex notation, but in certain cases the algorithm works better if I choose the second or third pattern.
- Now iterate like so:
- For each incomplete vertex, iterate over its possible vertex patterns and validate that the pattern still applies. If only one possibility remains, populate the vertex with the missing n-gons.
- (If face hints are provided) For each incomplete face, iterate over its face hints to see if there is only one choice remaining for its incomplete vertices. If so, force those vertices to accept their only valid pattern.
- (If face edge hints are provided) For each incomplete face, interate over its edges and see if a choice can be forced on it.
- Rinse and repeat until the viewport is filled or no other additional polygons can be added.
This algorithm required a lot of tinkering. I started with only the vertex definitions and only clockwise order for n-gons on a vertex. This ran into issues with the '4.6.12' tiling, which also requires the mirrored pattern to fill the viewport. Eventually I ran into issues where the vertex directions were not sufficient, so I added the face hints. This required further tinkering and debugging. Finally, the ['3.4.4.6', '3.6.3.6'] pattern could not be completed even with both vertex and face hints, so I had to add the face edge hints.
For the '3.3.3.3.6' tiling, there is an inherent ambiguity that requires a choice to be made. I have listed the two chiral versions of this tiling, '3a.3a.3b.3a.6' and '3a.3b.3a.3a.6'.
I also have the option to display the dual graph of the tiling, where each face is represented by a vertex, and each vertex instead becomes a face. Curiously, the dual graphs of the Regular and Semiregular tilings consist entirely of planigons.
Gallery of tilings
Below is a list of all available tilings, displayed in one place. Note that this takes a while to render, and takes up significant memory.
Further ideas to explore
- Display the aperiodic Penrole Tiling