foldc, non-rigid steps, foldlint and the cup (Tasks 7, 7b, 8) !5

merged merged by cmc on 2026-10-20 03:55 UTC · krz/fold:compiler-and-cup into main

Discussion

cmc
  • foldc compiles a crease pattern and a fold script into a FOLD sequence. Each end frame comes from FoldInterpolator through readStep. Only the axes on a loop's cycle are solved. Layer order is guessed by arrival side, with overrides from the script. Every step is validated, checked for interpenetration and checked for layer motion.
  • Non-rigid steps move by open, pop, close (decision 0002). RenderMesh, an ARAP pop with a sparse Cholesky factor, and PopCompiler hold the pop to 10% strain.
  • layerMotionDefects adds the departure/arrival rule, run by foldc, foldlint and the catalogue tests.
  • foldlint, ModelLibrary and the catalogue gate.
  • The cup: crease pattern, script, generated cup.fold and docs/authoring/cup.md. It regenerates byte-identical and needs no layer-order overrides.
  • The plan and spec are amended for rulings R22–R34 and the cup's eight-layer centre.

swift test --package-path Packages/FoldKit: 151 tests pass.

Closes #4