docs/authoring/box.md

main
fold/docs/authoring/box.md rendered · source · history · blame · raw

130 lines · 6890 bytes

5 symbols in this file
  1# Box
  2
  3The traditional masu. Twelve steps: four fold-and-unfolds, six folds, and two
  4coupled folds with solved curves (steps 9 and 11) that raise the end walls. No
  5non-rigid steps. The model ends standing as a box, not flat.
  6
  7`Models/box-cp.fold` and `Models/box.foldscript` compile to
  8`Packages/FoldKit/Sources/Models/Resources/box.fold`:
  9
 10```bash
 11swift run --package-path Packages/FoldKit foldc Models/box.foldscript \
 12  -o Packages/FoldKit/Sources/Models/Resources/box.fold
 13```
 14
 15`everyShippedModelRegeneratesFromItsScript` checks that the shipped file is
 16what the script compiles to.
 17
 18## Sequence and source
 19
 20The traditional masu as it is usually taught: crease the diagonals, blintz,
 21fold the edges to the centre and unfold both ways, open two opposite corners,
 22raise the sides, raise each end while pushing its corners in, and fold the end
 23flap over the wall into the box. In this variant the sides are raised straight
 24to 90°, not first folded to the centre, and both sides are raised before
 25either end.
 26
 271. Fold and unfold the diagonal y = 2, bottom corner to top.
 282. Fold and unfold the diagonal x = 2, left corner to right.
 293. Fold the bottom and top corners to the centre (two axes).
 304. Fold the left and right corners to the centre (two axes).
 315. Fold and unfold the top and bottom edges to the centre line (y′ = 2.5 and
 32   1.5 through all layers; two axes).
 336. Fold and unfold the left and right edges to the centre line (x′ = 1.5 and
 34   2.5; two axes).
 357. Unfold the top and bottom corners (angles 180 → 0).
 368. Raise the left and right sides to 90°.
 379. Raise the top end to 90°, the corners folding in against it (coupled).
 3810. Fold the top flap over the wall and down into the box.
 3911. Raise the bottom end in the same way (`repeatOf` 9).
 4012. Fold the bottom flap into the box (`repeatOf` 10).
 41
 42Viewpoints: eye (0, 0, 1), up (0, 1, 0) for steps 1–7; eye (1, −2, 2), up
 43(0, 1, 0) for steps 8–10; eye (1, 2, 2), up (0, −1, 0) for steps 11–12, so
 44that each end is raised on the far side of the box. Neither oblique eye lies in
 45the plane of any wall, so no face is seen edge-on.
 46
 47At step 11 the viewpoint moves round to the other end of the box, eye
 48(1, −2, 2) to (1, 2, 2) and up (0, 1, 0) to (0, −1, 0), so the view turns
 49180°: the camera moves and the model does not. This is an authored exception
 50to "the model reorients, not the camera". A rotate step turns the model about
 51the view direction, so at an oblique viewpoint with the walls standing a 180°
 52rotate would tilt the box off the table instead of turning it round on it, and
 53a turn-over would put it upside down. Changing the eye and up vectors at step
 5411 brings the bottom end to the far side without moving the paper.
 55
 56## Crease pattern
 57
 58Constructed from the sequence above, not taken from a published crease
 59pattern. The sheet is a square of side 2√2 set as a diamond, corners S (2, 0),
 60E (4, 2), N (2, 4), W (0, 2), its top side up. Every coordinate is a multiple
 61of ½.
 62
 63The blintz folds the corners to C (2, 2) along the square [1, 3]². Each later
 64crease is folded through every layer, so it is a full chord of the diamond:
 65the creases are the lines x = c and y = c for c in ½, 1, …, 3½, clipped to the
 66sheet. The lines x = ½, 3½ and y = ½, 3½ cross only the blintz flaps. Four
 67corner diagonals are added, one in each corner square of the blintzed square:
 68(1½, 2½)–(1, 3), (2½, 2½)–(3, 3), (1½, 1½)–(1, 1), (2½, 1½)–(3, 1). That gives
 6941 vertices, 84 edges (16 boundary) and 44 convex faces, so no subdivision
 70edges.
 71
 72| Crease | First creased | Final |
 73|---|---|---|
 74| y = 2, x = 2 (the diagonals) | 1, 2 | F |
 75| y = 1, y = 3: segments of the end walls' top edges, x ∈ [1½, 2½] | 3 | V 180 |
 76| y = 1, y = 3: x ∈ [1, 1½] and [2½, 3] | 3 | M −180 |
 77| x = 1, x = 3 (the side blintz folds) | 4 | V 180 |
 78| y = 2½, y = 1½ through the base, x ∈ [1, 3] | 5 | V 90 |
 79| y = 2½, y = 1½ through the side flaps | 5 | M −90 |
 80| y = 3½, y = ½ (the end flaps' tips) | 5 | M −90 |
 81| x = 1½, x = 2½, y ∈ [1½, 2½] (the side walls) | 6 | V 90 |
 82| x = 1½, x = 2½, the rest of the line | 6 | V 180 |
 83| x = ½, x = 3½ (the side flaps' tips) | 6 | M −90 |
 84| the corner diagonals | 9, 11 | M −180 |
 85
 86The pattern's assignments are the last frame's; the diagonals end flat.
 87
 88## The coupled steps
 89
 90Raising an end makes a degree-5 vertex at each corner of the floor, for
 91example (1½, 2½): the side wall's hinge below it (held at 90°), the crease A
 92between the side wall and the corner square, the corner diagonal, the crease
 93x = 1½ above it between the corner square and the end wall, and the end wall's
 94hinge y = 2½. With the floor and the side wall still, A stands vertical, and
 95the corner square's two triangles (45° each), the end wall (90°) and the fixed
 9690° between A and the end wall's hinge form a spherical four-bar linkage with
 97one degree of freedom. With β the angle at A and ε the end wall's angle:
 98
 99  cos β = tan(45° − ε/2), so ε = 90° − 2 atan(cos β).
100
101At ε = 90° the two triangles and the end wall lie in one plane, the corner
102folded flat against the inside of the end wall.
103
104The driver is β (`driver` defaults to the first crease, A), linear 0 → 90°.
105Driving ε instead puts β ∝ √ε at the start, which the 257-sample curve cannot
106follow. `foldc` solves the end wall's hinge and both diagonals; the far
107corner's A comes out linear by symmetry. The solved hinge matches the closed
108form: 1.11°, 4.53°, 19.47°, 48.12° at β = 11.25°, 22.5°, 45°, 67.5°. The corner
109square's other crease, the blintz flap's crease on line A and the end flap's
110crease on line x = 1½ close coaxial loops, and their end angles are measured.
111
112Classification: rigid. Both steps close (solved curves, gap within 1e-6 of the
113sheet), nothing interpenetrates at 64 samples, and the validator's layer rules
114and `layerMotionDefects` pass. Intermediate states were also drawn and checked
115by eye. In the app on the simulator, both steps complete under the fold drag;
116the accessibility audit walks them at both text sizes.
117
118Steps 10 and 12 fold the end flap 180° over the wall's top edge, with its tip
119folding −90° on the same window. The tip stays above the floor throughout. With
120the tip on [0.5, 1] instead, it is still straight when the flap is level, and
121in step 12 the bottom flap's tip point touches the raised top wall's upper edge.
122
123## Layer-order overrides
124
125None. `foldc`'s guess passes the validator, the interpenetration check and
126`layerMotionDefects`. The final stacks were checked by hand. Each end wall's
127corner, from outside in: the end wall, the corner triangle on the end wall's
128side, the triangle on the side wall's side, the blintz flap's corner, the end
129flap's corner triangle, and the end flap. Each side wall, from outside in: the
130wall, then the blintz flap. On the floor, each quarter carries one flap tip.