Batch C. Closes #3.
- Task 4:
FoldInterpolator— rigid interpolation on the axis tree. Each axis applies its own rotation and then its parent's, on its own window of t, linear or along a solved curve. turnOver and rotate turn the start frame about its bounding-box centre. Non-rigid steps are left to Task 7b. - Task 5:
LayerOrder— sources with per-source cycle checks, the active ordering (mid-fold or end frame first, then the start frame for pairs the first lacks), near-coplanar clusters, back-to-front sorting against the view andstackDepth. The validator's rigid-invariant relation, cycle finder and polygon overlap are now public in FoldFormat and shared. - Task 6:
interpenetrations— the plane-intersection chord of two convex faces must pass through both interiors. Boundary contact does not count; pairs that share a vertex are still checked. - Final-review fix: a moving/still pair is read against the still face's normal, so a flap is never drawn behind the layer it lies on at the start of a fold.
- Plan: end frames come from the interpolator in foldc, there is a validator rule for flaps leaving from under a layer, and cluster membership is cached per t in the renderer.
swift test --package-path Packages/FoldKit: 89 tests pass (Folding 52, FoldFormat 37).