mapbox / earcut.hpp

Fast, header-only polygon triangulation
ISC License
858 stars 133 forks source link

missing triangle #109

Closed christophegithubtts closed 1 year ago

christophegithubtts commented 1 year ago

Hello I have noticed that earcut outputs only 6 triangles instead of 7 from the following polygon bug bug.txt

I have also tried to offset all coordinates to make them relative to the first point but that does not solve the issue. So i believe there is a bug which is quite surprising since the input polygon is very simple !

I hope someone can investigate this issue

christophegithubtts commented 1 year ago

Also note that GLU tesselator outputs 7 triangles as expected

mrgreywater commented 1 year ago

This is known behavior. Earcut cleans up colinear points while triangulating.

image

Duplicate of https://github.com/mapbox/earcut/issues/74 https://github.com/mapbox/earcut.hpp/issues/100