Skip to content

feat(mechanism): hinge and closure follow the design's parameters (#446) - #460

Merged
ManuelStaggl merged 2 commits into
mainfrom
feat/mechanisms-follow-parameters
Nov 15, 2026
Merged

ManuelStaggl merged 2 commits into
mainfrom
feat/mechanisms-follow-parameters

Conversation

@ManuelStaggl

Copy link
Copy Markdown
Collaborator

Part of #446 (token use). In the real run of 2026-11-15 "Make the box 10 mm taller" took 20 requests and 1.37 M input tokens: hinge and closure stayed at the old height, so the model took them back and built them again.

What changes

  • partbuddy_mechanism hinge: a line PartBuddy finds follows how the two bodies' boxes move with the design's free length parameters (each nudged by 1 mm in a rolled-back batch), across the gap and in height, e.g. width + 0.5 * hinge_gap, 0.5 * box_height + 0.5 * lid_height. Along the line it keeps length and place.
  • from/to/hinge_from/hinge_to take length expressions; hinge and closure follow them, the other kinds place by their value and say they stay.
  • followSteps (shared/mechanisms.ts) writes cylinder/box bases as expressions and draws each profile on the principal plane at an offset; checked with solidcraft-cli 0.42.0 headless: sketch.create's own origin takes numbers only, offset and sketch points take expressions and follow, solid.chamfer edges take numbers only (they are re-found), joint.as_built at a point stays behind.
  • The joint is made with joint.create on the round faces of pin and bore, so it follows both (kept on one side only, it dragged the lid); the closure keeps it again on the lid's remade bore.
  • Closure: follows the expressions given, else the nearest side of the lid's box, and only together with a hinge that follows.
  • After a parameter change (set_parameter, parameters.change) PartBuddy runs hinges that follow through their range again and sets their limits.

Measured (token-probe, PROBE_REAL=1, Claude Code, box prompt from #446): change turn 4 requests, 227 k input (before 20 / 1.37 M), print check clean; the 4th request is waiting for the running print check. Build 6+2+3+14 requests.

Tests: test/mechanismFollow.test.ts (expression inputs, plane conversion, derived expressions, re-read hinge, limits again); tools/audit/cases/box-446-follow.case.ts against SolidCraft 0.42.0: after both halves grow 5 mm no shared volume, joint axis at 25 mm, shuts to 177°, print check clean; mechanik/box-446/hinge-standard/bloecke-expression audit cases green; eslint, typecheck, unit tests (except supervisor.test.ts, which fails on main too).

🤖 Generated with Claude Code

ManuelStaggl and others added 2 commits November 15, 2026 21:09
"Make the box 10 mm taller" took hinge and closure back and built them
again (20 requests, 1.37 M input tokens in the real run of 2026-11-15).

- A hinge whose line PartBuddy finds follows how the two bodies' boxes
  move with the design's free length parameters (measured with each
  nudged by 1 mm in a rolled-back batch): across the gap and in height,
  e.g. `width + 0.5 * hinge_gap` and `0.5 * box_height + 0.5 * lid_height`.
- from/to/hinge_from/hinge_to take length expressions; hinge and closure
  follow them, the other kinds place by their value and say they stay.
- `followSteps` (shared/mechanisms.ts) writes bases as expressions and
  draws each profile on the principal plane at an offset (sketch.create's
  own origin takes numbers only in SolidCraft 0.42.0).
- The joint is kept on the round faces of pin and bore with joint.create,
  so it follows both; the closure keeps it again on the lid's remade bore.
- The closure follows the expressions it was given, else the nearest side
  of the lid's box, and only together with a hinge that follows.

Tests: test/mechanismFollow.test.ts; tools/audit/cases/box-446-follow
against SolidCraft 0.42.0: after both halves grow 5 mm the bodies share
no volume, the joint's axis is at 25 mm, the lid shuts to 177 degrees and
the print check is clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gain after a change (#446)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ManuelStaggl
ManuelStaggl merged commit a0ff3fd into main Nov 15, 2026
10 checks passed
@ManuelStaggl
ManuelStaggl deleted the feat/mechanisms-follow-parameters branch November 15, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant