-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
triangulation failed for surfaces built with non-convex polygons #239
Comments
It's a bit bizarre that this is not using the triangulation of the polygon but that surfaces are implementing their own triangulation. So, triangulating an infinite surface uses polygon triangulation but finite surfaces implement it on their own 🤷 |
Anyway, this is the fix: diff --git a/flatsurf/geometry/surface.py b/flatsurf/geometry/surface.py
index 096c6ee..2e26f70 100644
--- a/flatsurf/geometry/surface.py
+++ b/flatsurf/geometry/surface.py
@@ -2056,7 +2056,7 @@ class MutableOrientedSimilaritySurface(
for i in range(n):
e1 = poly.edge(i)
e2 = poly.edge((i + 1) % n)
- if ccw(e1, e2) != 0:
+ if ccw(e1, e2) > 0:
# This is in case the polygon is a triangle with subdivided edge.
e3 = poly.edge((i + 2) % n)
if ccw(e1 + e2, e3) != 0: |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See eg #238.
Even though triangulation of non-convex polygons seem to work:
The text was updated successfully, but these errors were encountered: