nurbsSurface.transformed

The surface with an affine transform applied to its control points, weights and knots kept.

GeometricSince 0.4.0

Usage

TypeScript
surface.transformed(xf: Transform): Result<NurbsSurface>

Parameters

  • xfTransform

    An affine transform (last row 0 0 0 1), column-major.

    Required

Returns

Ok with the transformed surface, same degrees, weights and knots.

Errors

Guarantees

  • pointAt(u, v) of the result = Transform.applyToPoint(xf, pointAt(u, v)) for every (u, v)
  • 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
s.transformed(Transform.translation(Vector3.of(0, 0, 1))).value.pointAt(0, 0) // → { x: 0, y: 0, z: 1 }

See also