delaunay#

Triangulations, Delaunay triangulations, and Delaunay decompositions of infinite surfaces.

EXAMPLES:

Typically, you don’t need to create these surfaces directly, they are created by invoking methods on the underlying surfaces:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase()
sage: S.triangulate()
Triangulation of The infinite staircase

sage: S.delaunay_triangulation()
Delaunay triangulation of The infinite staircase

sage: S.delaunay_decomposition()
Delaunay cell decomposition of The infinite staircase
class flatsurf.geometry.delaunay.LazyDelaunaySurface(similarity_surface, direction=None, relabel=None, category=None)[source]#

Delaunay cell decomposition of an (infinite type) surface.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase()
sage: m = matrix([[2, 1], [1, 1]])
sage: S = (m * S).delaunay_decomposition()

sage: S.polygon(S.root())
Polygon(vertices=[(0, 0), (1, 0), (1, 1), (0, 1)])

sage: S.is_delaunay_decomposed(limit=10)  # long time (.7s)
True

sage: TestSuite(S).run()  # long time (2s)

sage: from flatsurf.geometry.delaunay import LazyDelaunaySurface
sage: isinstance(S, LazyDelaunaySurface)
True
sage: from flatsurf.geometry.chamanara import chamanara_surface
sage: S = chamanara_surface(QQ(1/2))
sage: m = matrix([[3, 4], [-4, 3]]) * matrix([[4, 0],[0, 1/4]])
sage: S = (m * S).delaunay_decomposition()
sage: S.is_delaunay_decomposed(limit=10)  # long time (.5s)
True

sage: TestSuite(S).run()  # long time (1.5s)

sage: from flatsurf.geometry.delaunay import LazyDelaunaySurface
sage: isinstance(S, LazyDelaunaySurface)
True
is_compact()[source]#

Return whether this surface is compact as a topological space.

This implements flatsurf.geometry.categories.topological_surfaces.TopologicalSurfaces.ParentMethods.is_compact().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().delaunay_decomposition()
sage: S.is_compact()
False
is_mutable()[source]#

Return whether this surface is mutable, i.e., return False.

This implements flatsurf.geometry.categories.topological_surfaces.TopologicalSurfaces.ParentMethods.is_mutable().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().delaunay_decomposition()
sage: S.is_mutable()
False
opposite_edge(label, edge)[source]#

Return the polygon label and edge index when crossing over the edge of the polygon label.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.opposite_edge().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().delaunay_decomposition()
sage: S.opposite_edge((0, (0, 1, 2)), 0)
((1, (0, 2, 3)), 2)
polygon(label)[source]#

Return the polygon with label.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.polygon().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().delaunay_decomposition()
sage: S.polygon((0, (0, 1, 2)))
Polygon(vertices=[(0, 0), (1, 0), (1, 1), (0, 1)])
roots()[source]#

Return root labels for the polygons forming the connected components of this surface.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.roots().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().delaunay_decomposition()
sage: S.roots()
((0, (0, 1, 2)),)
class flatsurf.geometry.delaunay.LazyDelaunayTriangulatedSurface(similarity_surface, direction=None, relabel=None, category=None)[source]#

Delaunay triangulation of an (infinite type) surface.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().delaunay_triangulation()
sage: len(S.polygon(S.root()).vertices())
3
sage: TestSuite(S).run()  # long time (.8s)
sage: S.is_delaunay_triangulated(limit=10)
True

sage: from flatsurf.geometry.delaunay import LazyDelaunayTriangulatedSurface
sage: isinstance(S, LazyDelaunayTriangulatedSurface)
True
sage: from flatsurf.geometry.chamanara import chamanara_surface
sage: S = chamanara_surface(QQ(1/2))
sage: m = matrix([[2,1],[1,1]])**4
sage: S = (m*S).delaunay_triangulation()
sage: TestSuite(S).run()  # long time (1s)
sage: S.is_delaunay_triangulated(limit=10)
True
sage: TestSuite(S).run()  # long time (.5s)

sage: from flatsurf.geometry.delaunay import LazyDelaunayTriangulatedSurface
sage: isinstance(S, LazyDelaunayTriangulatedSurface)
True
is_compact()[source]#

Return whether this surface is compact as a topological space.

This implements flatsurf.geometry.categories.topological_surfaces.TopologicalSurfaces.ParentMethods.is_compact().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().delaunay_triangulation()
sage: S.is_compact()
False
is_mutable()[source]#

Return whether this surface is mutable, i.e., return False.

This implements flatsurf.geometry.categories.topological_surfaces.TopologicalSurfaces.ParentMethods.is_mutable().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().delaunay_triangulation()
sage: S.is_mutable()
False
labels()[source]#

Return the labels of this surface.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.labels().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().delaunay_triangulation()
sage: S.labels()
((0, (0, 1, 2)), (1, (0, 2, 3)), (-1, (0, 2, 3)), (0, (0, 2, 3)), (1, (0, 1, 2)), (2, (0, 1, 2)), (-1, (0, 1, 2)), (-2, (0, 1, 2)), (2, (0, 2, 3)), (3, (0, 2, 3)),
 (-2, (0, 2, 3)), (-3, (0, 2, 3)), (3, (0, 1, 2)), (4, (0, 1, 2)), (-3, (0, 1, 2)), (-4, (0, 1, 2)), …)
opposite_edge(label, edge)[source]#

Return the polygon label and edge index when crossing over the edge of the polygon label.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.opposite_edge().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().delaunay_triangulation()
sage: S.opposite_edge((0, (0, 1, 2)), 0)
((1, (0, 2, 3)), 1)
polygon(label)[source]#

Return the polygon with label.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.polygon().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().delaunay_triangulation()
sage: S.polygon((0, (0, 1, 2)))
Polygon(vertices=[(0, 0), (1, 0), (1, 1)])
roots()[source]#

Return root labels for the polygons forming the connected components of this surface.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.roots().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().delaunay_triangulation()
sage: S.roots()
((0, (0, 1, 2)),)
class flatsurf.geometry.delaunay.LazyMutableOrientedSimilaritySurface(surface, category=None)[source]#

A helper surface for LazyDelaunayTriangulatedSurface.

A mutable wrapper of an (infinite) reference surface. When a polygon is not present in this wrapper yet, it is taken from the reference surface and can then be modified.

Note

This surface does not implement the entire surface interface correctly. It just supports the operations in the way that they are necessary to make LazyDelaunayTriangulatedSurface work.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase()

sage: from flatsurf.geometry.delaunay import LazyMutableOrientedSimilaritySurface
sage: T = LazyMutableOrientedSimilaritySurface(S)
sage: p = T.polygon(0)
sage: p
Polygon(vertices=[(0, 0), (1, 0), (1, 1), (0, 1)])
sage: q = p * 2

sage: S.replace_polygon(0, q)
Traceback (most recent call last):
...
AttributeError: '_InfiniteStaircase_with_category' object has no attribute 'replace_polygon'...

sage: T.replace_polygon(0, q)
sage: T.polygon(0)
Polygon(vertices=[(0, 0), (2, 0), (2, 2), (0, 2)])
glue(x, y)[source]#

Glue the (label, edge) pair x with the pair y in this surface.

This unglues any existing gluings of these edges.

Note

After a sequence of such glue operations, no edges must be unglued. Otherwise, gluings get copied over from the underlying surface with confusing side effects.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase()

sage: from flatsurf.geometry.delaunay import LazyMutableOrientedSimilaritySurface
sage: T = LazyMutableOrientedSimilaritySurface(S)
sage: T.gluings()
(((0, 0), (1, 2)), ((0, 1), (-1, 3)), ((0, 2), (1, 0)), ((0, 3), (-1, 1)), ((1, 0), (0, 2)), ((1, 1), (2, 3)), ((1, 2), (0, 0)), ((1, 3), (2, 1)), ((-1, 0), (-2, 2)),
 ((-1, 1), (0, 3)), ((-1, 2), (-2, 0)), ((-1, 3), (0, 1)), ((2, 0), (3, 2)), ((2, 1), (1, 3)), ((2, 2), (3, 0)), ((2, 3), (1, 1)), …)
sage: T.glue((0, 0), (1, 0))
sage: T.glue((1, 2), (0, 2))
sage: T.gluings()
(((0, 0), (1, 0)), ((0, 1), (-1, 3)), ((0, 2), (1, 2)), ((0, 3), (-1, 1)), ((1, 0), (0, 0)), ((1, 1), (2, 3)), ((1, 2), (0, 2)), ((1, 3), (2, 1)), ((-1, 0), (-2, 2)),
 ((-1, 1), (0, 3)), ((-1, 2), (-2, 0)), ((-1, 3), (0, 1)), ((2, 0), (3, 2)), ((2, 1), (1, 3)), ((2, 2), (3, 0)), ((2, 3), (1, 1)), …)
is_mutable()[source]#

Return whether this surface is mutable, i.e., return True.

This implements flatsurf.geometry.categories.topological_surfaces.TopologicalSurfaces.ParentMethods.is_mutable().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase()

sage: from flatsurf.geometry.delaunay import LazyMutableOrientedSimilaritySurface
sage: T = LazyMutableOrientedSimilaritySurface(S)
sage: T.is_mutable()
True
labels()[source]#

Return the labels of this surface which are just the labels of the underlying reference surface.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.labels().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase()

sage: from flatsurf.geometry.delaunay import LazyMutableOrientedSimilaritySurface
sage: T = LazyMutableOrientedSimilaritySurface(S)
sage: T.labels()
(0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, -6, 7, -7, 8, …)
opposite_edge(label, edge)[source]#

Return the polygon label and edge index when crossing over the edge of the polygon label.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.opposite_edge().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase()

sage: from flatsurf.geometry.delaunay import LazyMutableOrientedSimilaritySurface
sage: T = LazyMutableOrientedSimilaritySurface(S)
sage: T.opposite_edge(0, 0)
(1, 2)
polygon(label)[source]#

Return the polygon with label.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.polygon().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase()

sage: from flatsurf.geometry.delaunay import LazyMutableOrientedSimilaritySurface
sage: T = LazyMutableOrientedSimilaritySurface(S)
sage: T.polygon(0)
Polygon(vertices=[(0, 0), (1, 0), (1, 1), (0, 1)])
replace_polygon(label, polygon)[source]#

Swap out the polygon with the label label with polygon.

The polygons must have the same number of sides since gluings are kept.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase()

sage: from flatsurf.geometry.delaunay import LazyMutableOrientedSimilaritySurface
sage: T = LazyMutableOrientedSimilaritySurface(S)
sage: T.replace_polygon(0, T.polygon(0))
roots()[source]#

Return root labels for the polygons forming the connected components of this surface.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.roots().

Note

This assumes that glue() is never called to glue components.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase()

sage: from flatsurf.geometry.delaunay import LazyMutableOrientedSimilaritySurface
sage: T = LazyMutableOrientedSimilaritySurface(S)
sage: T.roots()
(0,)
class flatsurf.geometry.delaunay.LazyTriangulatedSurface(similarity_surface, relabel=None, category=None)[source]#

Surface class used to triangulate an infinite surface.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase()
sage: S = S.triangulate()
is_compact()[source]#

Return whether this surface is compact as a topological space.

This implements flatsurf.geometry.categories.topological_surfaces.TopologicalSurfaces.ParentMethods.is_compact().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().triangulate()
sage: S.is_compact()
False
is_mutable()[source]#

Return whether this surface is mutable, i.e., return False.

This implements flatsurf.geometry.categories.topological_surfaces.TopologicalSurfaces.ParentMethods.is_mutable().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().triangulate()
sage: S.is_mutable()
False
labels()[source]#

Return the labels of this surface.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.labels().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().triangulate()
sage: S.labels()
((0, (0, 1, 2)), (1, (0, 2, 3)), (-1, (0, 2, 3)), (0, (0, 2, 3)), (1, (0, 1, 2)), (2, (0, 1, 2)), (-1, (0, 1, 2)), (-2, (0, 1, 2)), (2, (0, 2, 3)), (3, (0, 2, 3)),
 (-2, (0, 2, 3)), (-3, (0, 2, 3)), (3, (0, 1, 2)), (4, (0, 1, 2)), (-3, (0, 1, 2)), (-4, (0, 1, 2)), …)
opposite_edge(label, edge)[source]#

Return the polygon label and edge index when crossing over the edge of the polygon label.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.opposite_edge().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().triangulate()
sage: S.opposite_edge((0, (0, 1, 2)), 0)
((1, (0, 2, 3)), 1)
polygon(label)[source]#

Return the polygon with label.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.polygon().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().triangulate()
sage: S.polygon((0, (0, 1, 2)))
Polygon(vertices=[(0, 0), (1, 0), (1, 1)])
roots()[source]#

Return root labels for the polygons forming the connected components of this surface.

This implements flatsurf.geometry.categories.polygonal_surfaces.PolygonalSurfaces.ParentMethods.roots().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.infinite_staircase().triangulate()
sage: S.roots()
((0, (0, 1, 2)),)