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:
| Name | Type | Default |
|---|---|---|
nu | int |
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.
| Name | Type | Default |
|---|---|---|
nv | int |
Control-point count along v. Same constraint as nu relative to vorder.
| Name | Type | Default |
|---|---|---|
uorder | int |
Order along u: degree + 1, so 2 is linear, 3 quadratic, 4 cubic. Must be at least 2. May differ from vorder.
| Name | Type | Default |
|---|---|---|
vorder | int |
Order along v. See uorder.
| Name | Type | Default |
|---|---|---|
uknot | float |
Knot vector along u. Length must equal nu + uorder. Values must be non-decreasing.
| Name | Type | Default |
|---|---|---|
vknot | float |
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.
| Name | Type | Default |
|---|---|---|
umin | float |
Lower bound of the active range along u. Must be less than umax and at least the (uorder − 1)-th value of uknot.
| Name | Type | Default |
|---|---|---|
umax | float |
Upper bound of the active range along u. Must be greater than umin and at most the nu-th value of uknot.
| Name | Type | Default |
|---|---|---|
vmin | float |
Lower bound of the active range along v. Must be less than vmax and at least the (vorder − 1)-th value of vknot.
| Name | Type | Default |
|---|---|---|
vmax | float |
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.
| Name | Type | Default |
|---|---|---|
P | point |
The nu * nv control points (xyz), stored row-major: P[i*nu + j] is the point at row i, column j.
| Name | Type | Default |
|---|---|---|
Pw | float[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.
| Name | Type | Default |
|---|---|---|
trimcurves.nloops | int |
The number of trim loops.
| Name | Type | Default |
|---|---|---|
trimcurves.ncurves | int |
The number of curves in each loop. One value per loop.
| Name | Type | Default |
|---|---|---|
trimcurves.n | int |
The control-point count of each curve. One value per curve.
| Name | Type | Default |
|---|---|---|
trimcurves.order | int |
The order of each curve. One value per curve.
| Name | Type | Default |
|---|---|---|
trimcurves.knot | float |
The concatenated knot vectors for all curves. The total length is the sum over curves of n[i] + order[i].
| Name | Type | Default |
|---|---|---|
trimcurves.min | float |
The parametric start of each curve. One value per curve.
| Name | Type | Default |
|---|---|---|
trimcurves.max | float |
The parametric end of each curve. One value per curve.
| Name | Type | Default |
|---|---|---|
trimcurves.u | float |
Concatenated u coordinates of all trim-curve control points. The total length is the sum over curves of n[i].
| Name | Type | Default |
|---|---|---|
trimcurves.v | float |
Concatenated v coordinates of all trim-curve control points. The total length is the sum over curves of n[i].
| Name | Type | Default |
|---|---|---|
trimcurves.w | float |
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.
| Name | Type | Default |
|---|---|---|
trimcurves.sense | int |
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).