# Fold — design ## Intent Origami instructions are written in a formal diagram language. The Yoshizawa–Randlett system fixes what a dashed line means (valley), what a dash-dot line means (mountain), what each arrowhead means (fold, fold and unfold, turn over, rotate, repeat), and it has been stable for sixty years. It is a real notation, and it is designed for paper. Every origami app treats the diagram as a picture: a sequence of photographs or scanned drawings you page through, with the notation reduced to decoration. The paper never moves, and the diagram and the model can disagree because nothing connects them. This app has one source of truth. A model is a folded geometry with labelled creases; from that data the app **generates the Yoshizawa–Randlett diagram** and **animates the fold**, and the two cannot contradict each other because they are two renderings of the same thing. You drag perpendicular to a crease and the paper rotates about it, through the angle, at your pace, stopping where you stop. ## Goals - Dragging a fold moves the paper continuously from 0° to its final fold angle and back, tracking the finger, with correct layer ordering at every intermediate angle. - The diagram for a step is generated from the step's geometry: crease line styles from which way each fold turns as seen, arrows from which facets move, about which axis, and by which technique. - The notation is correct Yoshizawa–Randlett, not an approximation of it. - Models are data files, not code. Adding a model is adding a file. - Entirely offline. No account, no network. - Two-finger orbit and pinch zoom on the model at any point in the sequence, so you can look underneath a flap. - Ships on the App Store, with VoiceOver and Dynamic Type support at the level of `krz/daybyday` — every screen passes Xcode's accessibility audit at the default and the largest text size. ## Non-goals - Paper simulation. No stiffness, no self-collision response, no crumpling. Paper is rigid flat facets hinged at creases, except during a step flagged `nonRigid` (see *Interpolation*), whose bending is designed, not simulated. - Deriving layer order from geometry. Layer order is authored and checked, never computed. Computing it in general is a hard problem and getting it wrong looks worse than any amount of authoring effort. - Deriving a step's axes and moving sets from a frame diff. See *Steps are authored* below. - Wet folding, curved creases, or anything that is not a straight crease between flat facets. - Modern designers' models. See *Rights*. - Teaching origami through text. The diagram and the motion are the instruction. The accessibility labels are the exception and are required. ## Anti-goals - Facets that interpenetrate on screen. A flap passing through the layer below it destroys the sense that this is paper, and a viewer notices immediately even when they could not say why. - A fold that snaps. If the drag is quantised, or the last 10° completes itself, the premise is gone. - Diagram notation that is nearly right. The audience for this app is people who read diagrams, and a wrong arrowhead is as visible to them as a misspelling. - Inventing a file format when FOLD exists. - Shipping an engine with nothing to fold. Models cannot be authored in existing tools; see *Authoring*. ## Rights **Traditional models only.** Origami models designed in the modern era are the intellectual property of their designers, and diagramming someone else's model without permission is both a legal problem and, in the origami community, a serious breach. Every model here is traditional, long predating any individual claim. Each model's `file_author` is `"Traditional"` and the validator enforces it. **v1 ships four: the cup, the crane, the sampan and the box.** The box is the masu. The sampan was chosen over the paper boat folded from a hat: it starts from a square, its middle steps are plain folds, and its one hard step — turning the model inside out — comes last, the same kind of 3D opening as the masu's. The paper boat needs a rectangle and two collapses mid-sequence. Published sampan sequences differ in their middle steps; the one authored is recorded in `docs/authoring/sampan.md`. The frog base, fish base, flapping bird and preliminary base are the same kind of thing and come afterwards, cheaply, because the compiler will exist. Four is thin for a first release but defensible; one is not, and eight is authoring work better done once you know how the folding feels in the hand. A later release that includes designed models needs the designer's permission, per model, in writing. That is a licensing project, not an engineering one, and it is out of scope here. ## Constraints - iOS 26, Swift 6, iPhone and iPad (`TARGETED_DEVICE_FAMILY = "1,2"`). iPad is the better device for this and the layout should assume it will be used there. - XcodeGen `project.yml`, matching the layout of `krz/moonrise`. - Bundle prefix `sh.krz`, `DEVELOPMENT_TEAM = ZCNAX3VL9D`. - Geometry, format handling and notation generation live in a SwiftPM package with no UIKit or SwiftUI dependency. The renderer may import Metal and MetalKit. - 0BSD, origin on gitbay.org. - No third-party runtime dependencies in the app. Authoring tooling may depend on whatever is convenient; it does not ship. ## The model format Models are **FOLD** files — the JSON format from Demaine, Ku and Lang (2016), spec v1.2 at `github.com/edemaine/fold`, `doc/spec.md`, MIT-licensed. Keys used from the standard: | Key | Use | |---|---| | `file_spec` | `1.2` | | `file_creator` | `"foldc"` | | `file_title`, `file_author` | the model's name; `"Traditional"` | | `file_classes` | `["singleModel", "diagrams"]` | | `vertices_coords` | 3D vertex positions in the folded state of that frame; 2-element entries mean z = 0 | | `edges_vertices` | `[u, v]` endpoints, defining edge orientation | | `edges_assignment` | `B` boundary, `M` mountain, `V` valley, `F` flat, `U` unassigned; `C` and `J` are rejected | | `edges_foldAngle` | degrees in [−180, 180]; positive for valley, negative for mountain, 0 for `F`, `U` and `B`. The sign must match `edges_assignment`, as the spec requires, and the validator checks it | | `faces_vertices` | vertex IDs counterclockwise; the order defines the face's normal | | `faceOrders` | `[f, g, s]` triples; `s = +1` means `f` is above `g`, on the side `g`'s normal points toward in the folded state; `s = -1` below; `s = 0` unknown | | `file_frames` | frames 1…N (see *Frames and step numbering*) | | `frame_parent`, `frame_inherit` | `0` and `true` on every frame in `file_frames` | Because `s` is relative to `g`'s normal, two triples can only be compared after normalising each by its faces' normals in that frame: `[f, g, +1]` with `[g, f, +1]` is consistent when the faces face opposite ways. Cycle detection and every other order check normalise first. Two places are stricter than the spec. It allows `faceOrders` cycles (a square twist has one); the validator rejects them, and no traditional model in scope needs one. It recommends `J` edges to split faces that overlap in several regions or are nonconvex; `J` is rejected and faces must be convex. A crease that ends inside the sheet (a pinch) leaves a nonconvex face around its end, which is split by a **subdivision edge**: assigned `F`, flat in every frame, creased by no step (no step moves its two faces differently), with no `edges_krz:firstCreasedAtStep`, and never drawn. ### Frames and step numbering FOLD's top-level frame properties describe the **key frame**, frame 0, and `file_frames[i]` is frame `i + 1`. - Frame 0 is the unfolded sheet. - **Step n**, counting from 1, takes frame n − 1 to frame n, and its record is frame n's `krz:step`. A model with N steps has N + 1 frames. - Every index this project calls a step — in `krz:step`, `edges_krz:firstCreasedAtStep`, the validator's defects, `FoldStep.index` and the UI's "Step n" — is this n. The only zero-based indices are array subscripts. - Every frame in `file_frames` carries `frame_parent: 0` and `frame_inherit: true`, so tools that implement FOLD's frame inheritance see the shared topology. Each frame overrides `vertices_coords`, `edges_assignment`, `edges_foldAngle` and `faceOrders`, and never `edges_vertices` or `faces_vertices`. ### One topology, every frame **Frame 0 is the sheet already subdivided by every crease the whole sequence will ever use**, with the not-yet-folded ones carrying `edges_foldAngle` 0 and assignment `F`. Every frame therefore shares one `vertices_coords` length, one `edges_vertices` and one `faces_vertices`; only coordinates, fold angles, assignments and `faceOrders` differ between frames. This is what makes interpolation possible: vertex *i* in frame *k* and vertex *i* in frame *k+1* are the same point of paper, so rotating the moving facets carries one frame to the next. Without it there is no vertex correspondence between frames and nothing to interpolate. The validator enforces it. A crease that runs through several layers of a folded state is several edges, one per layer, coincident in space. A step that folds through those layers changes all of them; its axis names one. The cost of a shared topology is that a crease the reader has not met yet exists in the data from the start, so the diagram generator needs to know when each crease first becomes visible. FOLD has no key for that, so the models carry one. ### Extension keys FOLD reserves keys without a colon. These are this app's, under `krz:`: | Key | Where | Use | |---|---|---| | `edges_krz:firstCreasedAtStep` | key frame, inherited | per edge, the step n at which the crease is first made; `null` for a boundary | | `krz:step` | frames 1…N | the step that produced this frame (below) | | `krz:faceOrders_midFold` | frames 1…N | layer order to use while this step is in motion; required when the step's moving sets overlap in projection, and on every `foldAndUnfold`, where it holds the order at the peak | The edge key follows the spec's own example, `edges_tm:structuralType`, so FOLD tools that select edge properties by the `edges_` prefix treat it as edge data and renumber it with the edges. Extension keys mean other FOLD tools ignore part of the data. FOLD is still the right choice for the geometry: it is a published spec with a careful layer-order model, and reinventing that would be worse than extending it. ### Steps are authored, not derived The app does not derive a step's crease axes and moving facets by diffing consecutive frames. That would be an algorithm with real ambiguities — which side of the crease moved, whether a whole-model reorientation is a fold, how to partition several simultaneous axes — inferring something the author already knows. Each frame's `krz:step` carries it explicitly: ``` { "kind": "fold" | "foldAndUnfold" | "turnOver" | "rotate", "technique": "plain" | "insideReverse" | "outsideReverse" | "squash" | "petal" | "sink", "instruction": "Valley fold the right corner to the left edge.", "axes": [ { "edge": 17, "movingFaces": [3, 4, 5], "startAngle": 0, "endAngle": 180, "peakAngle": null, "parent": null, "window": [0, 1], "angles": null } ], "rotateDegrees": 90, "turnOverAxis": "vertical" | "horizontal", "repeatOf": 4, "nonRigid": false, "pop": null, "viewpoint": { "eye": [0, 0, 1], "up": [0, 1, 0] } } ``` - `axes`: the angles are the axis edge's `edges_foldAngle` at the start, at the end, and — for `foldAndUnfold` only — at the turning point. `parent` is the index of the axis whose motion carries this one, `window` its span of *t*, and `angles` a solved curve (see *Interpolation*); `foldc` writes all three. - `nonRigid` and `pop`: the step has no rigid motion and opens, pops and closes (see *Interpolation*). Reverse folds and sinks. `pop` holds the flap's spine, the angle it opens to, the two phase boundaries on *t*, the opening axes, the popped pose and the closing axes; `foldc` writes it. - `technique`: drives the notation and the instruction's wording; geometry ignores it. `plain` for anything that is not a named technique. - `instruction`: the step in words, written by the author in the fold script. It is the paper view's accessibility label and the diagram's caption. It is authored because a generator cannot know that a vertex is "the right corner" or that a line is "the centre". - `rotateDegrees`: required for `rotate`; the rotation is about `eye`, so positive is counterclockwise as seen from the viewpoint. - `turnOverAxis`: required for `turnOver`; the screen axis, as seen from the viewpoint, the model turns about. - `repeatOf`: on a step expanded from a repeat, the step it repeats. - `viewpoint`: `eye` is the unit direction from the model toward the viewer (the diagram is orthographic, so there is no eye position); `up` is screen-up. Most steps use `[0, 0, 1]` and `[0, 1, 0]`. All of a step's axes share one parameter, so a petal fold or a reverse fold is one step with several axes and several moving sets, driven together. The traditional models need this. How those axes move together is set out in *Interpolation*. ### Step kinds | Kind | Geometry | How it advances | |---|---|---| | `fold` | one or more axes, start → end angle | a drag, as below | | `foldAndUnfold` | axes go start → peak → start | a drag out and back | | `turnOver` | no crease; the model turns 180° about `turnOverAxis` | a one-finger horizontal drag across the model | | `rotate` | no crease; the model turns in plane by `rotateDegrees` | a one-finger horizontal drag across the model | `turnOver` and `rotate` are steps in `file_frames` like any other. Their end frame is the start frame rotated about the centre of its bounding box — the coordinates change and the camera does not. The diagram's viewpoint is fixed and the reader's mental model is of turning the paper over in their hands, so the **model** reorients, not the camera. Because the coordinates carry the orientation, nothing else has to track it. Repeats — "repeat steps 4–6 behind" — are **expanded into explicit steps** in the data, each with `repeatOf` naming the step it repeats. Each expanded step's diagram shows its own fold (a repeat done behind is drawn as the fold behind that it is) plus the repeat mark. A first-class repeat would save file size and cost correctness. ## How it works ### Interpolation Decided by measurement: `docs/decisions/0001-interpolation-model.md`. Between frame n − 1 and frame n, step n's axes form a tree. Each axis rotates its moving faces rigidly about its crease line, on one shared parameter *t* in 0...1, and carries its children with it: - The crease line is the axis edge's endpoints in frame n − 1. - The axis is directed the way the moving face adjacent to the edge traverses it in `faces_vertices` order. A positive rotation about that direction (right-hand rule) turns the moving face toward the side its normal points to, which is a valley — so the rotation is `angle(t) − startAngle`, with the sign FOLD already gives fold angles. - A face's transform is its axis's rotation followed by the parent axis's transform, up the tree. - Each axis runs on its **window** `[t0, t1]` of *t*, waiting before it and holding after it. Two flaps of equal reach folding toward each other on one window collide at 120°. On separate windows they do not, and `foldc`'s scripts stagger them. - `angle` is linear on the window for `fold`, and a tent through `peakAngle` for `foldAndUnfold`, unless the axis has a **curve**. - Where the step's faces form loops around interior vertices, the angles are coupled nonlinearly — at a flat-foldable degree-4 vertex with consecutive sectors α, β, tan(ρ₁/2) = k·tan(ρ₂/2), k = cos((α+β)/2) / cos((α−β)/2). Linear angles tear such a vertex by more than half the sheet partway through. `foldc` holds one driving crease linear and solves the rest so every loop closes. It writes each solved angle as a curve of 257 samples; cubic Hermite interpolation between them keeps the tear under 1e-6. - `turnOver` and `rotate` rotate every vertex about the start frame's bounding-box centre by *t* times the step's angle. **Non-rigid steps** (`docs/decisions/0002-non-rigid-steps.md`). An inside reverse fold has no rigid motion with the flap closed; the only rigid path unfolds the flap flat and refolds it, which on the crane would undo earlier steps on screen. Reverse folds and sinks are flagged `nonRigid` and move in three phases on *t*: 1. **Open**, rigid: the flap opens on its spine to 20° from flat by default (authored per step). Where the flap's near layers run on under another flap, the whole near side turns about the spine's line, with bend lines on that line (decision 0003). 2. **Pop**: the tip passes from outside the flap to inside it, by as-rigid-as-possible interpolation on a render mesh: frame 0's creases plus lines every 1/32 of its longer side in each direction. The render mesh is the renderer's; the FOLD topology is unchanged. 3. **Close**, rigid: the flap closes on the reverse-fold branch, with solved curves, and the tip lands between its layers. The isometry gate does not apply to the pop. The **bound** does: no render-mesh edge changes length by more than 10%. On a two-layer flap the pop measured 7.9% opened to 30° and 29% opened to 60°. That is one flap at one resolution; the crane's flaps are narrower and several layers deep, so each flagged step's strain is measured when it is authored. The interpenetration check applies to all three phases. A step is non-rigid because its script says so — a reverse fold or sink names the spine its flap opens on — not because a solver failed: with the flap closed the solver finds a rigid motion to the right coordinates with the wrong layering. The petal fold is rigid (it has solved curves) and is not flagged. The sampan's inversion and the masu's wall-raising are classified when they are authored, by `foldc`'s closure test together with the interpenetration check, the layer rules and a look in the app. If either has no rigid motion it needs a decision, since open, pop, close needs a spine to open on. ### Layer ordering during a fold `faceOrders` is authored for every frame. While step n is in motion, the **active ordering** is `krz:faceOrders_midFold` if frame n has one, and otherwise frame n's `faceOrders`, applied from the moment the fold begins: a facet being folded over is above its destination for the whole motion, which is what the end frame's ordering says. A pair with no triple there takes frame n − 1's, which covers a flap leaving a stack. Each source is checked for cycles with the normals of the state it describes — the peak for a `foldAndUnfold`'s mid-fold order. A `foldAndUnfold` ends where it started, so neither end frame orders the moving faces against the faces they lie on at the peak; its `krz:faceOrders_midFold` is that order, computed by `foldc`. The orders themselves are checked in every frame by three consistency rules, on every stack of coincident faces: two faces joined at a crease folded to ±180 are ordered as its assignment requires; where two folded creases coincide, their face pairs nest rather than interleave; and a face whose interior crosses a folded crease's line does not lie between that crease's two faces. A guessed or overridden order that breaks one is impossible paper, even when no face collides with another — the interpenetration checker cannot see that, because a wrongly ordered flap moves through exactly the same coordinates. Two rules make this safe rather than merely convenient: 1. The validator requires frame n − 1's and frame n's orderings to agree on every pair **not involving a moving facet**. A step where this simplification would be visible in the still part of the model fails authoring. 2. When a step's moving sets overlap in projection, such a step **must** carry `krz:faceOrders_midFold`, and the validator rejects it if it does not. Decision 0001 found that the problem this was meant to prevent, two flaps passing through each other, is a collision. Ordering cannot fix a collision; staggered windows on *t* do. It found no case left for the rule, and removing it is an open decision. When a traditional model has a step that cannot satisfy these, the fix is to split the step into sub-steps until it can. Dropping the model is the last resort and needs a decision, not a shrug. ### Rendering Metal, with a small renderer written for this: the geometry is a render mesh of a few thousand triangles (see *Non-rigid steps*), and both SceneKit (deprecated) and RealityKit (whose dynamic-mesh support is more than this needs) would contribute more risk than they remove. Depth handling is **hybrid**. `faceOrders` is defined only for faces that overlap geometrically; it says nothing about facets separated in 3D, which is most of a folded model. Depth testing off everywhere is right for a coplanar stack and wrong for the rest. So: - Two faces are linked when they overlap in projection, their normals are within 2° of each other's line, and each one's vertices lie within sin 2° × the model's bounding-box diagonal of the other's plane. A **cluster** is a connected group of linked faces. The tolerance is wide on purpose: a facet just leaving or just arriving on a stack is nearly coplanar with it, and the depth buffer alone would z-fight there. - The depth buffer resolves clusters separated in space. - Within a cluster, faces are drawn back-to-front by the active ordering, with depth test on (less-or-equal) and depth writes off; then the cluster's faces are drawn again depth-only, colour writes off, so that clusters drawn later are hidden behind it. Without the second pass a cluster writes no depth and anything drawn after it draws over it. - The `s` sign is evaluated **against the current view direction**, using `g`'s current normal, because "above" in FOLD means "on the side `g`'s normal points toward", that reverses when you orbit underneath the model, and a moving stack's normals turn with it. Facets are drawn two-sided — paper has a coloured side and a white side, and which side you are seeing is information. ### The diagram The diagram for step n draws **frame n − 1** — the paper before the step, as a printed diagram does — orthographically from step n's `viewpoint`, with step n's creases and arrows on it. The diagram does **not** rotate when you orbit the model; the model view orbits and the diagram stays put, because a diagram is a fixed drawing and orbiting it would make it something else. Edges: - `B` edges, and creases folded in frame n − 1 (fold angle not 0): solid, as the outline of the folded shape. - creases made in an earlier step and flat again in frame n − 1 (fold angle 0, `edges_krz:firstCreasedAtStep` < n): solid, lighter. - step n's crease, including every edge coincident with an axis: dashed for a valley, dash-dot for a mountain, **as seen from the viewpoint**. The axis turns the moving face toward its own normal when its angle increases, so the fold is a valley as seen when the sign of the turn (end − start, or peak − start for `foldAndUnfold`) times the sign of the moving face's normal · `eye` is positive. FOLD's assignment cannot be used here: it is relative to each face's own normal, so on a flipped layer or after a turn-over it names the opposite fold, and coincident edges on different layers disagree. - creases whose `edges_krz:firstCreasedAtStep` is later than n, and subdivision edges: not drawn. Arrows and symbols: - `plain` folds: one fold arrow per axis, curving from the moving facet across the crease to its destination — the valley-fold arrow for a valley as seen, the mountain-fold ("fold behind") arrow for a mountain. - `foldAndUnfold`: the fold-and-unfold arrow. - the named techniques (`insideReverse`, `outsideReverse`, `squash`, `petal`, `sink`): the arrows the reference prescribes for that technique (the push arrow for a reverse fold or sink, for example), not one fold arrow per axis. The glyph for each is chosen from the reference below and the choice recorded beside the snapshots. - the turn-over and rotate symbols for those kinds. - the repeat mark on a step with `repeatOf`. **Edges occluded by layers above them are omitted.** Yoshizawa–Randlett diagrams distinguish what you can see from what you cannot, and drawing a hidden crease as though it were visible is the "nearly right notation" failure. This means clipping each edge against the union of the faces `faceOrders` puts above either of its incident faces, from the diagram's viewpoint — the union, so that an edge under the seam between two adjacent upper faces is hidden — a real algorithm with its own tests, and in scope. ### Gesture - Drag on the paper during a `fold`: drives *t*. The app samples the screen path of the first moving set's centroid from *t* = 0 to 1 and sets *t* to the point on that path nearest the centroid's screen position when grabbed plus the drag's translation, searched outward from the current *t* so the parameter cannot jump. The facet follows the finger wherever you grab it. When the path is under 8 points long — travel nearly along the view direction — the mapping is degenerate and falls back to a vertical drag over a fixed 160-point throw. - `foldAndUnfold`: the same mapping over the outbound half of the path (*t* 0 → 0.5), then over the return half (*t* 0.5 → 1) once the peak is reached. - One-finger horizontal drag across the model: drives *t* for a `turnOver` or `rotate` step, as the drag's distance over the model's on-screen width. A flick does not complete it. - Two-finger drag: orbit. Pinch: zoom. - Only the gesture for the current step's kind is live. - The fold parameter is never advanced by the app. The step completes when *t* reaches 1 and the finger lifts. Releasing earlier leaves the paper where it is. ## Authoring **Authoring is the project's main risk.** Existing FOLD tools — Oriedita, Rabbit Ear, Origami Simulator — author a single crease pattern. None of them produces a multi-frame sequence with per-frame folded coordinates, per-frame layer order, and per-step moving sets. Authoring in existing tools and validating with a CLI would in practice mean hand-writing hundreds of geometrically exact numbers per frame, per model. The engine can be finished and correct and still have nothing to show. So the tooling is part of the project. A command-line tool, `foldc`, macOS only, never shipped in the app, takes - a crease pattern (a FOLD file, exportable from existing tools), and - a fold script: an ordered list of steps, each naming its kind and technique, its instruction text, its creases (by the points they run between), its moving side (by a point inside it), and where they differ from the defaults: fold angles, the turning-point angle of a fold and unfold, the turn-over axis, the rotation, the step it repeats, the viewpoint, **layer-order overrides** and the mid-fold order, and **computes** every frame: the folded coordinates by applying each step's rotations in order, the edges each crease covers in every layer, `edges_krz:firstCreasedAtStep`, and a first guess at `faceOrders` from the fold order, with the script's overrides applied on top. It validates as it goes and reports the first step that fails. Layer-order corrections live **in the script**, never in the generated file. A shipped `.fold` must regenerate exactly from its script and crease pattern, so an edit to the output would be lost on the next compile — and a test compares the two. That is the difference between a model being weeks of arithmetic and a model being an afternoon. It is also ordinary geometry code, not research. ### Why there is no version of this without the compiler **The numbers are not choosable.** For the crane — roughly 35 creases subdividing the square into 40–60 faces, over 15–20 steps — a model file holds on the order of 4,000 numbers, and almost every one is the image of a point on the square under a specific composition of rotations. Each has one correct value to full precision, and the isometry check catches a 1e-6 error. These are computed, never typed. **"Hand-authoring" is the compiler with the reusable parts removed.** To produce those coordinates by hand you would write a script that applies the rotations and prints JSON — which is the compiler, in a file you throw away. What `foldc` adds beyond that is crease resolution by endpoint, moving-set resolution by contained point, multi-layer crease resolution, `edges_krz:firstCreasedAtStep` assignment, the layer-order guess and overrides, and per-frame validation. Roughly a third of the task, and the third that makes every model after the first cheap. **Model-level tests need the same precision.** Assertions about the cup, crane, sampan and box need the same exact coordinates as a shipped model, so they run on compiled models and live with the catalogue (Tasks 8 and 15). The unit tests written before the compiler exists use small synthetic sheets whose folded coordinates are integers or halves and can be typed exactly — a fold in half, a letter fold, a sheet folded in quarters — and the compiler's own tests check that it reproduces those fixtures. ### The cup first, the crane last The first model compiled is **the cup**: six steps — five folds of one axis each and a turn-over — no reverse folds, six layers where the two corner flaps cross and eight in the centre once both top flaps are down. It exercises the entire chain — script, compile, validate, interpolate, diagram, render, fold under a finger — without exercising any of the hard parts at the same time. The version authored folds the top flaps down, the front one in front and the back one after the turn-over; it does not tuck them into the pocket, which inserts a flap between layers. Opening the cup into 3D at the end is not a step. The crane is **last** of the four, as the model that proves multi-axis steps and deep layer ordering work. Debugging a new compiler against the hardest traditional model, with its petal folds and eight-deep wing stacks, would confuse tool bugs with authoring mistakes. ### Where the effort goes once the chain works Per model: export a crease pattern, write a short script, compile, then **correct the guessed layer orders** with overrides in the script. The guess — a folded flap lands on the side of the stack it arrived from — is right most of the time and wrong in exactly the interesting places, because a reverse fold or a tuck puts a flap *between* existing layers and the guess gets that backwards every time. The validator's layer-order rules and the interpenetration checker are what make the correction loop tractable: between them they name the pair, the step and, for a collision, the point in the fold. Reckon on an afternoon per model, and longer for the first. ## What's left to the builder - Line weights and dash patterns for the diagram, within the notation's requirements. - Paper colour, back colour, and the lighting model. Flat shading with a single directional term is probably right; paper is not shiny. - How tightly the model is framed, given the authored viewpoint. - Whether the step list is a visible strip or revealed on demand. - The fold script's surface syntax beyond the JSON form the plan defines. ## Evidence the quality bars are met The headline bars get mechanical checks rather than judgement: - **No interpenetration.** The catalogue test samples each step's fold parameter and tests facet-facet intersection at each sample, across every model. This is the only way the claim survives four models, then eight, and later edits. - **No impossible layering.** The validator checks every frame's orders against the crease, nesting and inside rules (*Layer ordering during a fold*). - **No stretching.** The catalogue test samples every rigid step of every model and checks every edge length against frame 0. Flagged steps are held to the 10% bound on the render mesh instead. - **Correct notation.** The diagram generator is covered by golden-image snapshot tests. The reference is Randlett's own conventions as set out in *The Art of Origami* (1961) and the symbol set as summarised by OrigamiUSA; where the two differ, OrigamiUSA's is used, and the choice is recorded next to the snapshots. ## Open decisions for the author 1. **Name.** "Fold" is not going to be available. The repo and bundle ID use `fold` / `sh.krz.fold` as working names. 2. **Authoring tooling, and how many models.** Settled: build the compiler, cup first, four models for v1. The plan is 18 tasks: two interpolation spikes (Tasks 0 and 0b), the engine, non-rigid steps (7b), the compiler, the app and the cup, then the crane, sampan and box as one gated authoring task. 3. **The interpolation model for coupled steps.** Settled (decisions 0001 and 0002): an axis tree with windows and solved curves for rigid steps, including the petal fold; open, pop, close for reverse folds and sinks, opened to 20° by default (decision 0003), held to 10% strain. 4. **Which boat.** Settled: the sampan (see *Rights*). 5. **The overlapping-moving-sets rule.** Decision 0001 found no case it covers that staggered windows and the near-coplanar clusters do not. Removing it is open.