Make named creases material; add flap operands (#28) #43
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/material-creases"
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?
For #28. PR2 of the #26/#28 material-crease design — the user-facing half, built on PR1's edge entity (#40).
Makes named creases material: a named crease
--dnow resolves against its current edge-pieces and tracks through folds andflip, instead of being frozen to the table-space line it was bound to. Binding storesMaterial (crease_id, axis); resolution walks the crease's pieces — returns the original line if they still lie on it (the byte-stable common case), recomputes if a rigid move orfliprelocated them, and errors if a later fold bent them apart:Ships the escape hatch in the same PR:
#(.a .b .c)names the unique flat flap (a face) carrying all listed points, and--( --d #(.a .b .c) )restricts a crease to that flap's straight piece. Flap resolution is in paper space — a point set unique to one flap disambiguates even when individual corners are shared between adjacent flaps.subdivide/fold_with_recordsnow mint onecrease_idper operation (was per cut face) so a crease's pieces share an identity. The id stays internal and unserialized, so FOLD output is unchanged: all 20 pre-existing example goldens are byte-identical — every existing program references its creases while flat, resolving to the original line. (The design's premise thatmultiple-folds.belwould bend a crease turned out geometrically false; it is unchanged.) Three new examples exercise the bent→error path, the#(...)escape hatch, and flip-tracking.Out of scope, filed as follow-ups: materiality in the emitted
beloch:named_lines(#45), material creases throughdefline-parameters (#46), and taco-taco/taco-tortilla validity checks (#47). Design and plan live indocs/superpowers/{specs,plans}/2026-07-03-*.The two new escape-hatch examples, rendered — crease pattern and folded form:
crease-flap-restrict.bel—--b(through.a .c) is bent by the--vhalf-fold, so a bare reference errors.--( --b #(.c .d) )picks the top-flap piece and folds cleanly.crease-flip-reuse.bel—--qis precreased, the sheet flipped, then reused. Material tracking resolves--qto its flipped position, soperp --q through .blands correctly rather than snapping back to the pre-flip line.