polypartition
polypartition copied to clipboard
Ear clipping with `Triangulate_EC` fails for polygon with a vertex intersecting an edge
This is the polygon:
Running ./polypartition_test on this (modified to print the return value of Triangulate_EC) results in a failure.
Here is the result in tri_ec.bmp:
Here is the polygon in the format of test_input.txt (a single polygon with 14 points, which is not a hole):
1
14
0
2445 885
2445 855
2385 915
2385 855
2445 795
2445 735
2565 735
2505 795
2535 795
2535 765
2565 765
2565 915
2415 915
2415 885
Maybe this issue can be closed because the input polygon has "self-intersections" (in two points), or maybe there is a bug that can be fixed.
From a brief look, it seems that earfound = false at some point, and then the algorithm is aborted and failure is returned.
Downstream Godot issue:
- https://github.com/godotengine/godot/issues/104452