Experimental
The input bicubic NURBS surface.
A 2D array pieces[i][j] of rational bicubic Bezier
patches, with i indexing the u-direction Bezier strip
and j indexing the v-direction within that strip.
Adjacent patches share an edge: the v-direction control
row at the seam of pieces[i][j] and pieces[i + 1][j]
carry the same four 3D points (and vice versa for u-seams).
Decompose a bicubic NURBS surface into a 2D grid of rational bicubic Bezier patches via tensor-product knot insertion (Piegl & Tiller §5.6, tensor form).
Algorithm:
H_{i,j} = (w_{i,j} P_{i,j}, w_{i,j}).(p - s)more times intoknotsU. Each insertion is the standard 1D update applied to every v-column in parallel — the α coefficients depend only onknotsU, so columns share the same convex combinations. After this pass, every internal u-knot has multiplicityp_u = 3and the net's u-extent grew accordingly.(p - s)times applied to every u-row in parallel.numPiecesU × numPiecesVblocks of 4×4 controls each. Project each block back to 3D to form aRationalBezierBicubicPatch.