RefinementsΒΆ

[1]:
import numpy as np
import matplotlib.cm as cmap
import matplotlib.pyplot as plt

from hypertiling import HyperbolicTiling
from hypertiling.plot import plot_tiling, poly2patch
from hypertiling.util import refine_lattice
from hypertiling.geodesics import geodesic_arc

This is an example how hyperbolic lattice refinements can be created

[2]:
T = HyperbolicTiling(3,7,6)
T.generate()

R = refine_lattice(T,1)

We plot the original cells as thick black lines

[ ]:
fig, ax = plt.subplots(figsize=(8,7), dpi=100)

# plot refined lattice
pgons = poly2patch(R.polygons, np.zeros(len(R)), lw=0.3, cmap=cmap.RdBu, edgecolor="0.50", clim=[-1,1])
ax.add_collection(pgons)

# plot edges of original cells
for poly in T: # loop over polygons
    for i in range(T.p): # loop over vertices
        z1 = poly.verticesP[i] # extract edges
        z2 = poly.verticesP[(i+1)%T.p]
        arc = geodesic_arc(z1,z2,lw=0.3) # compute arc
        plt.gca().add_patch(arc) # add to plot
        arc.set_color('k')

plt.xlim(-1,1); plt.ylim(-1,1)
plt.axis("off"); plt.gca().set_aspect('equal')
plt.tight_layout(); plt.show()

let us do some more refinement steps

[12]:
T = HyperbolicTiling(3,7,5)
T.generate()
R = refine_lattice(T,3)
[13]:
fig, ax = plt.subplots(figsize=(8,7), dpi=100)

# plot refined lattice
pgons = poly2patch(R.polygons, np.zeros(len(R)), lw=0.3, cmap=cmap.RdBu, edgecolor="0.50", clim=[-1,1])
ax.add_collection(pgons)

# plot edges of original cells
for poly in T: # loop over polygons
    for i in range(T.p): # loop over vertices
        z1 = poly.verticesP[i] # extract edges
        z2 = poly.verticesP[(i+1)%T.p]
        arc = geodesic_arc(z1,z2,lw=0.3) # compute arc
        plt.gca().add_patch(arc) # add to plot
        arc.set_color('k')

plt.xlim(-1,1); plt.ylim(-1,1)
plt.axis("off"); plt.gca().set_aspect('equal')
plt.tight_layout(); plt.show()
../_images/nbcopies_refinements_8_0.png

refinements work for any triangular tiling, therefore let us try a different \(q\)

[ ]:

[16]:
T = HyperbolicTiling(3,10,4)
T.generate()
R = refine_lattice(T,1)
[17]:
fig, ax = plt.subplots(figsize=(8,7), dpi=100)

# plot refined lattice
pgons = poly2patch(R.polygons, np.zeros(len(R)), lw=0.3, cmap=cmap.RdBu, edgecolor="0.50", clim=[-1,1])
ax.add_collection(pgons)

# plot edges of original cells
for poly in T: # loop over polygons
    for i in range(T.p): # loop over vertices
        z1 = poly.verticesP[i] # extract edges
        z2 = poly.verticesP[(i+1)%T.p]
        arc = geodesic_arc(z1,z2,lw=0.3) # compute arc
        plt.gca().add_patch(arc) # add to plot
        arc.set_color('k')

plt.xlim(-1,1); plt.ylim(-1,1)
plt.axis("off"); plt.gca().set_aspect('equal')
plt.tight_layout(); plt.show()
../_images/nbcopies_refinements_12_0.png

And even larger \(q\); this time without the original cells, since plotting those geodesic arcs is rather slow

[24]:
T = HyperbolicTiling(3,12,4)
T.generate()
R = refine_lattice(T,3)
[25]:
fig, ax = plt.subplots(figsize=(8,7), dpi=100)

# plot refined lattice
pgons = poly2patch(R.polygons, np.zeros(len(R)), lw=0.3, cmap=cmap.RdBu, edgecolor="0.2", clim=[-1,1])
ax.add_collection(pgons)

plt.xlim(-1,1); plt.ylim(-1,1)
plt.axis("off"); plt.gca().set_aspect('equal')
plt.tight_layout(); plt.show()
../_images/nbcopies_refinements_15_0.png
[ ]: