surface

Surfaces backed by pyflatsurf.

There should be no need to create such surfaces directly, not even for authors of sage-flatsurf. Instead just call pyflatsurf() on a surface which returns such a surface (or rather, a morphism to such a surface.)

EXAMPLES:

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

sage: T = S.pyflatsurf().codomain()  # optional: pyflatsurf  # random output due to cppyy deprecation warnings
sage: T  # optional: pyflatsurf
Surface backed by FlatTriangulationCombinatorial(vertices = (1, -3, 2, -1, 3, -2), faces = (1, 2, 3)(-1, -2, -3)) with vectors {1: (1, 0), 2: (0, 1), 3: (-1, -1)}

Ideally, there should be no need to use the underlying FlatTriangulation directly, but it can be accessed with Surface_pyflatsurf.flat_triangulation():

sage: T.flat_triangulation()  # optional: pyflatsurf
FlatTriangulationCombinatorial(vertices = (1, -3, 2, -1, 3, -2), faces = (1, 2, 3)(-1, -2, -3)) with vectors {1: (1, 0), 2: (0, 1), 3: (-1, -1)}
class flatsurf.geometry.pyflatsurf.surface.Surface_pyflatsurf(flat_triangulation)[source]

A translation surface backed by pyflatsurf.

Most surfaces in sage-flatsurf, such as the MutableOrientedSimilaritySurface are implemented in Python instead.

EXAMPLES:

sage: from flatsurf import Polygon, MutableOrientedSimilaritySurface

sage: S = MutableOrientedSimilaritySurface(QQ)
sage: S.add_polygon(Polygon(vertices=[(0, 0), (1, 0), (1, 1)]), label=0)
0
sage: S.add_polygon(Polygon(vertices=[(0, 0), (1, 1), (0, 1)]), label=1)
1

sage: S.glue((0, 0), (1, 1))
sage: S.glue((0, 1), (1, 2))
sage: S.glue((0, 2), (1, 0))

sage: S.set_immutable()

sage: T = S.pyflatsurf().codomain()  # optional: pyflatsurf
__annotations__ = {}
__eq__(other)[source]

Return whether this surface is indistinguishable from other.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.square_torus().pyflatsurf().codomain()  # optional: pyflatsurf
sage: T = translation_surfaces.square_torus().pyflatsurf().codomain()  # optional: pyflatsurf
sage: S == T  # optional: pyflatsurf
True
__hash__()[source]

Return a hash value for this surface that is compatible with __eq__().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.square_torus().pyflatsurf().codomain()  # optional: pyflatsurf
sage: T = translation_surfaces.square_torus().pyflatsurf().codomain()  # optional: pyflatsurf
sage: hash(S) == hash(T)  # optional: pyflatsurf
True
__init__(flat_triangulation)[source]
__module__ = 'flatsurf.geometry.pyflatsurf.surface'
__repr__()[source]

Return a printable representation of this surface, namely, print this surface essentially as pyflatsurf would.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.square_torus().triangulate().codomain()

sage: from flatsurf.geometry.pyflatsurf.surface import Surface_pyflatsurf
sage: S.pyflatsurf().codomain()  # optional: pyflatsurf
Surface backed by FlatTriangulationCombinatorial(vertices = (1, -3, 2, -1, 3, -2), faces = (1, 2, 3)(-1, -2, -3)) with vectors {1: (1, 0), 2: (0, 1), 3: (-1, -1)}
apply_matrix(m, in_place=None)[source]

Overrides the generic apply_matrix() for this pyflatsurf backed surface.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.square_torus().pyflatsurf().codomain()  # optional: pyflatsurf

sage: S.apply_matrix(matrix([[1, 2], [0, 1]])).codomain()  # optional: pyflatsurf
Surface backed by FlatTriangulationCombinatorial(vertices = (1, -3, 2, -1, 3, -2), faces = (1, 2, 3)(-1, -2, -3)) with vectors {1: (1, 0), 2: (2, 1), 3: (-3, -1)}
flat_triangulation()[source]

Return the pyflatsurf FlatTriangulation object underlying this surface.

Warning

This surface is supposed to be immutable. However, the FlatTriangulation is not immutable. If you make any changes to it, things might break in strange ways. If you want to make modifications to the FlatTriangulation be sure to work on a clone() of it instead.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.square_torus()
sage: S.pyflatsurf().codomain().flat_triangulation()  # optional: pyflatsurf
FlatTriangulationCombinatorial(vertices = (1, -3, 2, -1, 3, -2), faces = (1, 2, 3)(-1, -2, -3)) with vectors {1: (1, 0), 2: (0, 1), 3: (-1, -1)}
is_mutable()[source]

Return whether this surface is mutable.

Warning

This surface is supposed to be immutable. However, the underlying FlatTriangulation is not immutable. If you make any changes to it, things might break in strange ways. If you want to make modifications to the FlatTriangulation be sure to work on a clone() of it instead. See flat_triangulation().

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.square_torus()
sage: S.pyflatsurf().codomain().is_mutable()  # optional: pyflatsurf
False
opposite_edge(label, edge)[source]

Return the polygon and edge that is across from edge of label.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.square_torus().triangulate().codomain()
sage: S = S.pyflatsurf().codomain()  # optional: pyflatsurf

sage: S.opposite_edge((1, 2, 3), 0)  # optional: pyflatsurf
((-3, -1, -2), 1)
sage: S.opposite_edge((1, 2, 3), 1)  # optional: pyflatsurf
((-3, -1, -2), 2)
sage: S.opposite_edge((1, 2, 3), 2)  # optional: pyflatsurf
((-3, -1, -2), 0)
polygon(label)[source]

Return the polygon with label in this surface.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.square_torus().triangulate().codomain()
sage: S = S.pyflatsurf().codomain()  # optional: pyflatsurf

sage: S.polygon((1, 2, 3))  # optional: pyflatsurf
Polygon(vertices=[(0, 0), (1, 0), (1, 1)])
pyflatsurf()[source]

Return a version of this surface that is backed by pyflatsurf. Since this surface is already backed by pyflatsurf, this returns a trivial morphism.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.square_torus()
sage: T = S.pyflatsurf().codomain()  # optional: pyflatsurf

sage: T.pyflatsurf()  # optional: pyflatsurf
Identity endomorphism of Surface backed by FlatTriangulationCombinatorial(vertices = (1, -3, 2, -1, 3, -2), faces = (1, 2, 3)(-1, -2, -3)) with vectors {1: (1, 0), 2: (0, 1), 3: (-1, -1)}
roots()[source]

Return some root labels for this surface, one for each connected component of the surface.

EXAMPLES:

sage: from flatsurf import translation_surfaces
sage: S = translation_surfaces.square_torus()
sage: T = S.pyflatsurf().codomain()  # optional: pyflatsurf

sage: list(T.labels())  # optional: pyflatsurf
[(1, 2, 3), (-3, -1, -2)]

sage: T.roots()  # optional: pyflatsurf
((1, 2, 3),)