Make triangulator exceptions optional #160
Merged
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.
Fixes #148
The Boolean.Close test is no longer disabled. I added an execution param: processOverlaps, which tells the triangulator to be robust to overlapping input instead of throwing exceptions. The danger of course is that the triangulator can't actually do anything geometrically "good" with overlapped input, so it'll just make a basically arbitrary manifold triangulation. This has the potential to make small overlaps much worse, but it also solves this issue of small pieces of geometry getting past their precision limit.
I've looked at the output sphere; it seems generally fine (of course lots of small triangles along the diameter where the intersections are taking place). It's a bit hard to tell how overlapped they are, but hopefully its decent for most uses. Also, it's a pretty extreme input in the first place.
This now sets the stage for having a compile-time option to remove exceptions entirely.
One strange thing: I cut the test down from 10 to 6, because on 6 it was failing with
munmap_chunk(): invalid pointer
. I tried running valgrind, but it was so slow I gave up. We should look into this further; if we can manage to output the problem polygon, I should be able to debug it.