Polygon Triangulation Failure
The ear clipping triangulation fails for this `I` shape. It looks like that at some point while clipping vertices, it ends up with 3 neighbours that are allllmost colinear, and marks them as reflex when they should be convex. If I decrease the fudge value for the reflex calculation it all works fine, but I worry that'll come back to haunt me.
I'm sure it's hard to nail down all these degenerate shapes so I'm going to try find a workaround (all my shapes are of similar scale, so maybe messing with the fudge will be ok) but thought you'd enjoy a "fun" test case.
Points are at the bottom of this debug log:
https://gist.github.com/EddieCameron/0031335ab4a0fb3486511c3865ca4e52
Cheers!
I ended up fixing by scaling the input and converting to integers before running the calculations without any fudging (like ClipperLib: https://github.com/AngusJohnson/Clipper2).
Would be a bit hard to make general since you need to choose an appropriate scale, but good enough for me. Can send code over if you like but it's essentially copypasting the `GenPolygonMesh` function and swapping all the floats for ints/longs