Improve robustness of mesh/mesh intersection #286
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.
This PR further improves the robustness the mesh/mesh intersection for a better handling of pars of meshes with coplanar triangles. This was motivated by the need to fix a case where the same mesh would be cut multiple times by the exact same second mesh. All cuts except for the first one result in degenerate cases where many triangles are coplanar.
This applies the following changes:
Tolerances can now be specified for the mesh/mesh intersection (the method has been made public), and for the convex-polygons intersection.
The variable names in convex-polygons intersection have be changed for better readability.
Note that this introduces a O(n²) complexity for the case where a polygon is fully inside the other one. This can be addressed in a future PR.