2.1. Planar, Spherical, and Hyperbolic Geometry
Planar. If we move counterclockwise around a regular planar polygon with
n sides, we make a left turn by the exterior angle
at each of the
n vertices and return to the initial side’s direction after turning by a total angle of
; thus, we have
Therefore, the interior angle
of a regular
n-gon is
To form a planar tiling with a vertex pattern
and with no gaps or overlaps between these polygons at the vertex, we must have the interior angle sum
add up to exactly
. For a given a pattern
satisfying this equation, simple plane geometry and trigonometry can be used to construct the tiling geometry.
Spherical. If the sum
and the specified regular polygons are placed in a plane next to each other around a vertex
B, there will be a gap between the last polygon and the first. We can rotate the planes of the respective polygons in 3D around their shared edges to create dihedral angles between them and close this gap. These dihedral angles are calculated in Equation (
12) below. If there are only three polygons in the pattern, then the triangle formed by the other ends
of the edges meeting at
B has a unique rigid shape, so there is only one choice of these dihedral angles. If there are four or more polygons, however, the configuration is flexible and there are multiple choices. With the correct choice, the
k + 1 points
and
all lie on a single sphere, which is the circumscribed sphere of the uniform polyhedron we are trying to construct. Radial projection of this polyhedron onto the unit sphere then provides a spherical tiling. The internal angles of the spherical polygons are measured in the tangent plane at
B, and add up to 2
. They are larger than the internal angles of the polyhedron’s faces at
B, as the face planes are tilted away on one side of this tangent plane.
Suppose that we have a vertex pattern
at vertex
B, meaning that the sum
S in Equation (
5) is less than
, and that we want to construct the corresponding spherical tiling to find the correct dihedral angles between the face planes of the corresponding inscribed polyhedron. For this, we can use spherical trigonometry.
Figure 2 shows a closeup of the central regular spherical decagon in the tiling of the unit sphere at the left of
Figure 1. The user-specified vertex pattern is
= (10, 6, 4); thus, the decagon, hexagon, and square appear in counterclockwise order around the initial vertex
B. Let
A be the point on the unit sphere at the center of the decagon and let
C be the midpoint of the great circle arc
. In
Figure 2, the lines
and
are great circle arcs as well; however, they appear straight because the view is from directly above
A. Based on the mirror symmetry of the decagon across the plane of the great circle arc
, the angle
is a right angle; thus, the triangle ABC is a right spherical triangle. By convention,
A,
B, and
C refer to the angles of the spherical triangle as measured in the tangent planes of the respective vertices, while
a,
b, and
c denote the arclengths of the sides opposite them, that is, sides
,
, and
, respectively. Again, based on the symmetry of the spherical decagon, angle
A is
, or in the general case,
. Letting
x = cos(
a), if we know
x, then we can determine
, the side arclength of each of the regular spherical polygons.
From the spherical trigonometry rules for right spherical triangles (see Equation (
19) on page 206 of [
16]),
meaning that we have
The angle
is half the internal angle of the
ith spherical polygon at vertex
B, and these internal angles add up to
; thus, we have
This is a transcendental equation that can be solved for the unknown
x by the secant method. Knowing
x, we can determine
from Equation (8). Then, in
spherical coordinates on the unit sphere (with the north pole at the vertex
B and the
X axis along the direction
) we obtain the spherical coordinates
of
by
and these determine the Cartesian coordinates of
. A similar construction is provided in [
17].
The normal
to the plane of the
ith polygon around
B in the inscribed polyhedron is the normalized cross product of the vector
with
if
(or with
if
). The dihedral angle
between consecutive faces
i and
around
B can be found using a dot product:
Hyperbolic. If the angle sum
S in Equation (
5) is greater than
, then the tiling should lie in the hyperbolic plane. The method of computing the appropriate length of the hyperbolic polygon edges to make them fit around the initial vertex
B follows the same method as above, using hyperbolic trigonometry instead of spherical trigonometry. From the hyperbolic right triangle formula in Proposition 8.2.2 of [
18] analogous to Equation (
6), we have
Thus, letting
, where
a is half the hyperbolic polygon edge length
e, Equations (8) and (
9) apply as above, and after solving Equation (
9) for
x, the polygon edge length is
As the Poincaré disc visualization of the hyperbolic plane preserves angles, Equation (11) determines the directions in which the circular arcs representing the hyperbolic lines for the edges
leave vertex
B. Thus, we need to construct a circle
C leaving
B in a given direction
D, then find the point
on this circle at a hyperbolic distance
e from
B. To construct
C, we can use Proposition 3.1.7 from [
18], which implies that the circle
C passes through the inversion
U of
B in the unit circle, which is the boundary of the Poincaré disc with center
O and radius
= 1, as shown in
Figure 3. Let
O be at the origin (0, 0) of the plane, and let
s =
be the distance of
B from
O. Then, from the definition of inversion in the unit circle,
U lies on the ray
at a distance
from
O, and the distance
. The center
M of circle
C must be equidistant from
B and
U; thus, it must lie on the perpendicular bisector
of the segment
.
The midpoint
S of the segment
is at a distance
from
O, meaning that if
is the unit vector in direction
, then
. Also
. In order to leave
B in direction
D, the circle
C must be tangent to the ray between
B and
shown in
Figure 3; thus, its center
M must lie on the line
from
B perpendicular to this ray at the position where it intersects the perpendicular bisector of the segment
. The angle
between
and
is the complement of the angle
between the vectors
D and
E. Therefore, if
, we have the following:
where
G is the unit vector
E rotated clockwise by
. In the situation shown in
Figure 3,
is an acute angle. If
is obtuse,
,
d and
are negative, and
M is on the other side of
. When we know the center
M of
C, its radius is
.
The next problem is to compute a point
W along this circle that is a hyperbolic distance
e from B. According to [
4], the hyperbolic distance
e from
B to
W is
and we have
If we parameterize point
W on circle
C using the angle
around the circle:
then Equation (
24) becomes a transcendental equation in
which can be solved by the secant method. Because the right side of Equation (
24) increases to infinity as
approaches 1 and is invalid when
, careful stepping is needed to find the
interval where it crosses
, which can then be used to initialize the secant method iteration.
2.2. Topology
The connectivity or topology of a tiling describes the adjacency relationship of all the polygonal tiles. Here, it is developed by adding new polygons one at a time counterclockwise around the outer contour of the already assembled ones. This effectively adds circle-like layers around the user-specified cycle of polygons at the initial vertex. A more abstract method of doing this in the hyperbolic plane case is described in [
19] using a regular expression production system.
As polygons are added, a cyclic ordered list is maintained of edges shared by only one polygon instead of two, in counterclockwise order around the outer contour of the tiling, with a next addition pointer indicating the edge E of the contour across which the next polygon P should be added. Normally, E is an edge of the most recently added polygon; however, see the last paragraph of this subsection for cases when it is not.
The number of vertices of
P must be chosen such that at the first vertex
V of edge
E in counterclockwise order around the outer contour it is compatible with the pattern
specified by the user; there may be more than one way to do this or none at all. For example, suppose that pattern
S is (3, 4, 3, 3, 4) and the counterclockwise polygons already added at
V have a partial vertex pattern
T = (4, 3). Then, the next polygon could have three vertices, as (4, 3, 3) is a subsequence of (3, 4, 3, 3, 4). Alternatively, it could have four vertices, because (4, 3, 4) is a subsequence of the cyclic permutation (3, 3, 4, 3, 4) of (3, 4, 3, 3, 4). Thus, every possible matching position of
T within
S considered as a cycle must be tried. A list of such possible choices is saved for each vertex
V for trial and backtracking purposes. Only the vertex count choice is saved, not the matching position. If
T = (3, 4), there are two positions to match it as a subsequence of (3, 4, 3, 3, 4); both of them are followed by a 3, and would add a triangle, which is all that matters. The pattern (3, 4, 3, 3, 4) is reversible or palindromic, as its reversal, (4, 3, 3, 4, 3), is one of its cyclic permutations. However the pattern (10, 6, 4) shown at the left of
Figure 1 is not. Because clockwise matching of the pattern is also allowed, the list of possible polygon types must include those resulting from matching the reversal of pattern
S as long as
S is not palindromic. When the reversed order is used at a vertex
V, this is recorded by setting
vertex_sign[
V] to −1 instead of 1.
The type of the new polygon
P must be added to the existing vertex pattern at the vertex
W at the opposite end of the edge
E from
V. Thus, the compatibility of the augmented vertex pattern at
W with
S must be checked. If the addition of
P completes the vertex pattern at
V or
W, in order to provide a closed loop of polygons there may be further adjacencies of edges of
P with edges of the contour. The addition of a polygon may complete the patterns at multiple vertices along the outer contour, resulting in several consecutive edges being deleted from the contour and replaced by the counterclockwise sequence of edges of the added polygon
P that do not touch the contour; the next addition pointer points to the last edge in this sequence. An example of several construction stages of the (12, 6, 4) plane tiling in the center of
Figure 1 is shown in
Figure 4. When the blue square is added at the lower left of to the first image in this figure to produce the second image, two edges are removed from the outer contour, as the addition completes the pattern at vertex
V. The next addition pointer indicates the lower right edge of this tilted square. The new dodecagon in the third image is added across this edge; actually, however, four of its edges coincide with contour edges. The next addition pointer indicates the last free edge of the dodecagon. A square is added across this indicated edge in the fourth image. In the last image, six edges of the added dodecagon match the contour edges.
Every time another vertex of the new polygon P other than the two vertices V and W of the edge E is found to coincide with a vertex on the contour, the two are pasted together in the topology data structure by removing the vertex on the new polygon and redirecting all pointers pointing to it to the corresponding vertex on the contour. When P is added, it uses the vertices V and W rather than creating new copies, as it is already known at the time of its construction that these vertices belong to it.
In the spherical tiling case, viewers can choose to view the developing tiling either as spherical polygons on the sphere or as an inscribed uniform polyhedron with flat faces.
Figure 5 shows the addition of the last few polygons for the (8, 8, 3) pattern polyhedron (the truncated cube); the interior sides of the faces are rendered darker, with only ambient illumination. In the second image the last red octagon is added across the free edge of the green triangle at the upper right of the first image, creating three triangular holes geometrically. However, only three of the octagon’s edges are actually pasted onto the previous contour. The procedure in the previous two paragraphs does not recognize that the bottom and left sides of the octagon coincide with edges of the contour, because it deals only with the topology (as can be found by completing the patterns at vertices) and does not consider geometric position. Therefore, the contour after this addition has five edges of the octagon, two of which align geometrically with other remaining edges of the contour in the first image. When the green triangle is added at the lower right in the third image, it is found that all of its edges coincide with edges of the contour. This implies that the lower left vertex of this new triangle, which belongs to the newest (front) octagon, coincides with the vertex of the bottom octagon that is matched by another edge of the triangle. Therefore, these vertices are pasted together and the next addition edge pointer indicates the bottom edge of the new octagon, that is, the edge before those which were deleted, as there is no free edge left on the triangle. At this stage it is discovered that the pattern at the previous pasted vertex is complete; thus, the vertex at the left end of the bottom edge of the new octagon is pasted together with its counterpart on the bottom octagon, both are removed from the contour, and the next addition edge pointer is moved one position further back along the new octagon to an edge adjacent to the triangular hole at the bottom left. This causes the next triangle to be added in order to fill in this hole and the same pasting process repeats, meaning that in the last image the hole at the upper left is filled by a triangle. At this point, the contour becomes empty and the polygon addition process terminates. This kind of termination happens only for the spherical case when the tilings are finite. In the planar or hyperbolic case, the tilings are infinite and the addition of new tiles can continue indefinitely.
2.3. Transitivity
The transitivity condition (3) for uniform tilings states that there is a symmetry of the whole tiling that takes each vertex A to any other vertex C. It is sufficient to verify that there is a symmetry taking the initial vertex B to every other vertex D. If takes B to A, then the inverse symmetry takes A to B and the symmetry takes B to C; thus, the symmetry takes A to C. Therefore, the existence of only needs to be checked for every vertex D other than B.
Because the geometry of the regular polygon tile shapes depends only on the number of vertices in the polygons and their common edge lengths, to construct a symmetry of the tiling taking B to D it is sufficient to find a match T of the edge graph of the tiling, that is, a map taking vertices to vertices, that makes the edges correspond as well. This map is constructed through a breadth-first search (BFS) of the edge graph, starting at the initial vertex B and attempting to extend the match between B and D to the new parts of the edge graph discovered during the search. Every possible match of the polygons around B to the polygons around D is tried. The symmetry T may be a reflection, taking polygons in counterclockwise order around B to matching ones in a clockwise order around D. After T has been chosen to be a reflection at B, the order of polygons must be reversed around any other vertex. A sign signv for T at B is saved, which is −1 for a reflection and 1 otherwise.
Each initial match of polygons around B determines a match of the edges meeting B, and consequently of the vertices W at the other ends of these edges as well. As the match of each vertex W is determined, it is saved in an array entry vmatch[W] defining T. The index w_bfs_edge[W] of the edge in the loop of polygons around W along which it was discovered in the BFS is saved, as is the index x_bfs_edge[X] at X of the corresponding edge under the symmetry T. These indices are needed to anchor the edge correspondence when extending the symmetry T to new neighbor vertices surrounding W. In addition, newly discovered vertices W are added to a BFS queue of vertices at which has been determined but for which neighboring vertices have not yet been processed.
In the BFS loop, a vertex
W is removed from the queue and
X is set to
vmatch[
W]. Using
w_bfs_edge[
W],
x_bfs_edge[
X],
signv, and
vertex_sign[
W] (defined in
Section 2.2 above) to force the correspondence between polygons at
W and at
X, the program checks whether the polygon type patterns around
W and
X are consistent with this correspondence. If not, the initial match at
B cannot be extended, and another one is tried until all are exhausted and failure of transitivity is reported. If consistency is verified, the vertices at the far ends of the edges meeting
W can be matched one by one to the vertices at the far ends of the edges meeting
X as long as they have not already been matched via another route through the edge graph. If
is such a new match,
vmatch[
Y] is set to
Z, indices
w_bfs_edge[
Y] and
x_bfs_edge[
Z] are set as above, and
Y is added to the BFS queue. This ends the BFS loop iteration on vertex W, and the next vertex is removed from the queue. If the queue ever becomes empty, the verification that
T is a symmetry is successful and the next vertex
D is checked. If
can be constructed for all
D, then transitivity is verified.
The above process is only applied if there are complete closed cycles of polygons around vertices W and X. If this is not the case, it remains possible to determine that the polygon sequences around them cannot be aligned as subsequences of the specified vertex pattern; however, this involves trying multiple possibilities. I did not do this, so an incompatible choice for an added polygon may not be discovered until a loop of additions around the contour comes back to it and completes the polygon cycles at all of its vertices. A full loop of removals occurs early in the construction of the (4, 4, 4, 5) tiling shown at the left of Figures 9 and 17.
2.4. User Interface
The system only allows polygons of up to 29 sides. Because there are no polygons with one or two sides, it is possible to have the user the vertex counts
as a sequence of digits without spaces or delimiters by considering a ‘1’ or a ‘2’ as the first digit of a two-digit number. The user presses the Enter key to terminate the list. If the sum
S in Equation (
5) of the internal angles of the specified polygons is less than
, the dihedral angles for constructing a 3D polyhedron are computed and an animation shows continuous rotation of the planes of the polygons towards these dihedral angles. At any time after this, the user can press the ‘p’ key to toggle between the polyhedron representation, shown in
Figure 6, and the spherical tiling representation, shown in
Figure 7.
If adding an entry makes the sum S exceed , a black Poincaré disc is faded in and the polygons in the list are animated to their hyperbolic shapes, opening up the gap between the first and the last just wide enough to add the new hyperbolic polygon with vertices. If further polygons are specified, the existing ones are again animated to create gaps for the new ones, this time by lengthening their edges to decrease their internal vertex angles.
Polygons with different edge counts are rendered with different colors. Anti-aliased black lines are drawn on the polygon edges to distinguish adjacent polygons with the same number of sides, as in
Figure 8.
After the user terminates the vertex pattern input by pressing the Enter key, each subsequent press of that key adds one new polygon. Pressing ‘f’ adds up to 500 new polygons, which appear one-by-one on the screen.
To obtain the sphere on the left of
Figure 1, starting with the pattern (10, 6, 4) around the initial vertex, the user would type “1064
f”, where
represents the Enter key and ‘f’ specifies the automatic addition of up to 500 polygons.
Figure 8 shows a sequence of additions, backtracking removals, and further additions in creating the plane tiling (3, 3, 4, 3, 4) starting from the five user-specified polygons around the initial vertex. Polygons are removed automatically if backtracking is necessary. In this case, the backtracking was caused by a violation of the Archimedean condition (2). Pressing ‘t’ toggles the transitivity test off and on, allowing Archimedean tilings which are not uniform to be constructed, as shown on the right of
Figure 6,
Figure 7, and
Figure 9.
The scroll wheel changes the magnification of the 2D image in the planar or hyperbolic case, or alternatively translates a spherical tiling or polyhedron towards or away from the viewer. The right mouse button translates the pattern in two directions. Translation of a hyperbolic tiling is interesting, as certain tiles seem to grow larger and others to shrink, which is due to the length distortion in the Poincaré disc. By moving the mouse with the left button pressed down, the user can rotate a spherical tiling or polyhedron in 3D, as in the Inventor scene viewer interface [
20]. The left button acts similarly on the planar or hyperbolic tiling in 2D, with motions along lines through the window center resulting in translations, circular motion touching the outside edges of the window providing rotation about its center, and intermediate motions rotating the view about other centers, thereby specifying all rigid motions of these spaces.
A finite part of an infinite hyperbolic tiling is constructed by concentric loops of polygons around the outer contour of the user-specified polygons based on the initial vertex
B. The first polygon is translated in order to place its center at the center
O of the Poincaré disc, which makes the polygon appear to have equal edge lengths and makes the tiling around it appear more symmetrical. With only finitely many tiles drawn, the missing tiles appear as small black regions near the outer boundary circle of the disc. However, if the tiling is translated to the right, the missing tiles on the left become very evident as a large black region in the Poincaré disk. To fill in a few of the missing tiles, the vertex
W closest to the center
O is found at every frame; when
W changes index, a tile-aligning 2D mapping
T taking
B to
W, as in
Section 2.3 above, is used to provide a matching and re-centered pattern of tiles. While translating, there is cross-dissolve from the translated pattern to the re-centered pattern. For translation to the right, this causes groups of small tiles on the right to fade out and groups of new tiles on the left to fade in, resulting in a sense of unlimited translation similar to that in KaleidoTile [
6].