[Constraint 2.0 / A] Datum registry — named points, axes, planes #9
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#9
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?
Foundation: Datum registry — addressable points/axes/planes independent of modules
Why this comes first: the current
target=field only resolves to a module/instance name. To put a hole's center onto the world coordinate origin, or an axis onto a non-existent point in space, we need datums — named, addressable geometric anchors that exist regardless of which part they're attached to.Spec additions to
src/lib/scad/constraints.ts:New annotation kinds:
// @sf:datum-point name=hinge_axis_pt expr=[x,y,z]—x/y/zmay be literal numbers or other shared-param names (the simple version of #? expressions).// @sf:datum-axis name=hinge_axis origin=hinge_axis_pt dir=[1,0,0]// @sf:datum-plane name=top_of_plate origin=hinge_axis_pt normal=[0,0,1]Storage: New
Datum[]field on the project manifest (.scadforge.json). The parser extracts them; the solver consults the registry whenevertarget=$<datum_name>appears in any other annotation.UI (workbench):
ConstraintPanel.tsx) currently lets user click two faces. Extend to: click two points in the viewport → name the result → persist to manifest.Parsing/serialization rules:
namemust be unique within project (enforce in solver, error in UI).expruses the expression grammar introduced by sub-issue #? (formulas). Until then, accept only numbers.Files to change:
src/lib/scad/constraints.ts(+~200 LOC: types, parser cases, serializer)src/lib/scad/parser.ts(resetAnnotationIds()interaction)src/lib/scad/solver.ts(datum lookup during resolve)src/lib/vfs.ts(newProjectDatumpersisted entry alongsideVfsFile)src/components/workbench/ConstraintPanel.tsx(Datum tab + Place-point-Datum mode toggle inConstraintPopovers.tsx)src/pages/landing/HeroScene.tsxetc. — no change unless marketing mock references datumsAcceptance:
// @sf:datum-*in the exported.scadzip.Out of scope (deferred to later sub-issues): addressing datums from
target=, expression values insideexpr=[…], formula-driven re-solve on datum change.Labels: enhancement
Part of epic #8.