jhasse/poly2tri

Crash with a simple polygon

wonder-sk opened this issue · 1 comments

e0ba327 caused a regression - this simple polygon will now crash during triangulation:

0 0
-5 -3e-10
-10 -2e-10
-10 -4
0 -4

From what I understand, Edge maintains invariant that p1.y < p2.y and in case p1.y == p2.y then p1.x < p2.x. However if the 1e10 tolerance is used for comparison of Y coordinates, this invariant is broken for the second edge and the subsequent code crashes later during triangulation.

I would therefore suggest rolling back that commit...

We should add a test case for that polygon.