Diagram generation and Metal renderer (Tasks 9–10) !6

merged merged by cmc on 2026-10-20 04:57 UTC · krz/fold:diagram-and-renderer into main

Discussion

cmc
  • Notation: buildDiagram draws frame n − 1 with step n's creases and arrows. Valley and mountain are classified as seen from the viewpoint. Earlier creases are light and creases not yet made are omitted. Edges are clipped against the union of the faces above them (visibleSegments). Arrows and symbols cover plain folds, fold-and-unfold, techniques, turn-over, rotate and repeat.
  • drawDiagram is the public CoreGraphics drawing, used by the golden-image snapshots: 21 images, with symbol sources in NOTATION.md.
  • Camera in Folding.
  • Renderer: PaperRenderer uses hybrid depth. Clusters are depth-tested against each other. Within a cluster, faces are drawn back to front with depth writes off, then the cluster is drawn again depth-only. Paper is two-sided through [[front_facing]]. The shaders are compiled at init.
  • FoldStep.allMovingFaces includes faces opening on the spine; LayerOrder.active and layerMotionDefects use it.
  • Pop solves are serialised on their factor.
  • The plan is amended for rulings R35–R41 and the carry-overs into Tasks 11, 14 and 15.

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

Closes #5