nurbsSurface.toJSON
The surface as plain JSON: degrees, net size, row-major control points, weights and both knot vectors.
Usage
surface.toJSON(): { degreeU: number; degreeV: number; rows: number; cols: number; points: number[]; weights: number[]; knotsU: number[]; knotsV: number[] }Returns
Plain arrays: points row-major (point (i, j) at 3 · (i · cols + j)), weights in the same order, knots in knot units.
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.toJSON().knotsU // → [0, 0, 1, 1]