Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

nurbs

This node represents a NURBS surface patch — a tensor-product spline defined by a grid of control points, two knot vectors, and an order in each parametric direction. It has the following required attributes:

NameTypeDefault
nuint

Control-point count along u. Total control-point count is nu * nv. Should be at least uorder; if smaller, the surface is rendered with order equal to nu.

NameTypeDefault
nvint

Control-point count along v. Same constraint as nu relative to vorder.

NameTypeDefault
uorderint

Order along u: degree + 1, so 2 is linear, 3 quadratic, 4 cubic. Must be at least 2. May differ from vorder.

NameTypeDefault
vorderint

Order along v. See uorder.

NameTypeDefault
uknotfloat

Knot vector along u. Length must equal nu + uorder. Values must be non-decreasing.

NameTypeDefault
vknotfloat

Knot vector along v. Length must equal nv + vorder. Values must be non-decreasing.

The surface’s active parameter range can be restricted with the optional umin/umax/vmin/vmax attributes. Unlike other geometric primitives, NURBS surfaces do not assume [0, 1] parameter ranges — by default, the active range is the full extent of the corresponding knot vector.

NameTypeDefault
uminfloat

Lower bound of the active range along u. Must be less than umax and at least the (uorder − 1)-th value of uknot.

NameTypeDefault
umaxfloat

Upper bound of the active range along u. Must be greater than umin and at most the nu-th value of uknot.

NameTypeDefault
vminfloat

Lower bound of the active range along v. Must be less than vmax and at least the (vorder − 1)-th value of vknot.

NameTypeDefault
vmaxfloat

Upper bound of the active range along v. Must be greater than vmin and at most the nv-th value of vknot.

One of P or Pw must be supplied to provide the control points. P defines a polynomial surface; Pw defines a rational one.

NameTypeDefault
Ppoint

The nu * nv control points (xyz), stored row-major: P[i*nu + j] is the point at row i, column j.

NameTypeDefault
Pwfloat[4]

Rational alternative to P: each control point is four floats (x, y, z, w), enabling rational NURBS. Pass as a single flat array of 4 * nu * nv floats — do not declare it with array_len(4).

Trim Curves

Trim curves carve a region out of the surface’s parameter domain. They are NURBS curves in homogeneous (u, v, w) parameter space — the actual (u, v) of a control point is (u/w, v/w). Curves are organised into loops: within a loop they connect head-to-tail. Each loop must be explicitly closed — the last point of the last curve must coincide with the first point of the first curve.

The trimcurves.* attributes are all-or-nothing: supply the full set or omit it entirely.

NameTypeDefault
trimcurves.nloopsint

The number of trim loops.

NameTypeDefault
trimcurves.ncurvesint

The number of curves in each loop. One value per loop.

NameTypeDefault
trimcurves.nint

The control-point count of each curve. One value per curve.

NameTypeDefault
trimcurves.orderint

The order of each curve. One value per curve.

NameTypeDefault
trimcurves.knotfloat

The concatenated knot vectors for all curves. The total length is the sum over curves of n[i] + order[i].

NameTypeDefault
trimcurves.minfloat

The parametric start of each curve. One value per curve.

NameTypeDefault
trimcurves.maxfloat

The parametric end of each curve. One value per curve.

NameTypeDefault
trimcurves.ufloat

Concatenated u coordinates of all trim-curve control points. The total length is the sum over curves of n[i].

NameTypeDefault
trimcurves.vfloat

Concatenated v coordinates of all trim-curve control points. The total length is the sum over curves of n[i].

NameTypeDefault
trimcurves.wfloat

Concatenated weights of all trim-curve control points. The total length is the sum over curves of n[i]. Use 1.0 for non-rational curves.

NameTypeDefault
trimcurves.senseint

The sense of each loop. One value per loop. A value of 0 keeps the surface inside the loop; a value of 1 keeps the surface outside the loop (i.e. the loop describes a hole).