nurbsSurface.insertKnot
The same surface with knot t inserted times times in one direction: more control rows or columns, the shape unchanged.
Usage
surface.insertKnot(dir: SurfaceDirection, t: number, times?: number): Result<NurbsSurface>Parameters
dirSurfaceDirectionThe direction: u runs along the rows, v along the columns. Required. One of
u,v.tnumberThe knot value, inside that direction’s domain.
timesnumberHow many copies to insert; a non-negative integer (fractions are truncated, 0 is a no-op). Default
1. In count.
Returns
Ok with a surface of rows + times rows (u) or cols + times columns (v).
Errors
Guarantees
- rows (u) or cols (v) grows by times
- result.pointAt(u, v) is within 1e-12 of pointAt(u, v) everywhere
- The same result on every machine.
Example
const s = NurbsSurface.create([[Point3.of(0, 0, 0), Point3.of(0, 2, 0)], [Point3.of(3, 0, 0), Point3.of(3, 2, 0)]], 1, 1).value
const r = s.insertKnot('v', 0.3) // → 3 columns, same shape, once loadGeometryKernel() has run