-
Notifications
You must be signed in to change notification settings - Fork 208
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
Holes and T-junctions? #105
Comments
You could potentially detect those T junction edges in the function earcutLinked, and avoid cutting ears on them in the first pass. You would also need to try to avoid creating these junctions in findHoleBridge. edit: Looking at the marked edges, I think I misunderstood the issue and this is a duplicate of #74 |
Thanks for looking at it. I will have to give the issue more thought. |
I think you're correct. I should explain my application also goes beyond just rendering. T-junctions are cracks in the model, it prevents certain edge traversing algorithms from functioning properly (e.g. can't walk across an edge). I haven't encountered a case yet where earcut creates T-junctions without holes, but it seems it's more likely to create them when holes are included. |
Let's close as a duplicate of #74 |
As a workaround, In case you are sure your polygons are simple, and you're fine with loosing some robustness, you can comment out the |
Thanks, does earcut behave more like GLUtessellator when degenerate triangles are kept? I used GLUtessellator before, and technically, I would say it doesn't create T-junctions. But, if you run the triangulated polygon through a mesh cleaner that removes degen trigs, T-junctions are created. This is because degen trigs were inserted into the edges during triangulation, which somewhat fixed the issue, but not in the best way. Perhaps an earcutter needs another level of awareness, not just knowing how points are connected, but how edges are connected too. |
Can mapbox earcut completely eliminate T-junctions?
I have an issue where triangulating a polygon with holes is creating T-junctions.
For data:
#104
One of the main reasons why I was looking for a poly tesselator, is to create a triangulation without T-junctions. This is when the vertex lies against an edge, but doesn't connect.
Thanks.
The text was updated successfully, but these errors were encountered: