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
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.
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.
Vertices:
[10,10, 25,10, 25,40, 10,40, 15,30, 20,35, 10,40, 15,15, 15,20, 20,15]
Hole Indicies:
[4, 7]
Triangle Indices (result):
[9,7,0, 0,7,8, 2,6,5, 4,6,0, 0,1,2, 5,4,0, 0,2,5]
The text was updated successfully, but these errors were encountered: