Fix false positive triangle-triangle intersections - #7539
Open
gyuun wants to merge 3 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. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a conservative plane-separation precheck to reduce false-positive triangle intersections reported in #5117.
Changes:
- Adds unit-normal half-space rejection.
- Adds C++ and Python regression coverage.
- Documents the fix in the changelog.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
cpp/open3d/geometry/IntersectionTest.cpp |
Adds the separation precheck. |
cpp/tests/geometry/IntersectionTest.cpp |
Tests transformations, ordering, and near-parallel intersections. |
cpp/tests/geometry/TriangleMesh.cpp |
Adds C++ mesh integration coverage. |
python/test/geometry/test_trianglemesh.py |
Adds Python API regression coverage. |
CHANGELOG.md |
Records the bug fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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. If a triangle does not define a usable plane, that plane-separation check is skipped.
This is an early rejection only: it returns false solely when either supporting plane establishes an unambiguous separation. If neither plane establishes a clear separation, the existing predicate is used 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!