flatsurf / sage-flatsurf

Flat surfaces in Sage
https://flatsurf.github.io/sage-flatsurf/
GNU General Public License v2.0
10 stars 10 forks source link

Better layouting algorithms and elementary geometry #256

Open saraedum opened 10 months ago

saraedum commented 10 months ago

We should improve our plotting. With the improvements from #243, the unfolding of the (2,3,14) triangle plots as:

sage: from flatsurf import Polygon
sage: T = Polygon(angles=(3, 4, 13))
sage: from flatsurf import similarity_surfaces
sage: S = similarity_surfaces.billiard(T).minimal_cover('translation')
sage: S.plot()

image

Obviously, the polygon labels are useless and should probably not be displayed most of the time (e.g. when they overlap with each other? Or at least not for unfoldings.)

More importantly, the layout of the triangles should not have that many overlaps and rather display several components. There are some experiments in that direction in vue-flatsurf which displays the surface as:

image

That algorithm is a bit slow. The underlying idea is to find a layout that minimizes the area of a bounding rectangle (not axis-aligned.)

To make anything like that happen we need better intersection algorithms. Currently we only have get_point_position to decide how a point relates to a polygon. We also need how edges relate to each other, how edges relate to polygons and finally built from all that how polygons relate to each other. Afaik, this is not implemented in SageMath for general rings.