feat(fold): emit per-face isometries, consume them in fold2svg #55

Merged
toph merged 4 commits from fold-isometry-emission into vscode-preview 2026-07-04 14:50:06 +00:00
Owner

Stacked on #53 — base is vscode-preview.

Emits each folded face's paper→table isometry as beloch:faces_matrix and declares the named-line frame (beloch:named_lines_frame: "creasePattern"). Ports fold2svg to consume the isometry and deletes the float-vertex-pair reconstruction (applyIso plus its shoelace reflection detection) — the renderer no longer re-derives, in JS floats, a transform the exact core already holds in face.iso. Topology (vertex coincidence, layer order) is already decided exactly upstream and carried as integers, so float coefficients are sufficient here.

Also fixes a pre-existing clip bug the port surfaced: the folded overlay clipped named lines against the final crease pattern's vertices even for intermediate --step frames, whose face indices belong to a different dedup pass. It now pulls each line into the face's own table frame (lineToFace) and clips against that frame's polygon, dropping the crease-pattern index dependence.

Exact coordinates stay out of scope — rendering lands on float regardless and nothing verifies exactness yet; the reasoning is in #31. The golden-regen tool lives at tools/regen.ml.

Follow-up: #54 (integration fixture for the folded named-line overlay).

For #31.


cube-root.bel folded top view — creases placed on each folded face via the emitted isometry:

cube-root folded

Stacked on #53 — base is `vscode-preview`. Emits each folded face's paper→table isometry as `beloch:faces_matrix` and declares the named-line frame (`beloch:named_lines_frame: "creasePattern"`). Ports `fold2svg` to consume the isometry and deletes the float-vertex-pair reconstruction (`applyIso` plus its shoelace reflection detection) — the renderer no longer re-derives, in JS floats, a transform the exact core already holds in `face.iso`. Topology (vertex coincidence, layer order) is already decided exactly upstream and carried as integers, so float coefficients are sufficient here. Also fixes a pre-existing clip bug the port surfaced: the folded overlay clipped named lines against the final crease pattern's vertices even for intermediate `--step` frames, whose face indices belong to a different dedup pass. It now pulls each line into the face's own table frame (`lineToFace`) and clips against that frame's polygon, dropping the crease-pattern index dependence. Exact coordinates stay out of scope — rendering lands on float regardless and nothing verifies exactness yet; the reasoning is in #31. The golden-regen tool lives at `tools/regen.ml`. Follow-up: #54 (integration fixture for the folded named-line overlay). For #31. --- `cube-root.bel` folded top view — creases placed on each folded face via the emitted isometry: ![cube-root folded](https://git.toph.so/attachments/a5d7a64e-147f-4ccc-8257-84f6940f600a)
For #31.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FYbXyypfVm4RdPLGBdWYw
For #31.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FYbXyypfVm4RdPLGBdWYw
The folded-view overlay clipped against the final crease pattern's vertices even
for intermediate --step frames, whose face indices belong to a different dedup
pass. Pull the line into each face's table frame via its isometry and clip
against that frame's own polygon, dropping the crease-pattern index dependence.
Also relocate the golden-regen tool from gitignored scratch/ to tools/.

For #31.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FYbXyypfVm4RdPLGBdWYw
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FYbXyypfVm4RdPLGBdWYw
toph merged commit 76fabdd58c into vscode-preview 2026-07-04 14:50:06 +00:00
toph deleted branch fold-isometry-emission 2026-07-04 14:50:07 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
toph/beloch!55
No description provided.