nurbsCurve.elevateDegree

The same curve at degree + times, with the control points that shape needs.

GeometricSince 0.4.0

Usage

TypeScript
curve.elevateDegree(times?: number): Result<NurbsCurve>

Parameters

  • timesnumber

    How many degrees to add; a non-negative integer (fractions are truncated, 0 is a no-op). Default 1. In count.

Returns

Ok with a curve of degree + times and the same domain and shape; every knot’s multiplicity grows by times.

Errors

Guarantees

  • result.degree === degree + times
  • result.pointAt(s) is within 1e-12 of pointAt(s) for every s
  • The same result on every machine.

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
const r = q.elevateDegree() // → degree 3, 4 control points, once loadGeometryKernel() has run

See also