[Constraint 2.0 / B] Allow target=$datum_name syntax #10
Labels
No labels
blocked:needs-attention
blocked:needs-decision
blocked:needs-decompose
blocked:needs-design
blocked:needs-triage
blocked:unclassified
bug
documentation
enhancement
gsd-spec
in-progress
needs-decompose
priority:high
priority:low
priority:medium
quickfix
test
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/kimi_agent_openscad_parametric_gui#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Allow
target=to address a datum (depends on sub-issue #A)Why: today
// @sf:place target=motor_mount face=topresolves only to a module/instance name. After datums exist, the user must be able to constrain against a datum — e.g.// @sf:place target=$hinge_axis face=top type=flushmeans "my part is flush with my face onto the named axis," not "onto another part."Spec change in
src/lib/scad/constraints.ts:targetfield onPlaceConstraint,DistanceConstraint,AngleConstraintfromstringtostringwith the convention: a leading$means it's a datum name (lookup in the project manifest'sDatumarray); otherwise it's a module/instance name as today.targetstarts with$, look up the datum; if not found, error in UI ("Datum '$foo' not declared in any project file").Files to change:
src/lib/scad/constraints.ts(parse + serialize target= with$prefix detection)src/lib/scad/solver.ts(datum lookup branch inresolveInstance(),instanceKeyOf())src/lib/scad/constraintCodegen.ts(~30 LOC: pass datum binding through to.scadexport)src/components/workbench/ConstraintPanel.tsx(UI selector: "target: [module ▾] [datum ▾]")Acceptance:
target=motor_mountannotations still resolve identically (regression).target=$hinge_axisresolves and the placeholder pattern inconstraintCodegen.ts(line ~75, currently uses a fallback) gets replaced with the datum geometry.$prefix.Labels: enhancement
Part of epic #8.