Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So, this doesn't actually solve #148, but it does fix part of it. I found my triangulator was failing on certain completely colinear polygons. The fix is fairly simple, since they just need to be identified - the simple monotone triangulator already works for them since any triangulation is admissible (all possible triangles are degenerate).
In the process of debugging I realized I didn't have as many intermediate checks operating in our tests as I had planned. I've enabled them now, which help the tests to catch more errors at the cost of a little slowdown (mostly on Sponge4, since most of its time is in triangulation). I also found and fixed a couple of bugs where I was accidentally recalculating normals instead of passing them along.
I've added the test from #148 as Disabled, since it still doesn't pass. Currently the triangulator fails on a simple polygon that is in fact ε-overlapped. I believe the issue is that the precision of the new intersection verts is worse than our precision calculation since nearly-parallel intersections can drive the error up to the size of the triangle overlaps. I'm not sure the best way to handle that - driving up the overall precision band with each operation will quickly make solutions impractical.
However, the good news is that I believe I now have a fairly simple way to create manifold (though geometrically invalid) triangulations from overlapped polygons. This should allow us to make all the triangulator exceptions optional, which was the biggest thing blocking #141. This may "solve" #148 too; the main question is whether small overlaps remain small or grow unacceptably large.