Commit e5aeeae2a6
Verified · cmc
Layout: unified · split
Packages/FoldKit/Tests/FoldCompilerTests/NonRigidTests.swift +2 −1
| @@ -71,9 +71,10 @@ import FoldKitTestSupport | ||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | @Test func nothingPassesThroughAnything() throws { |
| 74 | // in all three phases, on the render mesh | |
| 74 | 75 | let file = try compiled("reverse") |
| 75 | 76 | let i = FoldInterpolator(file: file, step: try readSteps(file)[1]) |
| 76 | #expect(meshInterpenetrations(i, samples: 64).filter { $0.t > 0.02 && $0.t < 0.98 }.isEmpty) | |
| 77 | #expect(meshInterpenetrations(i, samples: 64).isEmpty) | |
| 77 | 78 | } |
| 78 | 79 | |
| 79 | 80 | @Test func theTipLandsBetweenTheFlapsLayers() throws { |
Packages/FoldKit/Tests/ModelsTests/CatalogueTests.swift +3 −2
| @@ -70,14 +70,15 @@ import Notation | ||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | @Test func everyFlaggedStepStaysWithinTheBound() throws { |
| 73 | // decision 0002: 10% largest edge strain on the render mesh, and nothing passes through anything | |
| 73 | // decisions 0002 and 0003: 10% largest edge strain on the render mesh, and nothing passes | |
| 74 | // through anything in any phase | |
| 74 | 75 | for file in try ModelLibrary.all() { |
| 75 | 76 | for step in try readSteps(file) where step.nonRigid { |
| 76 | 77 | let i = FoldInterpolator(file: file, step: step) |
| 77 | 78 | let (lo, hi) = (step.pop!.phases.lowerBound, step.pop!.phases.upperBound) |
| 78 | 79 | let worst = (0...128).map { strain(i.meshPositions(at: lo + Double($0) / 128 * (hi - lo)), mesh: i.mesh) }.max()! |
| 79 | 80 | #expect(worst <= 0.10, "\(file.fileTitle ?? "?") step \(step.index)") |
| 80 | #expect(meshInterpenetrations(i, samples: 64).filter { $0.t > 0.02 && $0.t < 0.98 }.isEmpty) | |
| 81 | #expect(meshInterpenetrations(i, samples: 64).isEmpty, "\(file.fileTitle ?? "?") step \(step.index)") | |
| 81 | 82 | } |
| 82 | 83 | } |
| 83 | 84 | } |