fix(fold): folding along a precrease emits U/0 instead of M/V #27

Closed
opened 2026-07-02 14:03:38 +00:00 by toph · 0 comments
Owner

The canonical origami sequence — mark a crease, then fold on it — produces an inconsistent FOLD file:

paper square
map .b onto .a          ; precrease
@map .b onto .a moving .b

emits edges_assignment: ["B","U","B",…] and edges_foldAngle: [0,0,…] while faceOrders and the folded vertices show the paper folded. Consumers (e.g. Origami Simulator) get contradictory data. The control without the precrease correctly emits V/180.

Cause: fold_with_records only creates a crease record when a face is actually cut (fold_state.ml:200-209). After the precrease every face abuts the axis, nothing is cut, and fold_emit falls back to the stale U record from subdivide.

Fix (tactical, ahead of the topology retrofit in #26): handle the abut case — find existing records collinear with the fold axis and upgrade their assignment U→M/V with the proper fold angle.

The canonical origami sequence — mark a crease, then fold on it — produces an inconsistent FOLD file: ``` paper square map .b onto .a ; precrease @map .b onto .a moving .b ``` emits `edges_assignment: ["B","U","B",…]` and `edges_foldAngle: [0,0,…]` while `faceOrders` and the folded vertices show the paper folded. Consumers (e.g. Origami Simulator) get contradictory data. The control without the precrease correctly emits `V`/180. Cause: `fold_with_records` only creates a crease record when a face is actually *cut* (`fold_state.ml:200-209`). After the precrease every face abuts the axis, nothing is cut, and `fold_emit` falls back to the stale `U` record from `subdivide`. Fix (tactical, ahead of the topology retrofit in #26): handle the abut case — find existing records collinear with the fold axis and upgrade their assignment U→M/V with the proper fold angle.
toph closed this issue 2026-07-02 22:07:08 +00:00
Sign in to join this conversation.
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#27
No description provided.