earcut.hpp icon indicating copy to clipboard operation
earcut.hpp copied to clipboard

Any way to make this use even-odd rule?

Open jwwalker opened this issue 4 years ago • 1 comments

I was hoping to use earcut to replace the glu tessellation functions in OpenGL, but I get different results in some cases. For example, suppose you have 3 non-intersecting nested contours, a square inside a square inside a square. I was expecting to get triangles between the outermost and middle square, and inside the innermost square, but got something else. Can any adjustment be made, or is it just the wrong algorithm to do what I want?

jwwalker avatar Apr 06 '21 00:04 jwwalker

Yeah, this library is designed specifically for valid polygon inputs without self-intersections, nested rings (beyond holes) etc. Handling more complex cases is a difficult problem and is out of scope for this library at the moment.

mourner avatar Apr 06 '21 06:04 mourner