Skip to content

Commit

Permalink
A draft for supporting angles greater 2π in EquiangularPolygons
Browse files Browse the repository at this point in the history
  • Loading branch information
saraedum committed Jun 7, 2022
1 parent 4310201 commit 6d4c4c2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 11 deletions.
14 changes: 14 additions & 0 deletions flatsurf/geometry/gl2r_orbit_closure.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ class GL2ROrbitClosure:
sage: O # long time, optional: pyflatsurf
GL(2,R)-orbit closure of dimension at least 8 in H_7(4^3, 0) (ambient dimension 17)
Computing the orbit closure of a pentagon with an angle greater than 2π::
sage: E = EquiangularPolygons(14, 1, 1, 1, 1)
sage: P = E.an_element()
sage: S = similarity_surfaces.billiard(P, comb_edges=[(0, 2), (0, 3)])
sage: S = S.minimal_cover(cover_type="translation")
sage: O = GL2ROrbitClosure(S); O # optional: pyflatsurf
GL(2,R)-orbit closure of dimension at least 2 in H_7(6^2, 0^4) (ambient dimension 19)
sage: bound = E.billiard_unfolding_stratum('half-translation', marked_points=True).dimension()
sage: for decomposition in O.decompositions(1): # long time, optional: pyflatsurf
....: O.update_tangent_space_from_flow_decomposition(decomposition)
....: if O.dimension() == bound: break
sage: O # long time, optional: pyflatsurf
TESTS::
sage: from flatsurf import translation_surfaces
Expand Down
20 changes: 11 additions & 9 deletions flatsurf/geometry/polygon.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ def triangulate(vertices):
r"""
Return a triangulation of the list of vectors ``vertices``.
This function assumes that ``vertices`` form the vertices of a polygon
enumerated in counter-clockwise order.
This function assumes that ``vertices`` form the vertices of a simple
polygon enumerated in counter-clockwise order.
EXAMPLES::
Expand Down Expand Up @@ -671,7 +671,7 @@ def __init__(self, parent, vertices, check=True):
self._v = tuple(map(V, vertices))
for vv in self._v: vv.set_immutable()
if check:
self._non_intersection_check()
# self._non_intersection_check()
self._inside_outside_check()

def _inside_outside_check(self):
Expand All @@ -695,10 +695,7 @@ def _non_intersection_check(self):
sage: from flatsurf import Polygons
sage: P = Polygons(QQ)
sage: P(vertices=[(0,0),(2,0),(1,1),(1,-1)])
Traceback (most recent call last):
...
ValueError: edge 0 (= ((0, 0), (2, 0))) and edge 2 (= ((1, 1), (1, -1))) intersect
"""
n = len(self._v)
for i in range(n-1):
Expand Down Expand Up @@ -1999,6 +1996,13 @@ class EquiangularPolygons:
sage: E = EquiangularPolygons(1, 1, 1, 1, 1)
sage: E(1, 1, 1, 1, 1, normalized=True)
Polygon: (0, 0), (1, 0), (1/2*c^2 - 1/2, 1/2*c), (1/2, 1/2*c^3 - c), (-1/2*c^2 + 3/2, 1/2*c)
A pentagon with an angle greater than 2π::
sage: E = EquiangularPolygons(14, 1, 1, 1, 1)
sage: E.an_element()
Polygon: (0, 0), (13, 0), (-6*c - 2, 5*c + 6), (c + 2, c - 15), (c + 2, 2*c + 3)
"""
def __init__(self, *angles, **kwds):
if 'number_field' in kwds:
Expand All @@ -2021,8 +2025,6 @@ def __init__(self, *angles, **kwds):
# Store each angle as a multiple of 2π, i.e., normalize them such their sum is (n - 2)/2.
angles = [a / sum(angles) for a in angles]
angles = [a * ZZ(n - 2) / 2 for a in angles]
if any(angle <= 0 or angle >= 1 for angle in angles):
raise ValueError("each angle must be > 0 and < 2 pi")
self._angles = angles
assert sum(self._angles) == ZZ(n - 2) / 2

Expand Down
10 changes: 8 additions & 2 deletions flatsurf/geometry/similarity_surface_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def self_glued_polygon(P):
return HalfTranslationSurface(s)

@staticmethod
def billiard(P, rational=False):
def billiard(P, rational=False, comb_edges=None):
r"""
Return the ConeSurface associated to the billiard in the polygon ``P``.
Expand Down Expand Up @@ -498,6 +498,12 @@ def billiard(P, rational=False):
ConeSurface built from 2 polygons
sage: TestSuite(S).run() # long time (6s), optional: exactreal
Unfolding a pentagon with an angle greater than 2π:
sage: E = EquiangularPolygons(14, 1, 1, 1, 1)
sage: P = E.an_element()
sage: S = similarity_surfaces.billiard(P, comb_edges=[(0, 2), (0, 3)])
"""
if not isinstance(P, Polygon):
raise TypeError("invalid input")
Expand All @@ -508,7 +514,7 @@ def billiard(P, rational=False):
# triangulate non-convex ones
base_ring = P.base_ring()
C = ConvexPolygons(base_ring)
comb_edges = P.triangulation()
comb_edges = comb_edges or P.triangulation()
vertices = P.vertices()
comb_triangles = build_faces(len(vertices), comb_edges)
triangles = []
Expand Down

0 comments on commit 6d4c4c2

Please sign in to comment.