docs/authoring/cup.md

00ea029d0652da12d0f4237769e7020b72cfa7f3
fold/docs/authoring/cup.md rendered · source · history · blame · raw

96 lines · 4525 bytes

4 symbols in this file
 1# Cup
 2
 3Traditional. Six steps: five folds of one axis each and a turn-over. No coupled
 4steps (no solved curves) and no non-rigid steps.
 5
 6`Models/cup-cp.fold` and `Models/cup.foldscript` compile to
 7`Packages/FoldKit/Sources/Models/Resources/cup.fold`:
 8
 9```bash
10swift run --package-path Packages/FoldKit foldc Models/cup.foldscript \
11  -o Packages/FoldKit/Sources/Models/Resources/cup.fold
12```
13
14`everyShippedModelRegeneratesFromItsScript` checks that the shipped file is
15what the script compiles to.
16
17## Crease pattern
18
19Constructed from the traditional folding sequence, not taken from a published
20crease pattern. The sheet is a square of side √2 set as a diamond, corners
21S (1, 0), E (2, 1), N (1, 2), W (0, 1), its top side up (+z).
22
23Step 1 folds S up to N along the diagonal y = 1, giving a triangle with its
24folded edge W–E at the bottom and apex N. Step 2 folds corner E to the left
25edge W–N so that the flap's top edge, part of the former right edge E–N, is
26level. Reflecting E–N (direction 135°) onto a horizontal line needs a crease
27at 67.5°; the one that also puts E on W–N runs from Q = (4 − 2√2, 1) on the
28fold to R = (√2, 3 − √2) on the right edge, and E lands on
29P = (2 − √2, 3 − √2). Step 3 is its mirror image: the crease from
30Q′ = (2√2 − 2, 1) to P, and W lands on R. The apex flaps fold down along the
31level line through P and R. Each crease through both layers of the triangle
32is two creases in the pattern, one in each half of the diamond, mirrored in
33y = 1.
34
35| Vertex | Point | Coordinates |
36|---|---|---|
37| v0 | S | (1, 0) |
38| v1 | R′ | (√2, √2 − 1) |
39| v2 | E | (2, 1) |
40| v3 | R | (√2, 3 − √2) |
41| v4 | N | (1, 2) |
42| v5 | P | (2 − √2, 3 − √2) |
43| v6 | W | (0, 1) |
44| v7 | P′ | (2 − √2, √2 − 1) |
45| v8 | Q′ | (2√2 − 2, 1) |
46| v9 | Q | (4 − 2√2, 1) |
47
48| Edges | Crease | Assignment | Step |
49|---|---|---|---|
50| e0–e7 | boundary, S → R′ → E → R → N → P → W → P′ → S | B | — |
51| e8, e9, e10 | the diagonal: W–Q′, Q′–Q, Q–E | V | 1 |
52| e11, e12 | Q–R (top half), Q–R′ (bottom half) | V, M | 2 |
53| e13, e14 | Q′–P (top half), Q′–P′ (bottom half) | V, M | 3 |
54| e15 | P′–R′, the front apex flap | M | 4 |
55| e16 | P–R, the back apex flap | M | 6 |
56
57Faces, counterclockwise: f0 [P′, S, R′] (front apex flap), f1 [P′, R′, Q, Q′]
58(front body), f2 [R′, E, Q] and f6 [Q, E, R] (the right corner flap, front and
59back layers), f3 [W, P′, Q′] and f4 [W, Q′, P] (the left corner flap), f5
60[Q′, Q, R, P] (back body), f7 [P, R, N] (back apex flap).
61
62Every crease ends on the boundary or at Q or Q′ on the diagonal, so no
63subdivision edges are needed. Q and Q′ are degree-4 vertices with sectors
6467.5°, 112.5°, 112.5°, 67.5° and three valleys to one mountain.
65
66The bottom half's creases are mountains because that half is turned face-down
67by step 1: steps 2–4 fold toward the viewer, which is a valley seen from the
68front and a mountain on the bottom half's own top side. Step 6 folds the back
69apex flap toward the viewer after the turn-over, when its top side faces away.
70
71## Sequence
72
731. Valley fold S up to N along the diagonal (named crease e9; e8 and e10 lie
74   on its line and fold with it).
752. Valley fold the right corner E across to P, through both layers (e11; e12
76   folds with it). The right corner goes first.
773. Valley fold the left corner W across to R, over the first flap (e13 and
78   e14). Six layers where the corner flaps cross.
794. Valley fold the front apex flap f0 down over the front along P–R (e15).
80   S lands on (1, 4 − 2√2). Seven layers.
815. Turn over, about the vertical axis.
826. Valley fold the back apex flap f7 down (e16). N lands on (1, 4 − 2√2).
83   Eight layers in the triangle P, R, (1, 4 − 2√2).
84
85The apex flaps are folded down over the outside, not tucked into the pocket.
86The model ends flat. Viewpoint: eye (0, 0, 1), up (0, 1, 0) throughout.
87
88## Layer-order overrides
89
90None. Every step is a plain valley fold of one moving set onto the outside of
91the stack, which is the case the compiler's guess (the moving set lands on the
92side it arrives from, its own layers reversed) gets right. `foldc`'s
93validation, the interpenetration check and `layerMotionDefects` pass with the
94guessed orders, and the guessed stacks were checked by hand against the sequence:
95after step 3, bottom to top along +z, f5, f1, f2, f6, f3, f4; step 4 puts f0
96on top of all of them; step 6 puts f7 on top of the turned-over stack.