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/// - `viewpoint`: defaults to the previous step's, or eye `[0, 0, 1]`, up `[0, 1, 0]` for step 1. 28/// - `viewpoint`: defaults to the previous step's, or eye `[0, 0, 1]`, up `[0, 1, 0]` for step 1.
29/// - `driver`: the crease held linear when the step's creases close a loop; defaults to the first. 29/// - `driver`: the crease held linear when the step's creases close a loop; defaults to the first.
30/// - `faceOrders`, `faceOrdersMidFold`: corrections to the guessed layer order. 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.
32public struct ScriptStep: Codable, Sendable { 33public struct ScriptStep: Codable, Sendable {
33 public let kind: StepKind 34 public let kind: StepKind
34 public let technique: StepTechnique? 35 public let technique: StepTechnique?
Packages/FoldKit/Sources/FoldCompiler/PopCompiler.swift +3 −2
@@ -2,8 +2,9 @@ import FoldFormat
2import Folding 2import Folding
3import simd 3import simd
4 4
5/// The spine's fold angle when the flap is open, in degrees from flat, when the script gives none. 5/// The spine's fold angle when the flap is open, in degrees from flat, when the script gives none
6private let defaultOpenAngle = 30.0 6/// (decision 0003).
7private let defaultOpenAngle = 20.0
7/// The boundaries of the pop on the step's t (decision 0002). 8/// The boundaries of the pop on the step's t (decision 0002).
8private let phases = [1.0 / 3, 2.0 / 3] 9private let phases = [1.0 / 3, 2.0 / 3]
9/// The largest relative change in a render-mesh edge's length the pop may reach (decision 0002). 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 let out = try compiled("reverse") 10 let out = try compiled("reverse")
11 let step = try #require(out.frames[2].step) 11 let step = try #require(out.frames[2].step)
12 #expect(step.nonRigid) 12 #expect(step.nonRigid)
13 #expect(step.pop?.openAngle == 30) 13 #expect(step.pop?.openAngle == 20)
14 #expect(step.technique == .insideReverse) 14 #expect(step.technique == .insideReverse)
15} 15}
16 16