Fix false positive triangle-triangle intersections - #7539
Open
gyuun wants to merge 2 commits into
Open
Conversation
|
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Type
Motivation and Context
TriangleTriangle3dapplies an absolute tolerance to plane-equation values computed with unnormalized triangle normals. For the triangles reported in #5117, this changes one of three same-sign values to zero, bypasses the same-side rejection, and produces a false positive.The result also changes after a rigid rotation because the per-axis normalization changes the magnitude of these plane-equation values.
Checklist:
python util/check_style.py --applyto apply Open3D code styleto my code.
updated accordingly.
results (e.g. screenshots or numbers) here.
Description
This change adds a conservative half-space rejection before the existing triangle-triangle predicate.
Signed distances are computed using a unit triangle normal. If all three vertices of either triangle are unambiguously on the same side of the other triangle's supporting plane, the triangles are reported as separated. Ambiguous, coplanar, near-parallel, degenerate, and non-finite cases continue to use the existing predicate.
This is an early rejection only: it returns
falsesolely when plane separation is unambiguous. All uncertain cases fall through to the existing predicate unchanged.An alternative would be to scale the epsilon used inside
NoDivTriTriIsectby the corresponding normal magnitude, which is equivalent to applying the tolerance to unit-normal signed distances. That approach could eliminate the additional precheck, but it would require modifying vendored third-party code and could change near-coplanar classification throughout the existing predicate.This PR therefore leaves the vendored implementation unchanged and adds only a conservative wrapper-level rejection for geometrically unambiguous separation.
No public API or third-party code is changed.
Tests added:
TriangleMeshintegration coverage.TriangleMeshAPI coverage.Test results:
testsandpython-packagetargets built successfully.This is my first contribution to Open3D, so I would appreciate any feedback on the approach or test coverage. Thank you for reviewing!