surface_fit op• Data kinds: image2d × image2d × image2d → poly_surface
• Call: import fullseye as fs; fs.ledger.fit_poly_surface(x, y, z, degree=2) (to call the implementation directly, import match3d; match3d.fit_poly_surface(x, y, z, degree=2); from the registry, ops3d.get("fit_poly_surface"))
Scattered (x,y,z) → a polynomial least-squares z=f(x,y). Returns model (coef/powers/degree/rms/pv).
Fits the basis {x^i·y^j : i + j <= degree} (number of terms (degree+1)(degree+2)/2; degree=1 gives a 3-term plane, 2 a 6-term 2nd-order surface) with lstsq. x, y, z may have any shape as long as they have the same number of elements (raveled internally; for a grid, pass the output of np.mgrid as is). Return dict: coef (T,) coefficients, powers the (i, j) of each coefficient (term x**i * y**j), degree, rms the residual RMS, pv the residual peak-to-valley (max − min). Units are those of z.
• With fewer points than terms, the minimum-norm solution is returned silently. Large magnitudes of x, y make high orders ill-conditioned
(centre and normalise the coordinates first). No NaN check.
Downstream: evaluate at arbitrary points with eval_poly_surface(model, x, y). For a height field on a grid, surface_form_error / background_flatten call this internally.
• blas_threads_and_memory — Why matrix decompositions are slow — BLAS threads, caches, memory layout
• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).
• Operator provenance and references — the sources of the research/methods this op family came from.
• contours_to_terrain — py -3.11 examples_3d/contours_to_terrain.py
poly_surface as input)fuse_to_voxel · eval_poly_surface
surface_fit)eval_poly_surface · surface_form_error · background_flatten
*Provenance: match3d.py — 3D operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.