docs/decisions/0003-bending-openings.md

main
fold/docs/decisions/0003-bending-openings.md rendered · source · history · blame · raw

426 lines · 21846 bytes

21 symbols in this file

0003 — Openings for the crane's reverse folds and the sampan's inversion

Status: measured and decided 2026-10-22 (see Decision). The decision going in was to bend the opening: the flap's near layers bend open while the body holds still, using the same as-rigid-as-possible machinery as 0002's pop, and the same machinery for the sampan's inversion. The measurements below do not support that as stated. They support a rigid opening of the whole near side on a bend line, with the pop the only bent phase. For the sampan, bending does not work either.

Follows 0002-non-rigid-steps.md. Spike: spikes/bending, run with swift run -c release --package-path spikes/bending [case]. The cases are mesh, crane, stages, pop, sampan, sampanpath and sampanbend; with no argument it runs all of them, in about four minutes.

Question

Task 15 stopped on two steps that no rigid motion makes:

  1. The crane's inside reverse folds (neck, tail, head). The neck's near layers cannot open rigidly on the spine: the near half of the paper crosses the spine's line, so turning it drives the other leg's layers through each other. Once the neck is reversed, the tail and head have no single hinge to open on.
  2. The long-form sampan's step 14, turning inside out. About 108 faces hang on the base hexagon B's eight edges. There is no spine, and the scripted end does not close (gap 0.632).

Also, on the crane's pattern the pop's strain was set by sliver edges in the render mesh, not by the paper.

This record measures whether bending fixes those three things, and how.

Inputs

spikes/bending/Data holds scratch outputs from Task 15:

  • crane-1-12.fold: the crane through step 12 (narrowed legs), with the staged neck creases. Step 4 was compiled with the locally patched loop solver from the crane report (Blocker 1, still open).
  • crane-1-13.foldscript: the staged neck script.
  • sampan-long-1-13.fold: the long-form sampan through step 13.
  • sampan-long-attempt-2.foldscript: the failed step 14.

The spike depends on FoldKit by path. It uses FoldKit for decoding, for compiling the 0002 fixture, and for FoldKit's own RenderMesh and pop. It builds its own meshes, as-rigid-as-possible solver, kinematics and interpenetration check.

Interpenetration is counted on mesh triangles in different FOLD faces. Two kinds of crossing are not counted:

  • crossings shallower than 1e-3 of the sheet's size, which is about 0.15 mm on a 15 cm square, roughly the paper's thickness;
  • coplanar pairs, which are FoldKit's rule.

"Strain" is the largest relative change in a mesh edge's length, as in 0002. "Principal" is the largest |σ − 1| over the triangles' singular values. Principal strain does not depend on which directions the mesh's edges run in.

1. Render mesh

Three constructions were measured, each with spacing h equal to the longer side divided by 32:

  • grid: 0002's, which is FoldKit's RenderMesh;
  • collapsed: the grid with edges shorter than h/4 collapsed onto crease-pattern vertices or along creases;
  • delaunay: each crease divided evenly at about h; a triangular lattice inside each face, kept 0.6 h from the face's sides; Delaunay within each face (ear clipping, point insertion, Lawson flips). Faces stay convex and conforming, and the FOLD topology is unchanged.
pattern mesh shortest edge shortest / h smallest angle
crane grid 1.39e-4 0.004 0.1°
crane collapsed 3.94e-4 0.013 0.7°
crane delaunay 6.18e-3 0.198 10.9°
sampan grid 2.53e-2 0.202 8.1°
sampan delaunay 4.66e-2 0.373 18.4°

On the crane, Delaunay's shortest edges are at the legs' points, where creases meet at small angles. They are wedges of real paper, not slivers.

Pop strain on each mesh (mesh):

case grid collapsed delaunay
0002 fixture, opened to 30° from flat, h = 1/32 7.46% (principal 7.79%) 7.46% 9.69% (10.94%)
same, h = 1/64 8.45% (8.73%) 8.45% 9.47% (9.50%)
crane neck, opened to 160°, slerp pop (§2) 402% (497%) 9.80% (33.6%) 8.74% (8.84%)
crane neck, opened to 150° 918% 21.2% (71.6%) 18.8% (19.0%)

The grid's crane numbers are sliver edges 2e-4 long. Collapsing leaves edges 4e-4 long: it cannot move a point lying on one crease onto another crease. Delaunay's edge strain and principal strain agree on the crane, which means its strain is the paper's.

The fixture is not a clean comparison. Its pop strain depends on the mesh, ranging from 7.5% to 11% across meshes and resolutions. At finer resolution the two meshes approach each other, at about 9%. The grid's 7.46% is partly an artifact of its edges running only in three directions.

Recommendation: the Delaunay construction. Keep the bound on edge strain.

2. Crane: neck, tail and head

The neck crease

The staged script's neck crease runs from the spine at view height 0.47 to the leg's edge at 0.288. Reflected about that crease, the neck points down and out, 35° below horizontal. That is not the crane's neck.

The spike also measures a raised crease: 22.5° below horizontal from the same spine point. The neck then ends 45° above horizontal, rising between the body's layers. The spike adds this crease to the crane's pattern through every layer of the leg. The tail is the mirror of the raised neck. The head crease runs across the neck 0.33 from the vertex, horizontal, so the head points 45° down. Which neck crease the crane uses is the author's call; the raised one is the harder case and the one measured throughout.

How the motion is built

The reverse vertex is 0001's degree-4 vertex. With the near layers turned by α about the spine, the tip has two rigid placements:

  • unreversed: the tip turns with its layers;
  • reversed: each layer of the tip turns about its own reverse crease until the tip's spine meets in the plane bisecting the opened layers. That turn is γ = 2·atan2((c_n × w⊥)·c, w⊥·c), where c is the far crease, c_n the near crease turned by α, w the tip's spine direction and w⊥ its component across c_n.

The motion has three phases:

  1. Open over t 0–⅓, with the tip unreversed.
  2. Pop over ⅓–⅔, by slerp per face as in 0002, with everything else held.
  3. Close over ⅔–1, on the reversed branch.

The close lands exactly on the step's end, with the tip reflected in its crease.

Bending the opening (crane)

Three ways to open were tried.

  • A bends the leg's near layers and holds the body.
  • B bends the whole near side on the flap's side, together with the two near faces that cross the spine's line (1 and 14: the front wing's centre and the layer under it).
  • C puts a bend line on the spine's line through those two faces. The bend line is an edge that is never creased. The near side then turns rigidly.
opening neck crease α open strain (principal) pop strain collisions open / pop / close tip between layers
A, body held staged 150° 44.0% (44.6%) 44.0% 1239 / 2738 / 4576 yes
A, body held raised 150° 199% (204%) 199% 1234 / 1320 / 3316 yes
B, h = 1/32 staged 150° 9.70% (13.8%) 9.70% 5815 / 9330 / 15267 yes
B, h = 1/32 raised 150° 11.7% (16.7%) 18.8% 5603 / 9585 / 13971 yes
B, h = 1/64 raised 150° 6.55% (8.02%) 13.8% 12056 / 16710 / 21696 yes
C, bend line staged 150° 0 3.84% 0 / 0 / 0 yes
C, bend line raised 160° 0 8.74% 0 / 0 / 0 yes

What these show.

  • The body cannot be held (A). The neck's innermost near layer (face 21) runs on under the front wing to the centre of the square. At the reverse vertex it must open nearly flat, and at the wing it must stay closed. Developability makes it worse: along a straight crease the near layer's opening angle is constant, unless the paper creases again near it. Forcing the change over the short stretch between the two strains the paper by 44–200%.
  • Bending the near side without a shared line (B) passes layers through each other. Its strain falls as the mesh is refined (11.7% → 6.6% at 150°), because the solver approximates a fold in a narrow band. But faces 1 and 14 lie one on the other, and each bends on its own. They cross at the first sample, and the counts grow with refinement. Every layer of a stack must bend alike, and independent as-rigid-as-possible solves per layer do not do that.
  • A bend line (C) makes the opening rigid. It has zero strain and no interpenetration. The near side turns as one stack, and the wing's centre folds on the line with the layer under it.

C is not bending. It opens the front wing's half along its centre by α for the duration of the step. In real paper, that is where the wing flexes when the leg is opened.

All three folds with a bend line (stages)

  • Tail. The tail is the neck mirrored, in frame 13. The neck's tip, reversed between the left layers, holds still.
  • Head. The head re-opens the neck by turning the left near side again. The neck's layers follow the neck's own reversed branch rigidly. By symmetry, they open by exactly α, the same as the body. The head then pops between the neck's layers.

At every opening, the units' placements agree within 6e-13, and the open and close have zero strain.

step α pop strain (principal) collisions tip between layers
neck 170° / 160° / 150° 2.25% / 8.74% / 18.8% (19.0%) 0 yes
tail 170° / 160° / 150° 2.33% / 9.01% / 19.2% (20.7%) 0 yes
head 170° / 160° / 150° 0.46% / 1.82% / 4.06% 0 yes

The neck's and tail's pop strain sits at the leg's tip, on 6.4e-3 edges at the paper's corner. The two layers of the tip turn about different creases, so they part along the tip's spine, and the leg is narrowest at its point.

The pop (pop)

Four pops were compared. In all of them the opening and closing are rigid.

  • slerp: 0002's pop.
  • guided: as-rigid-as-possible, with only the tip's far 10% on the slerp path.
  • spine: as-rigid-as-possible, with only the tip's spine guided, turning in the bisecting plane.
  • banded: slerp, but within the tip's width of its spine each layer's turn is blended toward the other layer's turn. The blend is halfway at the spine and grows as 4s(1 − s), so it is zero at both ends. Least squares then spreads the gap between the layers over the band.
step α slerp guided spine banded
fixture 160° 4.36% 2.25% 1.82%, gap 5.2e-2 3.08%
fixture 150° 9.69% 5.00% 4.05%, gap 6.1e-2 6.68%
neck 160° 8.74% 8.74%, 1054 coll. 0.75%, 5603 coll., gap 2.1e-2 2.83%
neck 150° 18.8% 18.8%, 2755 coll. 1.10%, 7611 coll. 6.13%, 97 coll.
tail 160° 9.01% 9.01%, 365 coll. 2.65%, 5604 coll. 3.28%
head 160° 1.82% 1.32% 1.81%, 492 coll. 1.71%
head 150° 4.06% 3.04%, 2 coll. 4.03%, 548 coll. 3.83%

Collisions are zero wherever none are listed. The gap is the distance between the pop's last sample and the pose the close starts from; for slerp and banded it is below 4e-13.

  • The as-rigid-as-possible paths cut strain the most, but they pass the tip's stacked layers through each other. The spine-guided path also does not end where the close begins (gap 0.02–0.06).
  • Banded keeps slerp's properties: exact ends, no interpenetration at 160°, the same cost per frame. It cuts the neck and tail pops by a factor of 3.

3. Sampan: turning inside out

The end state (sampan)

The scripted end turns all eight hinges from −180° to 90° and keeps every other crease. It does not close: the gap is 1.265 on a sheet of side 4. With the hinges held at 90° and the other 100 tree creases free, the least gap is 0.028. The scripted end is not a rigid state.

The reason is that B's four corners are 0001's reverse vertex. At (1.5, 2.25):

  • the straight pair is the slanted line: the slanted hinge and its continuation;
  • the mirror pair is the long hinge and the step-13 crease beyond the corner;
  • the sectors are 26.57°, 26.57°, 153.43° and 153.43°.

On the reverse branch, tan(ρ_slanted/2) = cos 26.57° · tan(ρ_long/2). So a long wall at 90° puts the slanted wall at 83.6°, not 90°.

Rigid states with every wall up exist. With long hinges at 90° and slanted hinges at 83.6°, the gap is 6.4e-15. The same holds for 153°/150°, 125°/120° and 106°/100°: this is a one-parameter family.

The path (sampanpath)

  • A continuation from frame 13 reaches that end with gap ≤ 3.8e-9 throughout. The long hinges go −180° → 0° → 90°, the slanted hinges follow the corner relation, and the rest are solved. At 0°, 50 creases are flat.
  • 56 of the 111 tree creases move by more than 1°.
  • The path interpenetrates from the first samples: 85,626 triangle pairs over 90 samples, 354 face pairs, the first at −177°. 60 creases pass beyond ±180°, that is, their faces turn through each other at the crease.
  • The solver's direction of departure from ±180° is free. It was not established whether a collision-free rigid branch exists.
  • The end state was not checked against the real boat. It is not a clean hull: the walls' layers do not stay stacked.

Bending (sampanbend)

Each face hangs from its nearest hinge (breadth first from the hinges). The walls swing outward from −180° through 0° to 90°/83.6°.

worst strain (principal) collisions per sample
walls as rigid stacks, misfit spread by least squares 69.5% (96.3%) 520–3100
then relaxed by as-rigid-as-possible, B and the hinge faces held 14.4% (16.3%) 880–2740

Relaxed, the strain is moderate. But the wall layers cross each other throughout, as in the crane's B variant, and the relaxed end is a shallow dish, not a boat. Bending does not make the sampan's inversion work. Making it work would need two things:

  • bending that keeps each wall's layers together as one sheet, which nothing here provides;
  • a defined target shape for the finished boat. None was found: the published instructions do not describe it, and the photo shows bent "tent" ends.

4. The bound

On every case that works, the openings and closings are rigid. Only the pop bends, so 0002's bound still means what it meant. Measured pop strain on the Delaunay mesh:

170° 160° 150°
fixture, slerp 1.10% 4.36% 9.69%
neck, slerp 2.25% 8.74% 18.8%
neck, banded 0.72% 2.83% 6.13% (97 coll.)
tail, banded 0.85% 3.28% 6.94% (100 coll.)
head, banded 0.43% 1.71% 3.83%

10% stays the right bound, on edge strain on the Delaunay mesh. The default opening should move from 30° to 20° from flat (α = 160°). At 30°, the fixture's pop is at the bound on the new mesh (9.69%, principal 10.9%), and the neck and tail fail with slerp (18.8%, 19.2%).

The bent openings that were measured (A, B, and the sampan's walls) would need 13–200% and still interpenetrate. No strain bound makes them acceptable, so none is proposed for them.

Recommendation

  1. Render mesh: Delaunay (§1). It replaces the grid in RenderMesh and keeps the same public API.
  2. Crane reverse folds: open, pop, close, with a rigid opening of the whole near side. This is decision 0002's model with two changes:
    • Bend lines. The crease pattern carries, on the spine's line, edges through the near faces that cross it (on the crane: the front wing's centre and the layer under it). These edges are F in every frame and are never creased (edges_krz:firstCreasedAtStep null). The opening side is everything on the near face's side once every edge on the line is cut. That is the spine-side patch from the crane report, which bend lines make sufficient for the neck and the tail.
    • Nested openings. A reverse fold of a flap that is itself the tip of an earlier reverse fold (the head) opens by turning the outer opening again (the body's near side), with the earlier fold's creases solved on its reversed branch. Its open phase is a rigid M2 motion, like any coupled step.
  3. Pop: banded slerp (§2), at a default opening of 20° from flat. Plain slerp also passes the crane at 20° (8.74%, 9.01%), with little margin.
  4. Bound: 10% edge strain on the Delaunay mesh, unchanged.
  5. Sampan: not solved by bending. The options are under Decisions for the author.

Cost

  • Mesh. About 200 lines in RenderMesh (division of creases, lattice, triangulation, flips). The crane mesh has 1,120 vertices and 2,110 triangles, fewer than the grid's 1,620 vertices and 3,108 triangles.
  • Bend lines. Edges in the crease pattern; no format change. compilePop takes the spine-side patch, and the open phase is checked with meshInterpenetrations as well as layerMotionDefects.
  • Nested openings. compilePop's open axes become a tree with solved curves, built by the loop solver that rigid steps already use.
  • Banded pop. Bending gains per-triangle rotation targets. The band is computed from the open pose, the popped pose and the tip's spine in frame n − 1, so PopRecord is unchanged. The per-frame cost stays one sparse solve.

What the crane batch must build

  • RenderMesh, Delaunay construction:

    • each crease divided into round(length / spacing) equal parts;
    • per face, a triangular lattice (rows spacing·√3/2 apart, offset by half a spacing on alternate rows), keeping points at least 0.6·spacing from the face's sides;
    • ear clipping on the boundary, skipping any ear with another boundary point on it;
    • point insertion, splitting an edge when the point lies on it;
    • Lawson flips on every edge that is not a boundary edge.

    The anchors are as now. Test: no edge shorter than 0.15·spacing except where a crease is shorter or creases meet at a sharp angle, and the fixture's pop at 20° from flat under 10%.

  • ScriptStep:

    • openAngle defaults to 20.
    • openOn: CreaseRef? names the crease whose opening opens the flap when that differs from spine (the head: the body's spine).
  • compilePop:

    • The opening side is computed by cutting the spine's whole line, keeping on-line edges whose faces fall on different sides (the crane report's patch).
    • With openOn, the open axes are the tree that the loop solver closes, driven by openOn from its angle to ±α; the close is the same in reverse after the pop.
    • Mesh interpenetration is checked in all three phases.
  • Bending: per-triangle turn targets. A tip triangle lies at distance d from the tip's spine (in frame n − 1); b is one width for the whole tip, the largest such d of a tip triangle, as the spike computed it. A triangle with d / b < 1 has target slerp(mid, own, w), where:

    • mid = slerp(own, other, ½);
    • w = d / b + (1 − d / b)·(1 − 4s(1 − s)).

    Triangles with d / b ≥ 1 are not blended and keep their own turn.

  • Crane pattern: bend lines on the spine's line through the front wing's centre and the layer under it, added with the neck and tail creases.

  • Tests (Task 15):

    • each reverse fold's open and close are isometric;
    • the pop is under 10%;
    • no mesh interpenetration in any phase;
    • the tip lies between the layers at 97% of the close.

    These are the checks the spike ran.

Not measured

  • The crane after the head (the wings down), and the staged neck's tail and head.
  • The banded pop on the fixture's interpenetration at 150° and below, beyond the counts above.
  • Whether a collision-free rigid branch of the sampan's inversion exists. The departure of each ±180° crease would need to follow its layer order.
  • The finished long-form sampan's real shape.

Decisions for the author

  1. Bending the opening, as decided, does not work. Holding the body costs 44–200% strain. Bending the near side layer by layer passes the layers through each other. Use the rigid opening on a bend line instead, which opens the front wing's half along its centre during the step? Recommended.

  2. The neck crease: the staged one (neck pointing down and out) or the raised one (the traditional crane's)? Recommended: raised.

  3. The pop: banded slerp, or 0002's slerp, both at 20° from flat?

  4. The sampan:

    • (a) keep the short form, whose inversion is rigid;
    • (b) ship the long form to step 13 with a rigid partial step;
    • (c) a further spike on stack-coherent bending with a target shape taken from the real model.

    Recommended: (a).

Decision

Made 2026-10-22 by the author:

  1. The crane's reverse folds open rigidly: the whole near side turns about the spine's line, with bend lines (edges on that line through the faces that cross it, F in every frame, never creased). During the step the front wing's half folds along its centre by up to 160° and flattens again. The head opens nested, on the body's spine (openOn).
  2. The neck crease is the raised one, 22.5° from the spine.
  3. The pop is the banded slerp, and the default opening is 20° from flat.
  4. The sampan ships in its short form, which turns inside out rigidly on two hinges and ends as an open tray. The long form with covered ends has no rigid end state as scripted, its rigid walls-up path interpenetrates, and bending it does not give a boat; it is a known gap.

The bound stays at 10% largest edge strain, measured on the Delaunay render mesh.