fix(kernel-adapter): let an extrusion join the body it was sketched on - #110
Merged
Conversation
A boss grown off a face meets its target exactly at that face and shares no volume with it, so the stored-add rebuild refused it: the guard tested shared volume alone, and tangency measures zero. Growing a boss is the commonest way to add material to a body, and it landed as a disconnected second solid. An add now also accepts contact, measured by exact solid distance against the same numerical tolerance union connectivity uses, so touching joins and a real gap still refuses. A cut is unchanged — with no shared material there is nothing to remove. Bounding boxes deliberately do not decide this: two solids can share an overlapping box while sitting well clear of each other, which is exactly the decoy the inference tests already pin. With the rebuild accepting it, the extrude inference can act on direction again: a face-attached sketch grown away from its body stores an add, the mirror of the cut it already stores for one pushed in. Tangency never reaches the candidate list — the bounds test rejects a zero-width overlap — so the target comes from the live bodies, and the exact rebuild still has the final say on whether they meet. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
openzcad | 19959ab | Aug 27 2026, 08:56 PM |
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.
Closes the modeling gap I flagged when landing #100: a boss grown off a face landed as a disconnected second body instead of joining. Based on
main.The defect
A boss extruded away from the face it was sketched on meets its target exactly at that face. It shares no volume — tangency measures zero — so the stored-add rebuild threw
Stored add extrusion no longer overlaps …and the inference fell back to new-body. Growing a boss is the commonest way to add material to a body, and it produced a coincident pair of solids.The fix, in two layers
1. The rebuild guard (
exact-feature-builders). It tested shared volume for both operations. Now:solidsShareMaterialOrTouchhelper: exactsolidToSolidDistanceagainst the same numerical toleranceunion-connectivityuses (EPSILON × scale × 128), which is deliberately far tighter than a modeling tolerance so touching joins and a real gap still refuses.This also makes extrude-add agree with the Union feature, which has always accepted face contact — the two disagreed about what "joined" means.
2. The inference (
extrudeInference). With the rebuild accepting it, the direction hint from #100 gets its mirror: a face-attached sketch grown away from its body stores an add, as one pushed into it already stores a cut. Tangency never reaches the candidate list (the bounds test rejects a zero-width overlap), so the target comes from the live bodies — and the exact rebuild still has the final say.What the tests caught
My first attempt used the Union feature's
detectCoincidentFaces(…).aabbOverlapfallback and broke three existing tests, including the decoy case that pins exactly this: two solids can share an overlapping bounding box while sitting well clear of each other. Exact distance is the honest signal; bounding boxes are not. A second self-inflicted break came from rewording the error message —isMeasuredZeroOverlapmatches that sentence, so the wording stays, now with a comment saying why.New tests: a boss joins as one body of the right volume with no warnings; an extrusion on a plane clear of the target is still refused.
Verification
pnpm typecheck✓ ·pnpm lint0 errors ·pnpm test:coverage1988 passed (14/14 inextrude-operation, including the 3 pre-existing ones my first attempt broke)🤖 Generated with Claude Code