Commit 9aed562990
9aed56299060625aa25f3438d99049a69d0ef306
parent: e03e518464
Verified · cmc
cmc <hello@cleberg.net> · 2026-10-22 20:44 UTC
Open reverse folds to 20° from flat by default
Ref #7
Layout: unified · split
Packages/FoldKit/Sources/FoldCompiler/FoldScript.swift
+2 −1
| @@ -28,7 +28,8 @@ public struct FoldScript: Codable, Sendable { |
| 28 | 28 | /// - `viewpoint`: defaults to the previous step's, or eye `[0, 0, 1]`, up `[0, 1, 0]` for step 1. |
| 29 | 29 | /// - `driver`: the crease held linear when the step's creases close a loop; defaults to the first. |
| 30 | 30 | /// - `faceOrders`, `faceOrdersMidFold`: corrections to the guessed layer order. |
| 31 | | /// - `spine`, `openAngle`: a reverse fold or sink, compiled by the non-rigid path. |
| 31 | /// - `spine`, `openAngle`: a reverse fold or sink, compiled by the non-rigid path. `openAngle` |
| 32 | /// defaults to 20. |
| 32 | 33 | public struct ScriptStep: Codable, Sendable { |
| 33 | 34 | public let kind: StepKind |
| 34 | 35 | public let technique: StepTechnique? |
Packages/FoldKit/Sources/FoldCompiler/PopCompiler.swift
+3 −2
| @@ -2,8 +2,9 @@ import FoldFormat |
| 2 | 2 | import Folding |
| 3 | 3 | import simd |
| 4 | 4 | |
| 5 | | /// The spine's fold angle when the flap is open, in degrees from flat, when the script gives none. |
| 6 | | private let defaultOpenAngle = 30.0 |
| 5 | /// The spine's fold angle when the flap is open, in degrees from flat, when the script gives none |
| 6 | /// (decision 0003). |
| 7 | private let defaultOpenAngle = 20.0 |
| 7 | 8 | /// The boundaries of the pop on the step's t (decision 0002). |
| 8 | 9 | private let phases = [1.0 / 3, 2.0 / 3] |
| 9 | 10 | /// The largest relative change in a render-mesh edge's length the pop may reach (decision 0002). |
Packages/FoldKit/Tests/FoldCompilerTests/NonRigidTests.swift
+1 −1
| @@ -10,7 +10,7 @@ import FoldKitTestSupport |
| 10 | 10 | let out = try compiled("reverse") |
| 11 | 11 | let step = try #require(out.frames[2].step) |
| 12 | 12 | #expect(step.nonRigid) |
| 13 | | #expect(step.pop?.openAngle == 30) |
| 13 | #expect(step.pop?.openAngle == 20) |
| 14 | 14 | #expect(step.technique == .insideReverse) |
| 15 | 15 | } |
| 16 | 16 | |