nurbsSurface.removeKnot

The surface with up to times copies of knot t removed in one direction, within tolerance × the net’s extent.

GeometricSince 0.4.0

Usage

TypeScript
surface.removeKnot(dir: SurfaceDirection, t: number, times?: number, tolerance?: number): Result<NurbsSurface>

Parameters

  • dirSurfaceDirection

    The direction: u runs along the rows, v along the columns. Required. One of u, v.

  • tnumber

    An interior knot of that direction’s vector.

    Required

  • timesnumber

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

  • tolerancenumber

    How far the shape may move, as a fraction of the control net’s bounding-box diagonal; finite and ≥ 0. Default 1e-9. In normalised.

Returns

Ok with the surface after the removals that stayed within tolerance — possibly fewer than times, possibly none. Compare rows (u) or cols (v) before and after to see how many came out.

Errors

Guarantees

  • rows or cols shrinks by the number removed, 0 … times
  • result.pointAt is within tolerance × the net’s bounding-box diagonal of pointAt everywhere
  • The same result on every machine.

Example

TypeScript
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.removeKnot('u', 0.5) // → GEOMETRY_OP_FAILED (NotAKnot) once loadGeometryKernel() has run

See also