fit_bspline_curve — 3D freeform op

• Data kinds: points → bspline_curve

• Call: import fullseye as fs; fs.ledger.fit_bspline_curve(points, smooth=0.0, k=3, nest=None) (to call the implementation directly, import bspline_surf; bspline_surf.fit_bspline_curve(points, smooth=0.0, k=3, nest=None); from the registry, ops3d.get("fit_bspline_curve"))

Usage

Fit a B-spline curve to an ordered point sequence (M,D) (splprep, parametric).

Reconstructs a point sequence whose "order is meaningful", such as a seam, an edge or a measurement-probe trajectory, as a smooth parametric curve r(u), u∈[0,1]. Unlike z=f(x,y), it can also represent multi-valued shapes (fold-backs, loops).

Parameters

points : array_like, shape (M, D)

Ordered vertices. D=3 is typical (3D curve), but 2D or more is allowed.

smooth : float

Smoothing factor s. 0.0 passes through all points (interpolation); larger is smoother.

k : int

Degree (default 3=cubic). If the point count is less than k+1 it is lowered automatically.

nest : int or None

Upper limit on the number of knots (passed through to splprep). None means automatic.

Returns

tck : tuple

(t, c, k). Pass to eval_bspline_curve.

Raises

ValueError

If there are fewer than 2 points, inconsistent dimensions, non-finite values, or splprep cannot

return a curve due to duplicates/degeneracy.

Notes:

• The default smooth=0.0 interpolates (passes through all points). This differs from the surface-side default (automatic value from the point count), so give smooth explicitly for noisy point sequences. The parameter u is splprep's default (proportional to chord length, normalised to [0,1]).

• The degree k is silently lowered to m-1 when k >= m (a straight line for 2 points).

• Consecutive duplicate points make splprep fail with ValueError. Remove duplicates beforehand or equalise the spacing with resample_uniform.

• The returned tck is a list [t, c, k] (c is a list of D coefficient arrays). Pass it to eval_bspline_curve. It is not treated as a closed curve (the end points stay open).

• Deterministic (no randomness).

References (sample data, literature)

• 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.

Runnable examples (verified samples that actually call this op)

• bspline_freeform — py -3.11 examples_3d/bspline_freeform.py

Ops the type connects to (they accept bspline_curve as input)

fuse_to_voxel · eval_bspline_curve

Same category (freeform)

fit_bspline_surface · eval_bspline_surface · surface_residual · eval_bspline_curve


*Provenance: bspline_surf.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.