nurbsSurface.transformed
The surface with an affine transform applied to its control points, weights and knots kept.
Usage
surface.transformed(xf: Transform): Result<NurbsSurface>Parameters
xfTransformAn affine transform (last row 0 0 0 1), column-major.
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
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 }