Fix symmetric check on multi-body Compounds#11
Merged
Conversation
…rence Cutting a multi-child Compound against its mirror hands OCC several exactly-coincident tools in one boolean; its same-domain detection is unreliable on that degenerate input and children can come back uncut, so a coordinate-symmetric assembly could report >100% asymmetric volume on one plane while passing on another. Fuse all solids into a single body first so the mirror-difference is one well-posed boolean, and measure a single difference direction (mirroring is an isometry, so both directions enclose equal volume; summing them double-counted).
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.
The verify-gate's
symmetriccheck reported false failures on multi-body Compounds: a five-part stack that is exactly mirror-symmetric about YZ failed with "asymmetric volume 151% of total" while XZ passed on the same geometry.Root cause: the evaluator ran
shape - mirroreddirectly on the Compound. That hands OCC one cut where every tool solid coincides exactly with an argument solid (the mirror of symmetric geometry lands on the original). OCC's same-domain detection is unreliable on that degenerate input - children can come back completely uncut - and whether it fails depends on the face parametrization the mirror transform produces, which is why one plane passed and the other didn't. Summing both difference directions then double-counted the phantom volume, producing the impossible >100% ratio.Fix: fuse all solids into a single body before mirroring, so the mirror-difference is one well-posed solid-vs-solid boolean (same family as the earlier clearance-evaluator
&fix), and measure a single difference direction - mirroring is an isometry, so both directions enclose equal volume, and the reported ratio now stays within 0-100%.Tests: new regression test builds the symmetric five-part stack (fails before the fix with the exact live-run message) plus an off-center variant proving real asymmetry is still caught. 105/105 py-tests pass; golden.json is untouched (it pins no symmetric output).
🤖 Generated with Claude Code