Spherical and Hyperbolic Tilings¶
Pleat's geometry backend is pluggable. Internally, vertex positions live in whichever model the tiling was built in; the helper G.geometry.to_euclidean(p) projects a position back into the plane for display, and G.show() does this automatically.
The convenient way to build a curved platonic tiling is curved_platonic(p, q) — the Schläfli symbol {p, q} says "p-gons meeting q at every vertex". The geometry is determined automatically:
- $1/p + 1/q > 1/2$ → spherical (e.g.
(3, 5)is the icosahedron) - $1/p + 1/q = 1/2$ → Euclidean (e.g.
(4, 4)is the square tiling) - $1/p + 1/q < 1/2$ → hyperbolic (e.g.
(7, 3))
Furthermore, the functions curved_truncate(p, q), curved_ambo(p, q), curved_zip(p, q), curved_expand(p, q), curved_omnitruncate(p, q) and curved_snub(p, q) allow the construction of archimedian variants derived from the corresponding regular tilings. The naming is due to the corresponding Conway operators, see the Conway Operators notebook.
import matplotlib
matplotlib.rcParams['figure.figsize'] = (5, 5)
from pleat import (
example_graphs,
example_tilesets,
)
Spherical: a truncated icosahedron¶
tiles = example_tilesets.curved_truncate(3, 5)
print('number of sides of the tiles: ', [t.order for t in tiles])
# Use tiles[0], the pentagon, as the central base_tile
G = example_graphs.from_tiles(tiles, base_tile=tiles[0], rings=3)
print('geometry:', G.geometry.__name__)
# For rendering, the vertices on the sphere are projected to the plane via stereographic projection.
G.show(render_vertices=False)
# If you want to continue work with the tiling in the plane (for example to generate an origami crease pattern), you can convert it to euclidean geometry, which will again apply a stereographic projection to the vertices and recompute the edge lengths and angles.
G.convert_to_euclidean()
number of sides of the tiles: [5, 6] geometry: SphereModel
Euclidean: 6.4.3.4 as curved_expand¶
tiles = example_tilesets.curved_expand(6, 3)
G = example_graphs.from_tiles(tiles, base_tile=tiles[2], rings=3)
print('geometry:', G.geometry.__name__)
G.show()
geometry: EuclideanGeometry
Hyperbolic: a {7, 3} tiling¶
tiles = example_tilesets.curved_platonic(7, 3)
G = example_graphs.from_tiles(tiles, rings=3)
print('geometry:', G.geometry.__name__)
# For rendering, the Poincare disk model is used, which projects the vertices to the unit disk in the plane. The edges are rendered as straight lines, even though they technically correspond to circular arcs in the hyperbolic plane.
G.show(render_vertices=False)
# If you want to work with the tiling in the plane, you can convert it to euclidean geometry, which will use the Poincare disk model.
G.convert_to_euclidean()
geometry: PoincareDiskModel
Mapping the disk to a square¶
The conformal Schwarz–Christoffel map maps the Poincaré disk to a square, preserving angles. The helper hyperbolic_square_graph does this — useful for when you want to efficiently use a square sheet of paper for a hyperbolic origami tessellation ;)
G = example_graphs.from_tiles(example_tilesets.curved_platonic(7, 3), rings=2) # increase number of rings for a more square-ish tiling
G_square = example_graphs.hyperbolic_square_graph(G, min_length=0.5) # no faces with edge length below min_length will be added
G_square.show(render_vertices=False)