You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tessellation error with two holes (one touching outer vertex) #45
Here's a sample that results in an incorrect tessellation. Appears to be caused when there are two holes where one touches the outer ring and the other does not. Below is an example.
The first is the actual polygon (gray polygon, white holes), the second is it after running through Earcut, where the dark gray is overlap of triangles. The third is the same as the second except with each triangle having its edges highlighted.
Note it does not actually matter where the hole that is entirely enclosed is. The one that does touch the ring must be touching a vertex.
Indentified this as a bug in the hole bridge algorithm. Reproducible with [[[10,10], [25,10], [25,40], [10,40]], [[15,30], [20,35], [10,40]]] (it finds a degenerate bridge along the left edge). Looking into a fix.
Activity
mourner commentedon Jan 4, 2016
Thanks for reporting! I'll look into it. I hoped we fixed all cases like this with https://github.com/mapbox/earcut/issues/39 but apparently not.
mourner commentedon Jan 19, 2016
Indentified this as a bug in the hole bridge algorithm. Reproducible with
[[[10,10], [25,10], [25,40], [10,40]], [[15,30], [20,35], [10,40]]](it finds a degenerate bridge along the left edge). Looking into a fix.