ConstSolve, in place, the control positions whose Catmull-Clark limit points are the targets.
The free vertices satisfy L P = T for the limit stencils L, solved by
Jacobi iteration P <- P + (T - L P) from P = T; held vertices keep their
target as their control position. The iteration converges when every
eigenvalue of L lies between 0 and 2; on a regular grid they lie between
1/9 and 1. It stops when the largest residual of a free vertex falls below
1e-10 of the targets' extent or after 2,000 sweeps, and returns that
residual, so a caller can refuse a fit that did not converge. At the iteration cap, one final residual evaluation measures the returned controls after the last update. Empty or entirely held systems return zero. No input validation or buffer allocation occurs in this kernel.
Per-vertex mask: zero holds a control at its target, nonzero allows Jacobi updates. Caller provides one entry per stencil vertex; the conventional values are 0 and 1.
Writable packed control output, initialized from targets. Must have room for 3*stencil.count scalars and be distinct from scratch and borrowed target storage.
Available scalar capacity, at least three times the stencil vertex count; this is a caller precondition rather than a runtime length guard.
Separate writable ping-pong buffer with the same capacity as positions. Initialized and overwritten by the solve; its final contents are unspecified.
Available scalar capacity, at least three times the stencil vertex count. The solver assumes valid indexed writes and does not allocate replacement storage.
Borrowed Catmull-Clark limit stencil defining the vertex count and weighted control neighbours. The caller supplies valid in-range stencil indices.
Read-only packed XYZ target coordinates, at least 3*stencil.count entries, in one consistent spatial unit. Surface rigs use metres; the algebra itself performs no unit conversion.
The largest remaining residual of a free vertex, in the targets' unit; 0 when none is free.
Solve, in place, the control positions whose Catmull-Clark limit points are the targets.
The free vertices satisfy
L P = Tfor the limit stencilsL, solved by Jacobi iterationP <- P + (T - L P)fromP = T; held vertices keep their target as their control position. The iteration converges when every eigenvalue ofLlies between 0 and 2; on a regular grid they lie between 1/9 and 1. It stops when the largest residual of a free vertex falls below 1e-10 of the targets' extent or after 2,000 sweeps, and returns that residual, so a caller can refuse a fit that did not converge.