Skip to content

NURBS

B-splines — rational ones are NURBS — are the freeform half of the kernel: BSplineCurve and BSplineSurface, built from a degree, control poles, a knot vector and optional weights. Where Elementary covers the ten closed forms, this module covers everything else. The math foundations below are adapted from The mathematics behind free-form geometry; the API pages are Curves, Surfaces and Editing & fitting.

From Bézier to B-spline

A Bézier curve stores control points instead of polynomial coefficients, and evaluates them with the de Casteljau algorithm — repeated linear interpolation, one level per degree.

De Casteljau evaluation
De Casteljau at two fifths: the point is found by interpolating the polygon down to one point.

The blending behind it is the Bernstein basis — one hump per control point:

Quadratic basis functions
The quadratic basis: each function weighs one control point, and they sum to one everywhere.

A B-spline generalises this to several spans: piecewise polynomials joined at knots. Knot multiplicity steers continuity — a simple knot is smooth, a full-multiplicity knot is a hard corner and a place the curve can be split:

Knot multiplicity and continuity
Knot multiplicity and continuity: repeating a knot sharpens the joint up to a corner.

Moving one control point only moves the spans it touches — editing is local:

Moving one control point
Local control: one pole moves its neighbourhood, the rest of the curve keeps its shape bit for bit.

The same holds on a surface: a pole of a bicubic patch moves only the cells it supports — here 3 × 2 of the 4 × 3 spans — and the rest stays flat.

A surface and one raised point
Raising P₄,₄ moves only u in [¼, 1) by v in [⅓, 1); the rest of the patch keeps its shape.
A bicubic B-spline surface with one raised control point and its control netOpen in a new tab ↗

Rational curves

Give each pole a weight and the curve is pulled toward the heavy ones. With the right weights a quadratic reproduces the circle exactly — this is why the conics of the previous chapter convert losslessly with to_bspline, and why NURBS, not plain B-splines, are the interchange workhorse.

Weights make conics
Weights make conics: a rational quadratic is an exact circle arc, not an approximation.

Inserting a knot refines the control polygon without changing the shape — the operation behind refinement, splitting and extraction in Editing & fitting:

Inserting a knot
Inserting a knot: more poles, same curve — the shape is untouched, only its description grows.

In geomcore

  • Poles are stored Cartesian, once, with a separate weight per pole when rational — no second homogeneous copy (ADR 0008). Evaluation, editing and projection all read them in place.
  • Every curve or surface is either elementary or a B-spline — there is no third representation, and exact conversions bridge the two.
  • The running example below is the geomdl tutorial curve as a clamped degree-2 B-spline. The viewer evaluates B-splines in the page with de Boor, so the display refines as you zoom.
Quadratic B-spline with control polygonOpen in a new tab ↗

This module

  • Curves — create, evaluate, sample with proven bounds.
  • Surfaces — patches, evaluation, fitting grids.
  • Editing & fitting — knots, degree, splitting, interpolation, approximation, exact conversions, measure and bound.