fix(boolean): recover coplanar boundary triangles dropped in normalization (#2111) - #2217
Merged
Merged
Conversation
…ation (#2111) TriangulatePlane classifies each candidate triangle by casting a ray from its centre and testing containment in both operands. A coplanar face whose centre lies exactly on a face of an operand is classified as neither inside nor boundary, so the triangle is dropped and the result develops a hole (the "missing geometry" family, e.g. thin walls). Rescue such a triangle inside the normalization pipeline: if its centre lies on an original face of A and is not strictly inside B, mark it as an A boundary and keep it. Recovering it here rather than stitching afterwards reuses the already-welded vertices, so no T-junctions or non-manifold edges are introduced. Fixes #2111
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.
Problem
TriangulatePlane(fuzzybools normalization) classifies each candidate triangle by casting a ray from its centre and testing containment in both operands. A coplanar face whose centre lies exactly on a face of an operand is classified as neitherINSIDEnorBOUNDARY, so the triangle is dropped and the boolean result develops a hole — the "missing geometry" family (e.g. thin walls, slab tops), tracked in #2111.Fix
Rescue such a triangle inside the normalization pipeline: if its centre lies on an original face of
Aand is not strictly insideB, mark it as anAboundary (recording that face's normal for correct winding) and keep it.Recovering it here — rather than stitching afterwards — reuses the already-welded vertices, so no T-junctions or non-manifold edges are introduced by the recovery. The change is gated behind the existing "both operands non-boundary" drop condition, so only triangles that would otherwise be discarded are considered.
Verification (native geomquality A/B, main vs this branch)
No model that opened before hangs or crashes. Naked-edge / non-manifold totals:
Fixes #2111