okgeometry-api 0.2.7 → 0.2.9

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.
Files changed (61) hide show
  1. package/dist/Arc.d.ts +3 -0
  2. package/dist/Arc.d.ts.map +1 -1
  3. package/dist/Arc.js +12 -0
  4. package/dist/Arc.js.map +1 -1
  5. package/dist/Circle.d.ts +3 -0
  6. package/dist/Circle.d.ts.map +1 -1
  7. package/dist/Circle.js +13 -0
  8. package/dist/Circle.js.map +1 -1
  9. package/dist/Geometry.d.ts +16 -0
  10. package/dist/Geometry.d.ts.map +1 -0
  11. package/dist/Geometry.js +37 -0
  12. package/dist/Geometry.js.map +1 -0
  13. package/dist/Line.d.ts +3 -0
  14. package/dist/Line.d.ts.map +1 -1
  15. package/dist/Line.js +11 -0
  16. package/dist/Line.js.map +1 -1
  17. package/dist/Mesh.d.ts +8 -1
  18. package/dist/Mesh.d.ts.map +1 -1
  19. package/dist/Mesh.js +56 -1
  20. package/dist/Mesh.js.map +1 -1
  21. package/dist/NurbsCurve.d.ts +15 -0
  22. package/dist/NurbsCurve.d.ts.map +1 -1
  23. package/dist/NurbsCurve.js +51 -0
  24. package/dist/NurbsCurve.js.map +1 -1
  25. package/dist/NurbsSurface.d.ts +18 -0
  26. package/dist/NurbsSurface.d.ts.map +1 -1
  27. package/dist/NurbsSurface.js +122 -1
  28. package/dist/NurbsSurface.js.map +1 -1
  29. package/dist/Point.d.ts +7 -0
  30. package/dist/Point.d.ts.map +1 -1
  31. package/dist/Point.js +24 -0
  32. package/dist/Point.js.map +1 -1
  33. package/dist/PolyCurve.d.ts +9 -0
  34. package/dist/PolyCurve.d.ts.map +1 -1
  35. package/dist/PolyCurve.js +36 -0
  36. package/dist/PolyCurve.js.map +1 -1
  37. package/dist/Polygon.d.ts +4 -0
  38. package/dist/Polygon.d.ts.map +1 -1
  39. package/dist/Polygon.js +12 -0
  40. package/dist/Polygon.js.map +1 -1
  41. package/dist/Polyline.d.ts +3 -0
  42. package/dist/Polyline.d.ts.map +1 -1
  43. package/dist/Polyline.js +16 -0
  44. package/dist/Polyline.js.map +1 -1
  45. package/dist/index.d.ts +2 -0
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +1 -0
  48. package/dist/index.js.map +1 -1
  49. package/dist/wasm-base64.d.ts +1 -1
  50. package/dist/wasm-base64.d.ts.map +1 -1
  51. package/dist/wasm-base64.js +1 -1
  52. package/dist/wasm-base64.js.map +1 -1
  53. package/package.json +1 -1
  54. package/wasm/README.md +102 -0
  55. package/wasm/okgeometrycore.d.ts +347 -0
  56. package/wasm/okgeometrycore.js +9 -0
  57. package/wasm/okgeometrycore_bg.d.ts +3 -0
  58. package/wasm/okgeometrycore_bg.js +1089 -0
  59. package/wasm/okgeometrycore_bg.wasm +0 -0
  60. package/wasm/okgeometrycore_bg.wasm.d.ts +61 -0
  61. package/wasm/package.json +21 -0
@@ -1 +1 @@
1
- {"version":3,"file":"wasm-base64.js","sourceRoot":"","sources":["../src/wasm-base64.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,MAAM,CAAC,MAAM,QAAQ,GAAG,8hgdAA8hgd,CAAC"}
1
+ {"version":3,"file":"wasm-base64.js","sourceRoot":"","sources":["../src/wasm-base64.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,MAAM,CAAC,MAAM,QAAQ,GAAG,0pmkBAA0pmkB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "okgeometry-api",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "Geometry engine API for AEC applications — NURBS, meshes, booleans, intersections. Powered by Rust/WASM.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/wasm/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # OkGeometryCore
2
+
3
+ A production-grade geometry engine written in Rust, compiled to WebAssembly. Built for [OkNodes](https://orkestra.online), a visual programming tool for the AEC (Architecture, Engineering, Construction) industry.
4
+
5
+ ## Features
6
+
7
+ ### Mesh Primitives
8
+ - Box, Cylinder, Sphere, Prism, Cone, Torus
9
+
10
+ ### Mesh Operations
11
+ - **Transforms** - translate, rotate, scale, mirror, arbitrary matrix
12
+ - **Extrude** - linear extrusion with optional end caps
13
+ - **Loft** - surface generation between multiple curves
14
+ - **Sweep** - curve along path
15
+ - **Boolean** - union, intersection, subtraction (~95% reliable on manifold meshes)
16
+ - **Subdivision** - Catmull-Clark (quad meshes) and Loop (triangle meshes)
17
+ - **Offset / Shell** - inward/outward mesh offset
18
+ - **Bevel / Chamfer** - flat bevel on all edges or selected edges
19
+ - **Triangulation** - ear clipping and fan triangulation
20
+
21
+ ### Curve Primitives
22
+ - Line, Arc, Circle, Polyline, Polycurve (mixed segments)
23
+
24
+ ### Curve Operations
25
+ - Evaluate, tangent, length, closest point, bounds
26
+ - Chamfer corners, fillet corners (arc), offset polyline
27
+
28
+ ### Intersection
29
+ - Line-Line, Line-Plane, Line-Circle, Circle-Circle
30
+ - Ray-Mesh (BVH-accelerated), closest point on mesh
31
+
32
+ ### Spatial Indexing
33
+ - BVH (Bounding Volume Hierarchy) for O(log n) ray casting and proximity queries
34
+
35
+ ### I/O
36
+ - OBJ import/export
37
+
38
+ ## Architecture
39
+
40
+ ```
41
+ OkNodes (TypeScript)
42
+ | ArrayBuffer / TypedArray
43
+ v
44
+ OkGeometryCore (Rust -> WASM)
45
+ |- math/ Vector3, Matrix4, Quaternion, Plane, Ray, AABB
46
+ |- curves/ Line, Arc, Circle, Polyline, Polycurve
47
+ |- intersection/ Curve-curve intersections
48
+ |- mesh/ Half-edge data structure, primitives
49
+ |- ops/ Boolean, extrude, loft, sweep, subdivide, bevel...
50
+ |- spatial/ BVH, ray casting, closest point
51
+ |- io/ OBJ format
52
+ ```
53
+
54
+ The engine uses an **index-based half-edge mesh** data structure for cache-friendly traversal and easy WASM serialization. All data crosses the WASM boundary as flat typed arrays to minimize overhead.
55
+
56
+ ## Building
57
+
58
+ ### Prerequisites
59
+ - [Rust](https://rustup.rs/)
60
+ - [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/)
61
+
62
+ ### Build WASM
63
+ ```bash
64
+ wasm-pack build --target web
65
+ ```
66
+
67
+ ### Run tests
68
+ ```bash
69
+ cargo test
70
+ ```
71
+
72
+ ### Viewer
73
+ The `okgeometry-viewer/` directory contains interactive Three.js viewers for visual verification:
74
+
75
+ ```bash
76
+ # Serve the viewer directory with any static file server, e.g.:
77
+ npx serve okgeometry-viewer
78
+ ```
79
+
80
+ Available viewers:
81
+ - **Curves** - Line, Circle, Arc, Polyline visualization
82
+ - **Intersections** - All curve-curve intersection scenarios
83
+ - **Meshes** - Primitives, wireframe, OBJ import/export
84
+ - **Booleans** - Union, intersection, subtraction with position controls
85
+ - **Subdivision** - Catmull-Clark and Loop with iteration slider
86
+ - **Ray Casting** - Interactive ray cast and closest point queries
87
+ - **Bevel / Chamfer** - Flat bevel on box, cylinder, prism
88
+
89
+ ## Dependencies
90
+
91
+ | Crate | Purpose |
92
+ |-------|---------|
93
+ | `wasm-bindgen` | Rust-WASM interop |
94
+ | `js-sys` / `web-sys` | Browser API access |
95
+ | `robust` | Exact geometric predicates (orient2d, orient3d, incircle) |
96
+ | `spade` | Constrained Delaunay triangulation |
97
+ | `serde` | Serialization |
98
+ | `nalgebra` | Linear algebra (optional feature) |
99
+
100
+ ## License
101
+
102
+ Copyright Mostafa El Ayoubi / Orkestra Online. All rights reserved.
@@ -0,0 +1,347 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * Get the length of an arc.
6
+ */
7
+ export function arc_length(radius: number, start_angle: number, end_angle: number): number;
8
+
9
+ /**
10
+ * Evaluate a point on an arc at parameter t ∈ [0,1].
11
+ * Returns [x, y, z].
12
+ */
13
+ export function arc_point_at(cx: number, cy: number, cz: number, nx: number, ny: number, nz: number, radius: number, start_angle: number, end_angle: number, t: number): Float64Array;
14
+
15
+ /**
16
+ * Get the circumference of a circle.
17
+ */
18
+ export function circle_length(radius: number): number;
19
+
20
+ /**
21
+ * Evaluate a point on a circle at parameter t ∈ [0,1].
22
+ * Returns [x, y, z].
23
+ */
24
+ export function circle_point_at(cx: number, cy: number, cz: number, nx: number, ny: number, nz: number, radius: number, t: number): Float64Array;
25
+
26
+ /**
27
+ * Create an arc and return sampled points
28
+ */
29
+ export function create_arc(cx: number, cy: number, cz: number, nx: number, ny: number, nz: number, radius: number, start_angle: number, end_angle: number, samples: number): Float64Array;
30
+
31
+ /**
32
+ * Create a circle and return sampled points
33
+ */
34
+ export function create_circle(cx: number, cy: number, cz: number, nx: number, ny: number, nz: number, radius: number, samples: number): Float64Array;
35
+
36
+ /**
37
+ * Create a line segment and return sampled points
38
+ */
39
+ export function create_line(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number, samples: number): Float64Array;
40
+
41
+ /**
42
+ * Create a polyline and return the points
43
+ */
44
+ export function create_polyline(coords: Float64Array, samples_per_segment: number): Float64Array;
45
+
46
+ /**
47
+ * Serialize a curve to a list of points for Three.js rendering
48
+ * Returns a flat array of coordinates: [x1, y1, z1, x2, y2, z2, ...]
49
+ */
50
+ export function curve_to_points(curve_type: string, params: Float64Array, samples: number): Float64Array;
51
+
52
+ /**
53
+ * Extrude a circle and return mesh buffers
54
+ */
55
+ export function extrude_circle(cx: number, cy: number, cz: number, nx: number, ny: number, nz: number, radius: number, dx: number, dy: number, dz: number, segments: number, with_caps: boolean): Float64Array;
56
+
57
+ /**
58
+ * Extrude a line segment and return mesh buffers
59
+ */
60
+ export function extrude_line(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number, dx: number, dy: number, dz: number, segments: number): Float64Array;
61
+
62
+ /**
63
+ * Extrude a polyline and return mesh buffers.
64
+ * Uses the polyline's actual vertices (no resampling) to preserve sharp corners.
65
+ */
66
+ export function extrude_polyline(coords: Float64Array, dx: number, dy: number, dz: number, _segments: number, with_caps: boolean): Float64Array;
67
+
68
+ /**
69
+ * Get the length of a line segment.
70
+ */
71
+ export function line_length(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number): number;
72
+
73
+ /**
74
+ * Evaluate a point on a line segment at parameter t ∈ [0,1].
75
+ * Returns [x, y, z].
76
+ */
77
+ export function line_point_at(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number, t: number): Float64Array;
78
+
79
+ /**
80
+ * Get the tangent direction of a line segment. Returns [x, y, z].
81
+ */
82
+ export function line_tangent(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number): Float64Array;
83
+
84
+ /**
85
+ * Loft between multiple circles
86
+ *
87
+ * # Parameters
88
+ * * `circle_data` - Flat array of circle definitions [cx, cy, cz, nx, ny, nz, radius, ...]
89
+ * * `segments` - Number of segments to sample along each curve
90
+ * * `with_caps` - Whether to create end caps
91
+ *
92
+ * # Returns
93
+ * Mesh buffers for the lofted surface
94
+ */
95
+ export function loft_circles(circle_data: Float64Array, segments: number, with_caps: boolean): Float64Array;
96
+
97
+ /**
98
+ * Loft a NURBS surface through multiple NURBS curves.
99
+ * Input: [num_curves, degree_v, curve1_data..., curve2_data..., ...]
100
+ * Each curve_data: [degree, num_pts, x,y,z,..., w0,w1,..., k0,k1,...]
101
+ * Returns the NurbsSurface data (same format as tessellate input, without u_segs/v_segs).
102
+ */
103
+ export function loft_nurbs_surface(data: Float64Array): Float64Array;
104
+
105
+ /**
106
+ * Loft between multiple polylines
107
+ *
108
+ * # Parameters
109
+ * * `polyline_data` - Flat array where each polyline is prefixed by its point count:
110
+ * [count1, x1, y1, z1, x2, y2, z2, ..., count2, x1, y1, z1, ...]
111
+ * * `segments` - Number of segments to sample along each curve
112
+ * * `with_caps` - Whether to create end caps
113
+ *
114
+ * # Returns
115
+ * Mesh buffers for the lofted surface
116
+ */
117
+ export function loft_polylines(polyline_data: Float64Array, segments: number, with_caps: boolean): Float64Array;
118
+
119
+ /**
120
+ * Make multiple NURBS curves compatible (same knot vectors, same CP count).
121
+ * Input: [curve_count, curve1_data..., curve2_data..., ...]
122
+ * Each curve: [degree, num_cp, cp_xyz..., weights..., knots...]
123
+ * Output: same format with unified curves.
124
+ */
125
+ export function make_nurbs_curves_compatible(curves_data: Float64Array): Float64Array;
126
+
127
+ /**
128
+ * Apply a 4x4 transformation matrix to a mesh.
129
+ * matrix: flat [m00,m01,m02,m03, m10,m11,..., m30,m31,m32,m33] (16 elements, row-major)
130
+ */
131
+ export function mesh_apply_matrix(vertex_count: number, buffer: Float64Array, matrix: Float64Array): Float64Array;
132
+
133
+ /**
134
+ * Perform boolean intersection on two meshes
135
+ */
136
+ export function mesh_boolean_intersection(vertex_count_a: number, buffer_a: Float64Array, vertex_count_b: number, buffer_b: Float64Array): Float64Array;
137
+
138
+ /**
139
+ * Perform boolean operation on two meshes
140
+ *
141
+ * # Parameters
142
+ * * `vertex_count_a` - Number of vertices in mesh A
143
+ * * `buffer_a` - Buffer for mesh A [vertices..., indices...]
144
+ * * `vertex_count_b` - Number of vertices in mesh B
145
+ * * `buffer_b` - Buffer for mesh B [vertices..., indices...]
146
+ * * `operation` - Operation type: "union", "intersection", or "subtraction"
147
+ *
148
+ * # Returns
149
+ * Result mesh buffer [vertices..., indices...]
150
+ */
151
+ export function mesh_boolean_operation(vertex_count_a: number, buffer_a: Float64Array, vertex_count_b: number, buffer_b: Float64Array, operation: string): Float64Array;
152
+
153
+ /**
154
+ * Perform boolean subtraction on two meshes (A - B)
155
+ */
156
+ export function mesh_boolean_subtraction(vertex_count_a: number, buffer_a: Float64Array, vertex_count_b: number, buffer_b: Float64Array): Float64Array;
157
+
158
+ /**
159
+ * Perform boolean union on two meshes
160
+ */
161
+ export function mesh_boolean_union(vertex_count_a: number, buffer_a: Float64Array, vertex_count_b: number, buffer_b: Float64Array): Float64Array;
162
+
163
+ /**
164
+ * Extract boundary (perimeter) edges from a mesh as polylines.
165
+ * Returns polyline buffer: [num_polylines, n1, x,y,z,..., n2, x,y,z,...]
166
+ */
167
+ export function mesh_boundary_polylines(vertex_count: number, buffer: Float64Array): Float64Array;
168
+
169
+ /**
170
+ * Chamfer all edges of a primitive mesh (flat bevel)
171
+ *
172
+ * # Arguments
173
+ * * `mesh_type` - "box", "cylinder", or "prism"
174
+ * * `params` - Parameters: [width,height,depth] for box, [radius,height,segments] for cylinder/prism
175
+ * * `offset` - Chamfer offset distance
176
+ *
177
+ * # Returns
178
+ * Result mesh buffer [vertexCount, vertices..., indices...]
179
+ */
180
+ export function mesh_chamfer_all_edges(mesh_type: string, params: Float64Array, offset: number): Float64Array;
181
+
182
+ /**
183
+ * Create a box mesh and return buffers
184
+ * Returns [vertices..., indices...]
185
+ */
186
+ export function mesh_create_box(width: number, height: number, depth: number): Float64Array;
187
+
188
+ /**
189
+ * Create a cone mesh and return buffers
190
+ */
191
+ export function mesh_create_cone(radius: number, height: number, segments: number): Float64Array;
192
+
193
+ /**
194
+ * Create a cylinder mesh and return buffers
195
+ */
196
+ export function mesh_create_cylinder(radius: number, height: number, segments: number): Float64Array;
197
+
198
+ /**
199
+ * Create a prism mesh and return buffers
200
+ */
201
+ export function mesh_create_prism(radius: number, height: number, sides: number): Float64Array;
202
+
203
+ /**
204
+ * Create a sphere mesh and return buffers
205
+ */
206
+ export function mesh_create_sphere(radius: number, segments: number, rings: number): Float64Array;
207
+
208
+ /**
209
+ * Export a mesh to OBJ format
210
+ * Takes mesh buffers as input (same format as mesh_to_buffers output)
211
+ * Returns OBJ string
212
+ */
213
+ export function mesh_export_obj(vertex_count: number, buffer: Float64Array): string;
214
+
215
+ /**
216
+ * Get mesh statistics
217
+ * Returns [vertex_count, face_count, edge_count]
218
+ */
219
+ export function mesh_get_stats(vertex_count: number, buffer: Float64Array): Float64Array;
220
+
221
+ /**
222
+ * Import OBJ data and return mesh buffers
223
+ */
224
+ export function mesh_import_obj(obj_data: string): Float64Array;
225
+
226
+ /**
227
+ * Intersect two meshes, returning intersection polyline points.
228
+ * Returns: [num_polylines, n1, x,y,z,..., n2, x,y,z,...]
229
+ */
230
+ export function mesh_mesh_intersect(va_count: number, buffer_a: Float64Array, vb_count: number, buffer_b: Float64Array): Float64Array;
231
+
232
+ /**
233
+ * Intersect a mesh with a plane, returning polyline points.
234
+ * Input: vertex_count, mesh_buffer..., nx, ny, nz, d
235
+ * Returns: [num_polylines, n1, x,y,z,..., n2, x,y,z,...]
236
+ */
237
+ export function mesh_plane_intersect(vertex_count: number, buffer: Float64Array, nx: number, ny: number, nz: number, d: number): Float64Array;
238
+
239
+ /**
240
+ * Rotate a mesh around an arbitrary axis and return new buffers
241
+ * Axis is defined by (ax, ay, az), angle in radians
242
+ */
243
+ export function mesh_rotate(vertex_count: number, buffer: Float64Array, ax: number, ay: number, az: number, angle: number): Float64Array;
244
+
245
+ /**
246
+ * Scale a mesh non-uniformly and return new buffers
247
+ */
248
+ export function mesh_scale(vertex_count: number, buffer: Float64Array, sx: number, sy: number, sz: number): Float64Array;
249
+
250
+ /**
251
+ * Translate a mesh by an offset vector and return new buffers
252
+ */
253
+ export function mesh_translate(vertex_count: number, buffer: Float64Array, dx: number, dy: number, dz: number): Float64Array;
254
+
255
+ /**
256
+ * Intersect two NURBS curves.
257
+ * Returns: [num_points, x,y,z, ...]
258
+ */
259
+ export function nurbs_curve_curve_intersect(data_a: Float64Array, data_b: Float64Array): Float64Array;
260
+
261
+ /**
262
+ * Intersect a NURBS curve with a plane.
263
+ * Input: same curve format as sample_nurbs_curve + plane normal (nx,ny,nz) and d.
264
+ * Returns: [num_points, x,y,z, x,y,z, ...]
265
+ */
266
+ export function nurbs_curve_plane_intersect(data: Float64Array, nx: number, ny: number, nz: number, d: number): Float64Array;
267
+
268
+ /**
269
+ * Evaluate a NURBS surface at (u, v) parameters.
270
+ * Input format: same as tessellate but last 2 values are u, v instead of u_segs, v_segs
271
+ * Returns [x, y, z]
272
+ */
273
+ export function nurbs_surface_evaluate(data: Float64Array, u: number, v: number): Float64Array;
274
+
275
+ /**
276
+ * Intersect a NURBS surface with a plane.
277
+ * Input: same surface format as tessellate_nurbs_surface, then plane (nx,ny,nz,d) appended.
278
+ * Returns polyline buffer: [num_polylines, n1, x,y,z,..., n2, x,y,z,...]
279
+ */
280
+ export function nurbs_surface_plane_intersect(surface_data: Float64Array, nx: number, ny: number, nz: number, d: number, tess: number): Float64Array;
281
+
282
+ /**
283
+ * Intersect two NURBS surfaces.
284
+ * Returns polyline buffer.
285
+ */
286
+ export function nurbs_surface_surface_intersect(data_a: Float64Array, data_b: Float64Array, tess: number): Float64Array;
287
+
288
+ /**
289
+ * Offset a polyline by a distance in a given plane.
290
+ * If nx=ny=nz=0, the plane normal is auto-detected.
291
+ * Returns flat [x1,y1,z1, x2,y2,z2, ...] of the offset polyline.
292
+ */
293
+ export function offset_polyline_curve(coords: Float64Array, distance: number, nx: number, ny: number, nz: number): Float64Array;
294
+
295
+ /**
296
+ * Convert a polycurve (Line/Arc segments) to an exact NURBS curve.
297
+ * Input format: [segment_count, type1, ...data1..., type2, ...data2..., ...]
298
+ * type 0 = Line (6 floats: start_xyz, end_xyz)
299
+ * type 1 = Arc (9 floats: center_xyz, normal_xyz, radius, start_angle, end_angle)
300
+ * Output format: [degree, num_cp, cp_x1,y1,z1,..., w1,w2,..., k1,k2,...]
301
+ */
302
+ export function polycurve_to_nurbs(segment_data: Float64Array): Float64Array;
303
+
304
+ /**
305
+ * Get the total length of a polyline.
306
+ * Input: flat coords [x1,y1,z1, x2,y2,z2, ...]
307
+ */
308
+ export function polyline_length(coords: Float64Array): number;
309
+
310
+ /**
311
+ * Evaluate a point on a polyline at parameter t ∈ [0,1].
312
+ * Input: flat coords [x1,y1,z1, x2,y2,z2, ...]
313
+ * Returns [x, y, z].
314
+ */
315
+ export function polyline_point_at(coords: Float64Array, t: number): Float64Array;
316
+
317
+ /**
318
+ * Sample a NURBS curve.
319
+ * Input: degree, then flat control points [x,y,z,...], then flat weights, then flat knots
320
+ * Format: [degree, num_pts, x0,y0,z0, ..., w0,w1,..., k0,k1,...]
321
+ */
322
+ export function sample_nurbs_curve(data: Float64Array, samples: number): Float64Array;
323
+
324
+ /**
325
+ * Sweep a profile polyline along a path polyline.
326
+ * profile_coords: flat [x,y,z,...] for profile curve
327
+ * path_coords: flat [x,y,z,...] for path curve
328
+ * with_caps: whether to close the ends
329
+ * Returns mesh buffers.
330
+ */
331
+ export function sweep_polylines(profile_coords: Float64Array, path_coords: Float64Array, with_caps: boolean): Float64Array;
332
+
333
+ /**
334
+ * Tessellate a NURBS surface to a mesh buffer.
335
+ * Input format: [degree_u, degree_v, num_u, num_v, ...control_points(flat)..., ...weights(flat)..., ...knots_u..., ...knots_v..., u_segs, v_segs]
336
+ */
337
+ export function tessellate_nurbs_surface(data: Float64Array): Float64Array;
338
+
339
+ /**
340
+ * Simple test function to verify WASM is working
341
+ */
342
+ export function test_wasm(): string;
343
+
344
+ /**
345
+ * Get version info
346
+ */
347
+ export function version(): string;
@@ -0,0 +1,9 @@
1
+ /* @ts-self-types="./okgeometrycore.d.ts" */
2
+
3
+ import * as wasm from "./okgeometrycore_bg.wasm";
4
+ import { __wbg_set_wasm } from "./okgeometrycore_bg.js";
5
+ __wbg_set_wasm(wasm);
6
+ wasm.__wbindgen_start();
7
+ export {
8
+ arc_length, arc_point_at, circle_length, circle_point_at, create_arc, create_circle, create_line, create_polyline, curve_to_points, extrude_circle, extrude_line, extrude_polyline, line_length, line_point_at, line_tangent, loft_circles, loft_nurbs_surface, loft_polylines, make_nurbs_curves_compatible, mesh_apply_matrix, mesh_boolean_intersection, mesh_boolean_operation, mesh_boolean_subtraction, mesh_boolean_union, mesh_boundary_polylines, mesh_chamfer_all_edges, mesh_create_box, mesh_create_cone, mesh_create_cylinder, mesh_create_prism, mesh_create_sphere, mesh_export_obj, mesh_get_stats, mesh_import_obj, mesh_mesh_intersect, mesh_plane_intersect, mesh_rotate, mesh_scale, mesh_translate, nurbs_curve_curve_intersect, nurbs_curve_plane_intersect, nurbs_surface_evaluate, nurbs_surface_plane_intersect, nurbs_surface_surface_intersect, offset_polyline_curve, polycurve_to_nurbs, polyline_length, polyline_point_at, sample_nurbs_curve, sweep_polylines, tessellate_nurbs_surface, test_wasm, version
9
+ } from "./okgeometrycore_bg.js";
@@ -0,0 +1,3 @@
1
+ /* Auto-generated type declarations for okgeometrycore_bg.js */
2
+ export * from "./okgeometrycore.js";
3
+ export function __wbg_set_wasm(val: any): void;