nurbsCurve.sample

Points at evenly spaced knot parameters along the whole curve, both ends included.

Value helperSince 0.4.0

Usage

TypeScript
curve.sample(segments: number): Point3[]

Parameters

  • segmentsnumber

    Number of intervals; floored and clamped to 1 … 4096. Required. Range [1, 4096] count.

Returns

segments + 1 points from pointAt(domain.t0) to pointAt(domain.t1); [] when segments is NaN.

Example

TypeScript
const q = NurbsCurve.create([Point3.of(1, 0, 0), Point3.of(1, 1, 0), Point3.of(0, 1, 0)], 2, { weights: [1, Math.SQRT1_2, 1], knots: [0, 0, 0, 1, 1, 1] }).value
q.sample(4).length // → 5

See also