Repository navigation
One fan operation under flatten, reverse and squash #52
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestkind:designNeeds Toph's judgment: a decision, an ADR, a spec questionNeeds Toph's judgment: a decision, an ADR, a spec question
Description
flatten, reverse and the squash fold (#17) are one operation: a fan of creases at one point of the folded state, at which each existing crease stays, turns the other way, or opens, and new creases are added. Fisher's multifold gives each crease exactly these specifiers (valley, mountain, reverse, unfold) [fisher1994, §3.3.2]. The ladder in notes/2026-09-25-primitive-ladder.md places them as rungs 2 to 4.
flattentoday: a fan at a paper point in one flap, new creases only.reverse: the axis crosses the spine at a point where four creases meet: the spine in the body (stays), the spine in the tip (turns), the axis in each of the two halves (new).- Squash: a fan at one point that opens a crease (Fisher's
unfold g-e[fisher1994, p. 24]).
Decided
- One operation in the kernel;
flatten,reverseandsquashare syntax over it. What is the same operation mathematically is the same operation in the implementation. reversemoves onto it. The fan operation counts as done whenreverse, as syntax over it, passes every existing reverse case,examples/bases/bird-base.belandexamples/crane.belwith unchanged output.- A write reaches every layer under its axis (ADR 0036):
markwithoutonscores every layer,foldmoves every layer on the side that folds over,movingnames a side. - A fan moves its tip (ADR 0037): the pieces under the fan joined to the flap carrying its point.
squashtakes a bare alignment of its spine (ADR 0038):squash (--h onto --ac)orsquash (--h onto .p).onmarks the named flap alone (ADR 0039).- A fan sits at a table point (ADR 0040), with a paper point in every layer under it;
flattentakes(on #[…])to name its anchor. A fan vertex may lie off the paper (ADR 0041). - A reverse fold turns the hinges across its opening (ADR 0043).
- A flatten selects no state by convention:
towardgoes, an ambiguous flatten fails with one suggestion per remaining state (comment of 2026-09-29, carried out by Fail an ambiguous flatten with suggestions instead of toward #99). - A fan moves each piece by the creases on its paper path (ADR 0044): closure around every paper point the paper surrounds, sectors are pieces of paper, letters belong to hinges.
stayingnames a sector of the anchor by points (ADR 0048).
Checklist
Design and records:
- Draw what an operation does: figures of fan, spine and placement #51 Figures of fan, spine and placement
- ADR 0036 to 0041, 0043, 0044, 0048
- Decide how a fan whose vertex lies on a folded edge closes around it #133 How a fan whose vertex lies on a folded edge closes around it: each piece moves by the creases on its paper path (ADR 0044)
Build:
- Reach every layer under the axis by default, and read moving as a side #111
foldandmarkreach every layer;movingnames a side - Move the tip of a flatten #113
flattenat a table point moves the tip of its anchor, withon - Fold reverse as a fan #119
reversedefined as a fan in the spec (the kernel still folds it by opening and blocks) - Name the stayer of a flatten by points on its anchor #158
stayingby points on the anchor (Name the stayer of a flatten by points on its anchor #160) - Score a flatten's rays on every layer under the fan #152 A flatten scores its rays on every layer under the fan (PR Score a flatten's rays on every layer under the fan #169)
- Fail an ambiguous flatten with suggestions instead of toward #99 Fail an ambiguous flatten with suggestions instead of
toward - Move the pieces of a fan along paper paths #144 Move the pieces of a fan along paper paths (Move each piece of a fan by the creases on its paper path #168)
- Fold reverse through the flatten path #137
reversefolded through the flatten path, output unchanged - Fold a squash from a bare alignment of its spine #115
squash (--h onto …)from a bare alignment
Waiting on a model that needs them:
- The item that widens a fan to separate flaps (ADR 0037); Select the layer order of a fan against flaps outside its anchor #161 asks whether it should come first
- The vertex of a spine with both ends inside the paper (ADR 0038)
Superseded: #67, the original build half of this issue, is covered by the build items above.
Afterwards
Petal (#16) needs fans at several points at once (rung 5) and builds on this.
Generated by Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestkind:designNeeds Toph's judgment: a decision, an ADR, a spec questionNeeds Toph's judgment: a decision, an ADR, a spec question
Activity
tophcodes commentedon Sep 28, 2026
Decided on paper, with the squash of one flap of the preliminary base (Fisher's
multifold g-a, g-k, mountain g-j, unfold g-e[fisher1994, p. 24]):Which layers move: the tip rule for squash. The fan sits at the closed point, and four layers lie under it on the side of the flap. Only the flap joined to the anchor moves (layers 1 and 2, hinged at
.e); the flap behind it stays.Under the other rule, every layer under the fan, the flap behind opens at
.ias well and the result is two squashes, front and back. The kernel accepts that state (a 10-ray fan at the centre, 24 layer orders), so the rule would not fail; it would silently fold something else.flattenfollows that rule today.Still open here: whether
flattenmoves onto the tip rule too. On a single flat sheet every face is joined to the anchor, so the two rules give the same result there.tophcodes commentedon Sep 29, 2026
Decided on the preliminary base as one
flatten(six rays at the centre,examples/bases/preliminary.bel):A flatten selects no state by convention. The candidates of a fan share their geometry; they differ only in layer order, and the letters follow from it. When more than one candidate remains, the statement fails as ambiguous, and the error offers one item per remaining candidate that keeps exactly that one. Letters come first, since a folder reads them off a crease pattern and a diagram; an
overitem comes where letters leave several.towardgoes fromflatten, with the three rules behind it (moved material toward the point, fewest mountains, material toward the point on top). This settlesopen-flatten-selectioninspec/MODEL.md.On the six rays, 18 letter assignments give a flat state and three have two mountains. Checked with the kernel, each item below keeps exactly one of the 18:
.bside, top first(--bd & .b mountain).bfolded to the front through both layers,.dto the back(--v & --cd mountain).bto the back,.dto the front(--h & --da mountain)Layer items separate them as well:
a over bwithb over ckeeps the preliminary base,b over athe second state,a over bwithc over bthe third. Twooveritems say "between"; no adjacency relation is needed. Checked with helper points in the sectors (.q,.r,.s), which are what makesoverhard to write today.Not decided, but likely: naming a sector in an
overitem with the solution-space selector#{…}of #12.#[.b]reads the flat sheet before the solve, and#{.b}would read the.btaco of the candidate.tophcodes commentedon Sep 29, 2026
Handoff: this issue continues in a new session.
Decided so far (comments above): the tip rule for squash, and no selection by convention for flatten (#99).
Still open:
flattenincluded. On a flat sheet both rules agree. On folded paper the kernel today refuses a flatten unless every layer under the fan already carries the rays ("collapse through unaligned layers" inflatten_solve.ml), whiledef-flatteninspec/MODEL.mdscores every layer under the fan. The two disagree.squash: which flap, and where the opened spine lands. Three candidates, none checked:squash (map --h onto --ac) (moving .e)(the pre-crease as axis, likereverse),squash --h onto --ac (moving .e)(name the spine and its target), and the explicit fan with anopensletter.The working method that got these decisions: one real case folded on paper step by step, one image per step (hand-placed SVG, phone layout for anything read on the phone), and every state checked with the kernel before it is drawn.
The squash of the preliminary base is one 8-ray fan at the paper centre, and the kernel evaluates it on the flat sheet:
It fails as ambiguous with 14 layer orders, which is what #99 addresses. Squashing the front and the back flap together, the result of moving every layer under the fan, adds
mark (align (--v onto --ac) (heading --v)) as --uandmark (align (--v onto --bd) (heading --v)) as --wand the rays(--ac & .c valley) (--u & --cd mountain) (--w & --cd valley)in place of(--v & --cd valley), with the stayer moved to.z = free on --ab from .a at 1/4; the kernel finds 24 flat layer orders.tophcodes commentedon Sep 29, 2026
Decided:
markwithoutonscores through every layer under its line, as a hand pressing a crease into the stack does. On folded paper it scores one flap today.Still open: what
onmeans. On a book fold, the corner bisector marked(on #[.a])runs from the corner to the spine. The triangle of the upper layer beside it hangs on the lower layer at the spine, so the upper layer cannot be creased along that line without the lower one. A mark on one flap is only foldable where the flap can move on its own.Correction to the handoff above:
mark (--x) (on #[.d]) into --xdoes not give the kernel the line on both layers. A flatten through two layers cannot be checked until #105 lands.tophcodes commentedon Sep 29, 2026
Decided:
foldwithoutmovingorup tofolds every layer under its axis, asmarkwithoutonscores every layer. On the book fold of #105, folding the corner along the bisector through both layers takes two helper points today,(moving .h) (up to .g)on the left edge, since the default moves only the top flap and what lies on it.tophcodes commentedon Sep 29, 2026
Handoff: this issue continues in a new session.
Decided since the last handoff:
markwithoutonscores every layer its line crosses,foldmoves every layer on the side that folds over, andmovingnames that side only.up tonarrows a fold. This is ADR 0036, accepted; Reach every layer under the axis by default, and read moving as a side #111 carries it out.intoadds included (Cut a mark along its extent when a flatten folds it #105), and a ray may end on a folded edge such as a book's spine (Let a flatten ray end on a folded edge of its flap #107). Until Reach every layer under the axis by default, and read moving as a side #111 lands, a crease on both layers is written asmark … (on #[.a]) as --xfollowed bymark (--x) (on #[.d]) into --x.The separating case for the tip rule is the four-ray fan near the corner of a book fold, in
packages/core/tests/cases/collapse/flatten-through-two-layers.bel. The kernel gives the result of the rule of all layers: both corners fold as one stack, and along a cut below the vertex the layers read d, a, a, d, d, a, a, d from the top. That matches the drawing made by hand. The result of the tip rule, with only the upper layer's corner moving and the lower layer's corner left in view, exists as a hand drawing only.Still open:
reversefor every fan, the tip with an anchor and every layer without one.flattenhas no anchor item yet;stayingnames a stayer sector.onmeans. A mark on one flap can be folded only where that flap can move on its own; the corner bisector that reaches the spine cannot.squash, and the fan at a table point over several paper points, as in the handoff above.The working method that got these decisions: one real case folded on paper step by step, an image per step from
beloch render --view side(folded state with the cut, crease pattern, section), a hand drawing where the kernel cannot yet evaluate, and every state compared with the paper.tophcodes commentedon Sep 29, 2026
Decided:
flatten,squash,reverseand laterpetalmove the pieces under the fan that are joined to the flap carrying its point; a single crease moves every layer under it, as ADR 0036 states. On the book of Cut a mark along its extent when a flatten folds it #105 the fan along--xand--yreaches the spine, so its tip holds both layers; the four-ray fan offlatten-through-two-layers.beldoes not, and folds the upper corner alone. Move the tip of a flatten #113 carries it out forflatten. Smith draws the same line: layers treated as one take only valley and mountain folds [smith1975oil, p. 17].squash(ADR 0038, Propose ADR 0038: squash takes a bare alignment of its spine #114).squash (--h onto --ac)orsquash (--h onto .p): a bare alignment of the spine and its target, completed by the write with the fold line through the vertex. Before the squash, the two new creases of the preliminary base lie on one table line, the bisector of spine and target, and that line is the axis.reversekeeps complete constructions, since a reverse fold has no vertex.Still open:
onmeans, and the fan at a table point over several paper points, as in the handoffs above.tophcodes commentedon Sep 29, 2026
Handoff: the design of this issue is decided; what is left is building it.
Decided since the last comment:
onmarks the named flap alone (ADR 0039), also where the flap is hinged to other layers along the line: the folder opens the model partway. Show the opening of the model for a mark on one layer #116 takes up how a diagram shows that step.flattentakes(on #[…])to name the flap it folds, anywhere in the stack; without it the anchor is the topmost flap under the point.The records: ADR 0036 (a write reaches every layer under its axis), 0037 (a fan moves its tip), 0038 (the surface of
squash), 0039, 0040.Build order:
foldandmarkreach every layer;movingnames a side (ADR 0036). Independent of the rest.flattenat a table point moves the tip of its anchor, withon(ADR 0037, 0040).reversefolded as a fan through the path of Move the tip of a flatten #113; its cases, the bird base and the crane unchanged.squash (--h onto …)(ADR 0038).Waiting on a model that needs them: the item that widens a fan to separate flaps (ADR 0037), and the vertex of a spine with both ends inside the paper (ADR 0038).
tophcodes commentedon Oct 20, 2026
The four items are built: #111, #113, #119 and, with #270, #115. The two points left open above stay where their records keep them: the item that widens a fan to separate flaps (ADR 0037) is one of the questions of #161, and the vertex of a spine with both ends inside the paper (ADR 0038) waits for a model that needs it; the kernel refuses it with a message until then. #269 records that the squash on the preliminary base relies on the fewest-mountains stage, which #99 wants to remove.