Repository navigation
fix: mass properties on the caller's B-rep (#681 site 11) - #701
Merged
bherbruck merged 2 commits intoOct 24, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mass::integrator::properties::boundary built the oriented trim boundary on a whole-B-rep clone per face, where upstream's SmFace::ComputePreciseProperties builds it on the face itself: the UV trims CreateOrientedTrimBoundary makes (and what comes with them) were lost to the caller. face_properties, brep_properties and the SM_API entries on top of them (face_area, face_centroid, brep_area, brep_volume, brep_mass_properties) now take the caller's &mut Brep, and the copy is gone. Their bounding boxes are computed on the B-rep too, as upstream's. Test: face_area_makes_missing_uv_trims_on_the_callers_brep (a box with its UV trims stripped; fails on main: the trims stay on the copy). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Site 11 of the split agreed on #681: a B-rep copy where upstream works on the B-rep itself.
What.
mass::integrator::properties::boundarybuilt each face's oriented trim boundary on a whole-B-rep clone. Upstream'sSmFace::ComputePreciseProperties(SmFace.cpp, aconstmember) callsCreateOrientedTrimBoundary(*GetContext(), TRUE, TRUE, ..)on the face itself, so the UV trim curves it makes, and the tolerancesSetUVTrimCurveraises, stay on the B-rep. The copy is gone:face_properties,brep_propertiesand the SM_API entries built on them (face_area,face_centroid,brep_area,brep_volume,brep_mass_properties) take the caller's&mut Brep. Their bounding boxes (query::brep::calculate_bounding_box, which takes aLazyBrep) are computed on that B-rep too, so their edits persist as upstream's.Callers updated: difftest
mass_integratorand thesolidcraftrunner'smeasure(both own their B-reps),examples/primitives/checks.rs,tests/primitives_solid.rs. Thekey_ofinboundaryonly names the owners of the returned copies and is unchanged.Test.
mass::integrator::properties::tests::face_area_makes_missing_uv_trims_on_the_callers_brep: acreate_boxbox with its UV trims stripped;face_areaof one face is 1 and the box has trims afterwards. On main the area is right but the trims stay on the copy (the trims are made on the box itself).Checks (VM, base 20bef40): fmt; clippy with and without
difftest/cpp;cargo test -p solidcore; wasm;cargo test -p difftest --features cpp; full difftest sweep vs the base: no case changes (206 PASS / 54 PARTIAL units on both sides, 0 failed).PASS mass.integrator cases=1528 passed=1528 failed=0 deferred=0 max_rel_err=0e0before and after: each case integrates once, so the trims kept on the B-rep are not read again there. The change is about what the caller's B-rep holds afterwards, as upstream's does.🤖 Generated with Claude Code