okgeometry-api 0.2.12 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Arc.d.ts +52 -2
- package/dist/Arc.d.ts.map +1 -1
- package/dist/Arc.js +50 -1
- package/dist/Arc.js.map +1 -1
- package/dist/BufferCodec.d.ts +118 -0
- package/dist/BufferCodec.d.ts.map +1 -0
- package/dist/BufferCodec.js +171 -0
- package/dist/BufferCodec.js.map +1 -0
- package/dist/Circle.d.ts +66 -12
- package/dist/Circle.d.ts.map +1 -1
- package/dist/Circle.js +64 -8
- package/dist/Circle.js.map +1 -1
- package/dist/Line.d.ts +53 -1
- package/dist/Line.d.ts.map +1 -1
- package/dist/Line.js +51 -0
- package/dist/Line.js.map +1 -1
- package/dist/Mesh.d.ts +167 -20
- package/dist/Mesh.d.ts.map +1 -1
- package/dist/Mesh.js +187 -70
- package/dist/Mesh.js.map +1 -1
- package/dist/NurbsCurve.d.ts +78 -8
- package/dist/NurbsCurve.d.ts.map +1 -1
- package/dist/NurbsCurve.js +76 -7
- package/dist/NurbsCurve.js.map +1 -1
- package/dist/NurbsSurface.d.ts +64 -14
- package/dist/NurbsSurface.d.ts.map +1 -1
- package/dist/NurbsSurface.js +65 -25
- package/dist/NurbsSurface.js.map +1 -1
- package/dist/Point.d.ts +65 -12
- package/dist/Point.d.ts.map +1 -1
- package/dist/Point.js +61 -2
- package/dist/Point.js.map +1 -1
- package/dist/PolyCurve.d.ts +4 -6
- package/dist/PolyCurve.d.ts.map +1 -1
- package/dist/PolyCurve.js +31 -16
- package/dist/PolyCurve.js.map +1 -1
- package/dist/Polygon.d.ts +35 -3
- package/dist/Polygon.d.ts.map +1 -1
- package/dist/Polygon.js +33 -2
- package/dist/Polygon.js.map +1 -1
- package/dist/Polyline.d.ts +67 -2
- package/dist/Polyline.d.ts.map +1 -1
- package/dist/Polyline.js +86 -13
- package/dist/Polyline.js.map +1 -1
- package/dist/Ray.d.ts +45 -0
- package/dist/Ray.d.ts.map +1 -0
- package/dist/Ray.js +68 -0
- package/dist/Ray.js.map +1 -0
- package/dist/Vec3.d.ts +76 -0
- package/dist/Vec3.d.ts.map +1 -1
- package/dist/Vec3.js +76 -0
- package/dist/Vec3.js.map +1 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +3 -2
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +67 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/wasm-base64.d.ts +1 -1
- package/dist/wasm-base64.d.ts.map +1 -1
- package/dist/wasm-base64.js +1 -1
- package/dist/wasm-base64.js.map +1 -1
- package/package.json +1 -1
- package/wasm/okgeometrycore.d.ts +27 -0
- package/wasm/okgeometrycore.js +1 -1
- package/wasm/okgeometrycore_bg.js +81 -0
- package/wasm/okgeometrycore_bg.wasm +0 -0
- package/wasm/okgeometrycore_bg.wasm.d.ts +4 -0
package/dist/NurbsCurve.js
CHANGED
|
@@ -3,10 +3,19 @@ import { Point } from "./Point.js";
|
|
|
3
3
|
import { Polyline } from "./Polyline.js";
|
|
4
4
|
import * as wasm from "../wasm/okgeometrycore_bg.js";
|
|
5
5
|
/**
|
|
6
|
-
* NURBS curve backed by WASM.
|
|
7
|
-
*
|
|
6
|
+
* Non-Uniform Rational B-Spline (NURBS) curve backed by WASM.
|
|
7
|
+
* Provides exact representation for complex curves including conics.
|
|
8
|
+
*
|
|
9
|
+
* WASM data format: [degree, num_pts, x0,y0,z0, ..., w0,w1,..., k0,k1,...]
|
|
8
10
|
*/
|
|
9
11
|
export class NurbsCurve {
|
|
12
|
+
/**
|
|
13
|
+
* Create a new NURBS curve.
|
|
14
|
+
* @param degree - Polynomial degree (1 = linear, 2 = quadratic, 3 = cubic)
|
|
15
|
+
* @param controlPoints - Control points defining the curve shape
|
|
16
|
+
* @param weights - Rational weights for each control point (use 1 for non-rational)
|
|
17
|
+
* @param knots - Knot vector (length = num_points + degree + 1)
|
|
18
|
+
*/
|
|
10
19
|
constructor(degree, controlPoints, weights, knots) {
|
|
11
20
|
this.degree = degree;
|
|
12
21
|
this.controlPoints = controlPoints;
|
|
@@ -14,12 +23,21 @@ export class NurbsCurve {
|
|
|
14
23
|
this.knots = knots;
|
|
15
24
|
this._data = NurbsCurve.encode(degree, controlPoints, weights, knots);
|
|
16
25
|
}
|
|
17
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Evaluate a point on the curve at normalized parameter t.
|
|
28
|
+
* @param t - Parameter in [0, 1] (0 = start, 1 = end)
|
|
29
|
+
* @returns Point on curve at parameter t
|
|
30
|
+
*/
|
|
18
31
|
pointAt(t) {
|
|
19
32
|
ensureInit();
|
|
20
33
|
const r = wasm.evaluate_nurbs_curve_at(this._data, t);
|
|
21
34
|
return new Point(r[0], r[1], r[2]);
|
|
22
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Sample the curve into evenly-spaced points.
|
|
38
|
+
* @param n - Number of points to generate
|
|
39
|
+
* @returns Array of n points along the curve
|
|
40
|
+
*/
|
|
23
41
|
sample(n) {
|
|
24
42
|
ensureInit();
|
|
25
43
|
const buf = wasm.sample_nurbs_curve(this._data, n);
|
|
@@ -29,6 +47,11 @@ export class NurbsCurve {
|
|
|
29
47
|
}
|
|
30
48
|
return pts;
|
|
31
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Find intersection points with a plane.
|
|
52
|
+
* @param plane - Cutting plane
|
|
53
|
+
* @returns Array of intersection points
|
|
54
|
+
*/
|
|
32
55
|
intersectPlane(plane) {
|
|
33
56
|
ensureInit();
|
|
34
57
|
const buf = wasm.nurbs_curve_plane_intersect(this._data, plane.normal.x, plane.normal.y, plane.normal.z, plane.d);
|
|
@@ -42,6 +65,11 @@ export class NurbsCurve {
|
|
|
42
65
|
}
|
|
43
66
|
return pts;
|
|
44
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Find intersection points with another NURBS curve.
|
|
70
|
+
* @param other - Other curve to intersect with
|
|
71
|
+
* @returns Array of intersection points
|
|
72
|
+
*/
|
|
45
73
|
intersectCurve(other) {
|
|
46
74
|
ensureInit();
|
|
47
75
|
const buf = wasm.nurbs_curve_curve_intersect(this._data, other._data);
|
|
@@ -55,22 +83,51 @@ export class NurbsCurve {
|
|
|
55
83
|
}
|
|
56
84
|
return pts;
|
|
57
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Translate this curve by an offset vector.
|
|
88
|
+
* @param offset - Translation vector
|
|
89
|
+
* @returns New translated curve
|
|
90
|
+
*/
|
|
58
91
|
translate(offset) {
|
|
59
92
|
return new NurbsCurve(this.degree, this.controlPoints.map(p => p.add(offset)), this.weights, this.knots);
|
|
60
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Rotate this curve around an axis.
|
|
96
|
+
* @param axis - Rotation axis (Vec3 through origin, or Line for arbitrary axis)
|
|
97
|
+
* @param angle - Rotation angle in radians
|
|
98
|
+
* @returns New rotated curve
|
|
99
|
+
*/
|
|
61
100
|
rotate(axis, angle) {
|
|
62
101
|
return new NurbsCurve(this.degree, this.controlPoints.map(p => p.rotate(axis, angle)), this.weights, this.knots);
|
|
63
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Project this curve onto a plane.
|
|
105
|
+
* @param plane - Target plane
|
|
106
|
+
* @param direction - Optional projection direction (default: perpendicular to plane)
|
|
107
|
+
* @returns New projected curve
|
|
108
|
+
*/
|
|
64
109
|
projectOntoPlane(plane, direction) {
|
|
65
110
|
const proj = (p) => direction ? plane.projectPointAlongDirection(p, direction) : plane.projectPoint(p);
|
|
66
111
|
return new NurbsCurve(this.degree, this.controlPoints.map(proj), this.weights, this.knots);
|
|
67
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Offset this curve by a distance.
|
|
115
|
+
* Note: NURBS offset is approximated by sampling and offsetting as polyline.
|
|
116
|
+
* @param distance - Offset distance
|
|
117
|
+
* @param normal - Reference normal for determining offset direction
|
|
118
|
+
* @param samples - Number of sample points (default 64)
|
|
119
|
+
* @returns Offset polyline approximation
|
|
120
|
+
*/
|
|
68
121
|
offset(distance, normal, samples = 64) {
|
|
69
122
|
const pts = this.sample(samples);
|
|
70
123
|
const pl = new Polyline(pts);
|
|
71
124
|
return pl.offset(distance, normal);
|
|
72
125
|
}
|
|
73
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* Decode a NurbsCurve from WASM flat buffer.
|
|
128
|
+
* @param data - Buffer in format [degree, num_cp, xyz..., w..., k...]
|
|
129
|
+
* @returns New NurbsCurve instance
|
|
130
|
+
*/
|
|
74
131
|
static fromData(data) {
|
|
75
132
|
const d = data instanceof Float64Array ? data : new Float64Array(data);
|
|
76
133
|
const degree = d[0];
|
|
@@ -87,11 +144,20 @@ export class NurbsCurve {
|
|
|
87
144
|
const knots = Array.from(d.slice(idx, idx + numKnots));
|
|
88
145
|
return new NurbsCurve(degree, pts, weights, knots);
|
|
89
146
|
}
|
|
90
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* Create exact degree-1 NURBS from a Line.
|
|
149
|
+
* @param line - Source line
|
|
150
|
+
* @returns Degree-1 NURBS representing the line exactly
|
|
151
|
+
*/
|
|
91
152
|
static fromLine(line) {
|
|
92
153
|
return new NurbsCurve(1, [line.start, line.end], [1, 1], [0, 0, 1, 1]);
|
|
93
154
|
}
|
|
94
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* Create exact degree-2 rational NURBS from an Arc.
|
|
157
|
+
* Uses WASM circle_arc for exact conic representation.
|
|
158
|
+
* @param arc - Source arc
|
|
159
|
+
* @returns Degree-2 rational NURBS representing the arc exactly
|
|
160
|
+
*/
|
|
95
161
|
static fromArc(arc) {
|
|
96
162
|
ensureInit();
|
|
97
163
|
const buf = wasm.polycurve_to_nurbs(new Float64Array([
|
|
@@ -105,7 +171,10 @@ export class NurbsCurve {
|
|
|
105
171
|
throw new Error("Failed to convert Arc to NURBS");
|
|
106
172
|
return NurbsCurve.fromData(buf);
|
|
107
173
|
}
|
|
108
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* Get internal WASM data buffer.
|
|
176
|
+
* For advanced use cases requiring direct WASM interop.
|
|
177
|
+
*/
|
|
109
178
|
get data() {
|
|
110
179
|
return this._data;
|
|
111
180
|
}
|
package/dist/NurbsCurve.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NurbsCurve.js","sourceRoot":"","sources":["../src/NurbsCurve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"NurbsCurve.js","sourceRoot":"","sources":["../src/NurbsCurve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAKzC,OAAO,KAAK,IAAI,MAAM,8BAA8B,CAAC;AAErD;;;;;GAKG;AACH,MAAM,OAAO,UAAU;IAGrB;;;;;;OAMG;IACH,YACkB,MAAc,EACd,aAAsB,EACtB,OAAiB,EACjB,KAAe;QAHf,WAAM,GAAN,MAAM,CAAQ;QACd,kBAAa,GAAb,aAAa,CAAS;QACtB,YAAO,GAAP,OAAO,CAAU;QACjB,UAAK,GAAL,KAAK,CAAU;QAE/B,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACxE,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAC,CAAS;QACf,UAAU,EAAE,CAAC;QACb,MAAM,C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AC,CAAC;YAClB,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,OAAO;YAAE,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QACzC,KAAK,MAAM,CAAC,IAAI,KAAK;YAAE,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
package/dist/NurbsSurface.d.ts
CHANGED
|
@@ -3,16 +3,12 @@ import { Vec3 } from "./Vec3.js";
|
|
|
3
3
|
import { Plane } from "./Plane.js";
|
|
4
4
|
import { Mesh } from "./Mesh.js";
|
|
5
5
|
import { Polyline } from "./Polyline.js";
|
|
6
|
-
import {
|
|
7
|
-
import { Line } from "./Line.js";
|
|
8
|
-
import { Arc } from "./Arc.js";
|
|
9
|
-
import { PolyCurve } from "./PolyCurve.js";
|
|
10
|
-
import { NurbsCurve } from "./NurbsCurve.js";
|
|
11
|
-
/** Any curve type that loftCurves can accept */
|
|
12
|
-
export type LoftableCurve = NurbsCurve | PolyCurve | Polyline | Polygon | Arc | Line;
|
|
6
|
+
import type { LoftableCurve, RotationAxis } from "./types.js";
|
|
13
7
|
/**
|
|
14
|
-
* NURBS surface backed by WASM.
|
|
15
|
-
*
|
|
8
|
+
* Non-Uniform Rational B-Spline (NURBS) surface backed by WASM.
|
|
9
|
+
* Tensor-product surface defined by a 2D grid of control points.
|
|
10
|
+
*
|
|
11
|
+
* WASM data format: [degree_u, degree_v, num_u, num_v, ...cp(flat)..., ...weights..., ...knots_u..., ...knots_v...]
|
|
16
12
|
*/
|
|
17
13
|
export declare class NurbsSurface {
|
|
18
14
|
readonly degreeU: number;
|
|
@@ -22,20 +18,74 @@ export declare class NurbsSurface {
|
|
|
22
18
|
readonly knotsU: number[];
|
|
23
19
|
readonly knotsV: number[];
|
|
24
20
|
private _data;
|
|
21
|
+
/**
|
|
22
|
+
* Create a new NURBS surface.
|
|
23
|
+
* @param degreeU - Polynomial degree in U direction
|
|
24
|
+
* @param degreeV - Polynomial degree in V direction
|
|
25
|
+
* @param controlPoints - 2D grid of control points [u][v]
|
|
26
|
+
* @param weights - 2D grid of weights corresponding to control points
|
|
27
|
+
* @param knotsU - Knot vector in U direction
|
|
28
|
+
* @param knotsV - Knot vector in V direction
|
|
29
|
+
*/
|
|
25
30
|
constructor(degreeU: number, degreeV: number, controlPoints: Point[][], weights: number[][], knotsU: number[], knotsV: number[]);
|
|
26
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Rotate this surface around an axis.
|
|
33
|
+
* @param axis - Rotation axis (Vec3 through origin, or Line for arbitrary axis)
|
|
34
|
+
* @param angle - Rotation angle in radians
|
|
35
|
+
* @returns New rotated surface
|
|
36
|
+
*/
|
|
37
|
+
rotate(axis: RotationAxis, angle: number): NurbsSurface;
|
|
38
|
+
/**
|
|
39
|
+
* Translate this surface by an offset vector.
|
|
40
|
+
* @param offset - Translation vector
|
|
41
|
+
* @returns New translated surface
|
|
42
|
+
*/
|
|
27
43
|
translate(offset: Vec3): NurbsSurface;
|
|
44
|
+
/**
|
|
45
|
+
* Evaluate a point on the surface at parameters (u, v).
|
|
46
|
+
* @param u - Parameter in U direction [0, 1]
|
|
47
|
+
* @param v - Parameter in V direction [0, 1]
|
|
48
|
+
* @returns Point on surface at (u, v)
|
|
49
|
+
*/
|
|
28
50
|
evaluate(u: number, v: number): Point;
|
|
51
|
+
/**
|
|
52
|
+
* Tessellate this surface into a triangle mesh.
|
|
53
|
+
* @param uSegs - Number of segments in U direction
|
|
54
|
+
* @param vSegs - Number of segments in V direction
|
|
55
|
+
* @returns Mesh approximating the surface
|
|
56
|
+
*/
|
|
29
57
|
tessellate(uSegs: number, vSegs: number): Mesh;
|
|
58
|
+
/**
|
|
59
|
+
* Find intersection curves with a plane.
|
|
60
|
+
* @param plane - Cutting plane
|
|
61
|
+
* @param tess - Tessellation resolution for intersection detection (default 20)
|
|
62
|
+
* @returns Array of polylines representing intersection curves
|
|
63
|
+
*/
|
|
30
64
|
intersectPlane(plane: Plane, tess?: number): Polyline[];
|
|
65
|
+
/**
|
|
66
|
+
* Find intersection curves with another NURBS surface.
|
|
67
|
+
* @param other - Other surface to intersect with
|
|
68
|
+
* @param tess - Tessellation resolution for intersection detection (default 20)
|
|
69
|
+
* @returns Array of polylines representing intersection curves
|
|
70
|
+
*/
|
|
31
71
|
intersectSurface(other: NurbsSurface, tess?: number): Polyline[];
|
|
32
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Convert any supported curve type to a NurbsCurve.
|
|
74
|
+
* @param c - Curve to convert
|
|
75
|
+
* @returns NurbsCurve representation
|
|
76
|
+
*/
|
|
33
77
|
private static toNurbs;
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
78
|
+
/**
|
|
79
|
+
* Loft a NURBS surface through multiple curves.
|
|
80
|
+
* Accepts NurbsCurve, PolyCurve, Polyline, Polygon, Arc, or Line.
|
|
81
|
+
* Automatically converts to NURBS and unifies knot vectors.
|
|
82
|
+
*
|
|
83
|
+
* @param curves - Array of curves to loft through (minimum 2)
|
|
84
|
+
* @param degreeV - Polynomial degree in the loft direction (default 3)
|
|
85
|
+
* @returns New NurbsSurface passing through all input curves
|
|
37
86
|
*/
|
|
38
87
|
static loftCurves(curves: LoftableCurve[], degreeV?: number): NurbsSurface;
|
|
88
|
+
/** Encode to WASM format */
|
|
39
89
|
private static encode;
|
|
40
90
|
}
|
|
41
91
|
//# sourceMappingURL=NurbsSurface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NurbsSurface.d.ts","sourceRoot":"","sources":["../src/NurbsSurface.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CA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E,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAS9C;;;;;OAKG;IACH,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,SAAK,GAAG,QAAQ,EAAE;IAWnD;;;;;OAKG;IACH,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,SAAK,GAAG,QAAQ,EAAE;IAM5D;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,OAAO;IAStB;;;;;;;;OAQG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE,OAAO,SAAI,GAAG,YAAY;IA0ErE,4BAA4B;IAC5B,OAAO,CAAC,MAAM,CAAC,MAAM;CAkCtB"}
|
package/dist/NurbsSurface.js
CHANGED
|
@@ -7,12 +7,24 @@ import { Line } from "./Line.js";
|
|
|
7
7
|
import { Arc } from "./Arc.js";
|
|
8
8
|
import { PolyCurve } from "./PolyCurve.js";
|
|
9
9
|
import { NurbsCurve } from "./NurbsCurve.js";
|
|
10
|
+
import { parsePolylineBuffer as parsePolylineBuf } from "./BufferCodec.js";
|
|
10
11
|
import * as wasm from "../wasm/okgeometrycore_bg.js";
|
|
11
12
|
/**
|
|
12
|
-
* NURBS surface backed by WASM.
|
|
13
|
-
*
|
|
13
|
+
* Non-Uniform Rational B-Spline (NURBS) surface backed by WASM.
|
|
14
|
+
* Tensor-product surface defined by a 2D grid of control points.
|
|
15
|
+
*
|
|
16
|
+
* WASM data format: [degree_u, degree_v, num_u, num_v, ...cp(flat)..., ...weights..., ...knots_u..., ...knots_v...]
|
|
14
17
|
*/
|
|
15
18
|
export class NurbsSurface {
|
|
19
|
+
/**
|
|
20
|
+
* Create a new NURBS surface.
|
|
21
|
+
* @param degreeU - Polynomial degree in U direction
|
|
22
|
+
* @param degreeV - Polynomial degree in V direction
|
|
23
|
+
* @param controlPoints - 2D grid of control points [u][v]
|
|
24
|
+
* @param weights - 2D grid of weights corresponding to control points
|
|
25
|
+
* @param knotsU - Knot vector in U direction
|
|
26
|
+
* @param knotsV - Knot vector in V direction
|
|
27
|
+
*/
|
|
16
28
|
constructor(degreeU, degreeV, controlPoints, weights, knotsU, knotsV) {
|
|
17
29
|
this.degreeU = degreeU;
|
|
18
30
|
this.degreeV = degreeV;
|
|
@@ -22,18 +34,41 @@ export class NurbsSurface {
|
|
|
22
34
|
this.knotsV = knotsV;
|
|
23
35
|
this._data = NurbsSurface.encode(degreeU, degreeV, controlPoints, weights, knotsU, knotsV);
|
|
24
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Rotate this surface around an axis.
|
|
39
|
+
* @param axis - Rotation axis (Vec3 through origin, or Line for arbitrary axis)
|
|
40
|
+
* @param angle - Rotation angle in radians
|
|
41
|
+
* @returns New rotated surface
|
|
42
|
+
*/
|
|
25
43
|
rotate(axis, angle) {
|
|
26
44
|
return new NurbsSurface(this.degreeU, this.degreeV, this.controlPoints.map(row => row.map(p => p.rotate(axis, angle))), this.weights, this.knotsU, this.knotsV);
|
|
27
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Translate this surface by an offset vector.
|
|
48
|
+
* @param offset - Translation vector
|
|
49
|
+
* @returns New translated surface
|
|
50
|
+
*/
|
|
28
51
|
translate(offset) {
|
|
29
52
|
const newCps = this.controlPoints.map(row => row.map(p => p.add(offset)));
|
|
30
53
|
return new NurbsSurface(this.degreeU, this.degreeV, newCps, this.weights, this.knotsU, this.knotsV);
|
|
31
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Evaluate a point on the surface at parameters (u, v).
|
|
57
|
+
* @param u - Parameter in U direction [0, 1]
|
|
58
|
+
* @param v - Parameter in V direction [0, 1]
|
|
59
|
+
* @returns Point on surface at (u, v)
|
|
60
|
+
*/
|
|
32
61
|
evaluate(u, v) {
|
|
33
62
|
ensureInit();
|
|
34
63
|
const r = wasm.nurbs_surface_evaluate(this._data, u, v);
|
|
35
64
|
return new Point(r[0], r[1], r[2]);
|
|
36
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Tessellate this surface into a triangle mesh.
|
|
68
|
+
* @param uSegs - Number of segments in U direction
|
|
69
|
+
* @param vSegs - Number of segments in V direction
|
|
70
|
+
* @returns Mesh approximating the surface
|
|
71
|
+
*/
|
|
37
72
|
tessellate(uSegs, vSegs) {
|
|
38
73
|
ensureInit();
|
|
39
74
|
const full = new Float64Array(this._data.length + 2);
|
|
@@ -42,17 +77,33 @@ export class NurbsSurface {
|
|
|
42
77
|
full[this._data.length + 1] = vSegs;
|
|
43
78
|
return Mesh.fromBuffer(wasm.tessellate_nurbs_surface(full));
|
|
44
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Find intersection curves with a plane.
|
|
82
|
+
* @param plane - Cutting plane
|
|
83
|
+
* @param tess - Tessellation resolution for intersection detection (default 20)
|
|
84
|
+
* @returns Array of polylines representing intersection curves
|
|
85
|
+
*/
|
|
45
86
|
intersectPlane(plane, tess = 20) {
|
|
46
87
|
ensureInit();
|
|
47
88
|
const buf = wasm.nurbs_surface_plane_intersect(this._data, plane.normal.x, plane.normal.y, plane.normal.z, plane.d, tess);
|
|
48
|
-
return
|
|
89
|
+
return parsePolylineBuf(buf).map(pts => new Polyline(pts));
|
|
49
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Find intersection curves with another NURBS surface.
|
|
93
|
+
* @param other - Other surface to intersect with
|
|
94
|
+
* @param tess - Tessellation resolution for intersection detection (default 20)
|
|
95
|
+
* @returns Array of polylines representing intersection curves
|
|
96
|
+
*/
|
|
50
97
|
intersectSurface(other, tess = 20) {
|
|
51
98
|
ensureInit();
|
|
52
99
|
const buf = wasm.nurbs_surface_surface_intersect(this._data, other._data, tess);
|
|
53
|
-
return
|
|
100
|
+
return parsePolylineBuf(buf).map(pts => new Polyline(pts));
|
|
54
101
|
}
|
|
55
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* Convert any supported curve type to a NurbsCurve.
|
|
104
|
+
* @param c - Curve to convert
|
|
105
|
+
* @returns NurbsCurve representation
|
|
106
|
+
*/
|
|
56
107
|
static toNurbs(c) {
|
|
57
108
|
if (c instanceof NurbsCurve)
|
|
58
109
|
return c;
|
|
@@ -66,9 +117,14 @@ export class NurbsSurface {
|
|
|
66
117
|
return NurbsCurve.fromLine(c);
|
|
67
118
|
throw new Error(`Unsupported curve type for loft`);
|
|
68
119
|
}
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
120
|
+
/**
|
|
121
|
+
* Loft a NURBS surface through multiple curves.
|
|
122
|
+
* Accepts NurbsCurve, PolyCurve, Polyline, Polygon, Arc, or Line.
|
|
123
|
+
* Automatically converts to NURBS and unifies knot vectors.
|
|
124
|
+
*
|
|
125
|
+
* @param curves - Array of curves to loft through (minimum 2)
|
|
126
|
+
* @param degreeV - Polynomial degree in the loft direction (default 3)
|
|
127
|
+
* @returns New NurbsSurface passing through all input curves
|
|
72
128
|
*/
|
|
73
129
|
static loftCurves(curves, degreeV = 3) {
|
|
74
130
|
ensureInit();
|
|
@@ -157,6 +213,7 @@ export class NurbsSurface {
|
|
|
157
213
|
const knotsV = Array.from(buf.slice(idx, idx + knotsVLen));
|
|
158
214
|
return new NurbsSurface(degU, degV2, cp, weights, knotsU, knotsV);
|
|
159
215
|
}
|
|
216
|
+
/** Encode to WASM format */
|
|
160
217
|
static encode(degU, degV, controlPoints, weights, knotsU, knotsV) {
|
|
161
218
|
const numU = controlPoints.length;
|
|
162
219
|
const numV = controlPoints[0]?.length ?? 0;
|
|
@@ -187,21 +244,4 @@ export class NurbsSurface {
|
|
|
187
244
|
return data;
|
|
188
245
|
}
|
|
189
246
|
}
|
|
190
|
-
function parsePolylineBuffer(buf) {
|
|
191
|
-
if (buf.length === 0)
|
|
192
|
-
return [];
|
|
193
|
-
const n = buf[0];
|
|
194
|
-
const result = [];
|
|
195
|
-
let idx = 1;
|
|
196
|
-
for (let i = 0; i < n; i++) {
|
|
197
|
-
const count = buf[idx++];
|
|
198
|
-
const pts = [];
|
|
199
|
-
for (let j = 0; j < count; j++) {
|
|
200
|
-
pts.push(new Point(buf[idx], buf[idx + 1], buf[idx + 2]));
|
|
201
|
-
idx += 3;
|
|
202
|
-
}
|
|
203
|
-
result.push(new Polyline(pts));
|
|
204
|
-
}
|
|
205
|
-
return result;
|
|
206
|
-
}
|
|
207
247
|
//# sourceMappingURL=NurbsSurface.js.map
|
package/dist/NurbsSurface.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NurbsSurface.js","sourceRoot":"","sources":["../src/NurbsSurface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"NurbsSurface.js","sourceRoot":"","sources":["../src/NurbsSurface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,E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9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC9B,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,MAAM;YAAE,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QACxC,KAAK,MAAM,CAAC,IAAI,MAAM;YAAE,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
package/dist/Point.d.ts
CHANGED
|
@@ -1,30 +1,83 @@
|
|
|
1
1
|
import { Vec3 } from "./Vec3.js";
|
|
2
|
+
import type { Plane } from "./Plane.js";
|
|
3
|
+
import type { RotationAxis } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Immutable 3D point for representing positions in space.
|
|
6
|
+
* All operations return new Point instances.
|
|
7
|
+
*/
|
|
2
8
|
export declare class Point {
|
|
3
9
|
readonly x: number;
|
|
4
10
|
readonly y: number;
|
|
5
11
|
readonly z: number;
|
|
6
12
|
constructor(x: number, y: number, z: number);
|
|
13
|
+
/**
|
|
14
|
+
* Compute the distance to another point.
|
|
15
|
+
* @param other - Target point
|
|
16
|
+
* @returns Euclidean distance between points
|
|
17
|
+
*/
|
|
7
18
|
distanceTo(other: Point): number;
|
|
19
|
+
/**
|
|
20
|
+
* Convert this point to a vector (from origin).
|
|
21
|
+
* @returns Vec3 with same coordinates
|
|
22
|
+
*/
|
|
8
23
|
toVec3(): Vec3;
|
|
24
|
+
/**
|
|
25
|
+
* Add a vector to this point.
|
|
26
|
+
* @param v - Vector to add
|
|
27
|
+
* @returns New point offset by vector
|
|
28
|
+
*/
|
|
9
29
|
add(v: Vec3): Point;
|
|
30
|
+
/**
|
|
31
|
+
* Translate this point by an offset vector.
|
|
32
|
+
* Alias for add().
|
|
33
|
+
* @param offset - Translation vector
|
|
34
|
+
* @returns New translated point
|
|
35
|
+
*/
|
|
10
36
|
translate(offset: Vec3): Point;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Rotate around an axis by angle in radians using Rodrigues' formula.
|
|
39
|
+
* @param axis - Vec3 (rotation around origin) or Line (rotation around arbitrary axis)
|
|
40
|
+
* @param angle - Rotation angle in radians
|
|
41
|
+
* @returns Rotated point
|
|
42
|
+
*/
|
|
43
|
+
rotate(axis: RotationAxis, angle: number): Point;
|
|
44
|
+
/**
|
|
45
|
+
* Project this point onto a plane.
|
|
46
|
+
* @param plane - Target plane
|
|
47
|
+
* @param direction - Optional projection direction (default: perpendicular to plane)
|
|
48
|
+
* @returns Projected point on plane
|
|
49
|
+
*/
|
|
50
|
+
projectOntoPlane(plane: Plane, direction?: Vec3): Point;
|
|
51
|
+
/**
|
|
52
|
+
* Get the vector from another point to this point.
|
|
53
|
+
* @param other - Origin point
|
|
54
|
+
* @returns Vector from other to this
|
|
55
|
+
*/
|
|
23
56
|
sub(other: Point): Vec3;
|
|
57
|
+
/**
|
|
58
|
+
* Create a copy of this point.
|
|
59
|
+
* @returns New point with same coordinates
|
|
60
|
+
*/
|
|
24
61
|
clone(): Point;
|
|
62
|
+
/**
|
|
63
|
+
* Check equality with another point within tolerance.
|
|
64
|
+
* @param other - Point to compare
|
|
65
|
+
* @param eps - Tolerance (default 1e-10)
|
|
66
|
+
* @returns True if points are approximately equal
|
|
67
|
+
*/
|
|
25
68
|
equals(other: Point, eps?: number): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Convert to array format.
|
|
71
|
+
* @returns Tuple [x, y, z]
|
|
72
|
+
*/
|
|
26
73
|
toArray(): [number, number, number];
|
|
74
|
+
/**
|
|
75
|
+
* Create a Point from a plain object or JSON.
|
|
76
|
+
* @param json - Object with x, y, z properties
|
|
77
|
+
* @returns New Point instance
|
|
78
|
+
*/
|
|
27
79
|
static fromJSON(json: any): Point;
|
|
80
|
+
/** Origin point (0, 0, 0) */
|
|
28
81
|
static readonly ORIGIN: Point;
|
|
29
82
|
}
|
|
30
83
|
//# sourceMappingURL=Point.d.ts.map
|
package/dist/Point.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../src/Point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../src/Point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;GAGG;AACH,qBAAa,KAAK;aAEE,CAAC,EAAE,MAAM;aACT,CAAC,EAAE,MAAM;aACT,CAAC,EAAE,MAAM;gBAFT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM;IAG3B;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM;IAOhC;;;OAGG;IACH,MAAM,IAAI,IAAI;IAId;;;;OAIG;IACH,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,KAAK;IAInB;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,IAAI,GAAG,KAAK;IAI9B;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK;IAuBhD;;;;;OAKG;IACH,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,E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