brepkit-wasm 4.9.0 → 4.11.0

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.
@@ -21,13 +21,14 @@ export class BrepKernel {
21
21
  *
22
22
  * Returns a new face handle (`u32`).
23
23
  * @param {number} face
24
- * @param {Uint32Array} hole_wire_handles
24
+ * @param {Uint32Array | number[]} hole_wire_handles
25
25
  * @returns {number}
26
26
  */
27
27
  addHolesToFace(face, hole_wire_handles) {
28
+ const val2 = +face;
28
29
  const ptr0 = passArray32ToWasm0(hole_wire_handles, wasm.__wbindgen_malloc);
29
30
  const len0 = WASM_VECTOR_LEN;
30
- const ret = wasm.brepkernel_addHolesToFace(this.__wbg_ptr, face, ptr0, len0);
31
+ const ret = wasm.brepkernel_addHolesToFace(this.__wbg_ptr, val2, ptr0, len0);
31
32
  if (ret[2]) {
32
33
  throw takeFromExternrefTable0(ret[1]);
33
34
  }
@@ -54,7 +55,7 @@ export class BrepKernel {
54
55
  * Approximate a curve through points using LSPIA (progressive iteration).
55
56
  *
56
57
  * Returns an edge handle.
57
- * @param {Float64Array} coords
58
+ * @param {Float64Array | number[]} coords
58
59
  * @param {number} degree
59
60
  * @param {number} num_control_points
60
61
  * @param {number} tolerance
@@ -62,9 +63,13 @@ export class BrepKernel {
62
63
  * @returns {number}
63
64
  */
64
65
  approximateCurveLspia(coords, degree, num_control_points, tolerance, max_iterations) {
66
+ const val2 = +degree;
67
+ const val3 = +num_control_points;
68
+ const val4 = +tolerance;
69
+ const val5 = +max_iterations;
65
70
  const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
66
71
  const len0 = WASM_VECTOR_LEN;
67
- const ret = wasm.brepkernel_approximateCurveLspia(this.__wbg_ptr, ptr0, len0, degree, num_control_points, tolerance, max_iterations);
72
+ const ret = wasm.brepkernel_approximateCurveLspia(this.__wbg_ptr, ptr0, len0, val2, val3, val4, val5);
68
73
  if (ret[2]) {
69
74
  throw takeFromExternrefTable0(ret[1]);
70
75
  }
@@ -74,15 +79,17 @@ export class BrepKernel {
74
79
  * Approximate a curve through points (least-squares).
75
80
  *
76
81
  * Returns an edge handle.
77
- * @param {Float64Array} coords
82
+ * @param {Float64Array | number[]} coords
78
83
  * @param {number} degree
79
84
  * @param {number} num_control_points
80
85
  * @returns {number}
81
86
  */
82
87
  approximateCurve(coords, degree, num_control_points) {
88
+ const val2 = +degree;
89
+ const val3 = +num_control_points;
83
90
  const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
84
91
  const len0 = WASM_VECTOR_LEN;
85
- const ret = wasm.brepkernel_approximateCurve(this.__wbg_ptr, ptr0, len0, degree, num_control_points);
92
+ const ret = wasm.brepkernel_approximateCurve(this.__wbg_ptr, ptr0, len0, val2, val3);
86
93
  if (ret[2]) {
87
94
  throw takeFromExternrefTable0(ret[1]);
88
95
  }
@@ -92,7 +99,7 @@ export class BrepKernel {
92
99
  * Approximate a grid of points into a NURBS surface using LSPIA.
93
100
  *
94
101
  * Returns a face handle.
95
- * @param {Float64Array} coords
102
+ * @param {Float64Array | number[]} coords
96
103
  * @param {number} rows
97
104
  * @param {number} cols
98
105
  * @param {number} degree_u
@@ -104,9 +111,17 @@ export class BrepKernel {
104
111
  * @returns {number}
105
112
  */
106
113
  approximateSurfaceLspia(coords, rows, cols, degree_u, degree_v, num_cps_u, num_cps_v, tolerance, max_iterations) {
114
+ const val2 = +rows;
115
+ const val3 = +cols;
116
+ const val4 = +degree_u;
117
+ const val5 = +degree_v;
118
+ const val6 = +num_cps_u;
119
+ const val7 = +num_cps_v;
120
+ const val8 = +tolerance;
121
+ const val9 = +max_iterations;
107
122
  const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
108
123
  const len0 = WASM_VECTOR_LEN;
109
- const ret = wasm.brepkernel_approximateSurfaceLspia(this.__wbg_ptr, ptr0, len0, rows, cols, degree_u, degree_v, num_cps_u, num_cps_v, tolerance, max_iterations);
124
+ const ret = wasm.brepkernel_approximateSurfaceLspia(this.__wbg_ptr, ptr0, len0, val2, val3, val4, val5, val6, val7, val8, val9);
110
125
  if (ret[2]) {
111
126
  throw takeFromExternrefTable0(ret[1]);
112
127
  }
@@ -120,15 +135,25 @@ export class BrepKernel {
120
135
  * @param {number} parent
121
136
  * @param {string} name
122
137
  * @param {number} solid
123
- * @param {Float64Array} matrix
138
+ * @param {Float64Array | number[]} matrix
124
139
  * @returns {number}
125
140
  */
126
141
  assemblyAddChild(assembly, parent, name, solid, matrix) {
127
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
128
- const len0 = WASM_VECTOR_LEN;
129
- const ptr1 = passArrayF64ToWasm0(matrix, wasm.__wbindgen_malloc);
130
- const len1 = WASM_VECTOR_LEN;
131
- const ret = wasm.brepkernel_assemblyAddChild(this.__wbg_ptr, assembly, parent, ptr0, len0, solid, ptr1, len1);
142
+ const val3 = +assembly;
143
+ const val4 = +parent;
144
+ const val5 = +solid;
145
+ let ptr0, len0, ptr1, len1;
146
+ try {
147
+ ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
148
+ len0 = WASM_VECTOR_LEN;
149
+ ptr1 = passArrayF64ToWasm0(matrix, wasm.__wbindgen_malloc);
150
+ len1 = WASM_VECTOR_LEN;
151
+ } catch (e) {
152
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
153
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
154
+ throw e;
155
+ }
156
+ const ret = wasm.brepkernel_assemblyAddChild(this.__wbg_ptr, val3, val4, ptr0, len0, val5, ptr1, len1);
132
157
  if (ret[2]) {
133
158
  throw takeFromExternrefTable0(ret[1]);
134
159
  }
@@ -141,15 +166,24 @@ export class BrepKernel {
141
166
  * @param {number} assembly
142
167
  * @param {string} name
143
168
  * @param {number} solid
144
- * @param {Float64Array} matrix
169
+ * @param {Float64Array | number[]} matrix
145
170
  * @returns {number}
146
171
  */
147
172
  assemblyAddRoot(assembly, name, solid, matrix) {
148
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
149
- const len0 = WASM_VECTOR_LEN;
150
- const ptr1 = passArrayF64ToWasm0(matrix, wasm.__wbindgen_malloc);
151
- const len1 = WASM_VECTOR_LEN;
152
- const ret = wasm.brepkernel_assemblyAddRoot(this.__wbg_ptr, assembly, ptr0, len0, solid, ptr1, len1);
173
+ const val3 = +assembly;
174
+ const val4 = +solid;
175
+ let ptr0, len0, ptr1, len1;
176
+ try {
177
+ ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
178
+ len0 = WASM_VECTOR_LEN;
179
+ ptr1 = passArrayF64ToWasm0(matrix, wasm.__wbindgen_malloc);
180
+ len1 = WASM_VECTOR_LEN;
181
+ } catch (e) {
182
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
183
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
184
+ throw e;
185
+ }
186
+ const ret = wasm.brepkernel_assemblyAddRoot(this.__wbg_ptr, val3, ptr0, len0, val4, ptr1, len1);
153
187
  if (ret[2]) {
154
188
  throw takeFromExternrefTable0(ret[1]);
155
189
  }
@@ -216,6 +250,49 @@ export class BrepKernel {
216
250
  const ret = wasm.brepkernel_assemblyNew(this.__wbg_ptr, ptr0, len0);
217
251
  return ret >>> 0;
218
252
  }
253
+ /**
254
+ * Bridge two edge chains with a surface G1 or G2 continuous to the face
255
+ * beside each.
256
+ *
257
+ * Each chain lists its edges in running order, each stored either way.
258
+ * `options` is JSON: `{ "continuity": "g1" | "g2", "weights"?: [a, b] }`.
259
+ * Returns a face handle.
260
+ *
261
+ * # Errors
262
+ *
263
+ * Returns an error if a handle or the options are invalid, a weight is not
264
+ * positive, a chain breaks or leaves its face, or one chain is closed and
265
+ * the other open.
266
+ * @param {Uint32Array | number[]} chain_a
267
+ * @param {number} face_a
268
+ * @param {Uint32Array | number[]} chain_b
269
+ * @param {number} face_b
270
+ * @param {string} options
271
+ * @returns {number}
272
+ */
273
+ blendSurface(chain_a, face_a, chain_b, face_b, options) {
274
+ const val4 = +face_a;
275
+ const val5 = +face_b;
276
+ let ptr0, len0, ptr1, len1, ptr2, len2;
277
+ try {
278
+ ptr0 = passArray32ToWasm0(chain_a, wasm.__wbindgen_malloc);
279
+ len0 = WASM_VECTOR_LEN;
280
+ ptr1 = passArray32ToWasm0(chain_b, wasm.__wbindgen_malloc);
281
+ len1 = WASM_VECTOR_LEN;
282
+ ptr2 = passStringToWasm0(options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
283
+ len2 = WASM_VECTOR_LEN;
284
+ } catch (e) {
285
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
286
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 4, 4); }
287
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 4, 4); }
288
+ throw e;
289
+ }
290
+ const ret = wasm.brepkernel_blendSurface(this.__wbg_ptr, ptr0, len0, val4, ptr1, len1, val5, ptr2, len2);
291
+ if (ret[2]) {
292
+ throw takeFromExternrefTable0(ret[1]);
293
+ }
294
+ return ret[0] >>> 0;
295
+ }
219
296
  /**
220
297
  * Compute the axis-aligned bounding box of a solid.
221
298
  *
@@ -263,20 +340,21 @@ export class BrepKernel {
263
340
  * `coords` is a flat array `[x,y, x,y, ...]`.
264
341
  * `distance` is the chamfer distance from each corner.
265
342
  * Returns a flat array of the chamfered polygon coordinates.
266
- * @param {Float64Array} coords
343
+ * @param {Float64Array | number[]} coords
267
344
  * @param {number} distance
268
345
  * @returns {Float64Array}
269
346
  */
270
347
  chamfer2d(coords, distance) {
348
+ const val2 = +distance;
271
349
  const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
272
350
  const len0 = WASM_VECTOR_LEN;
273
- const ret = wasm.brepkernel_chamfer2d(this.__wbg_ptr, ptr0, len0, distance);
351
+ const ret = wasm.brepkernel_chamfer2d(this.__wbg_ptr, ptr0, len0, val2);
274
352
  if (ret[3]) {
275
353
  throw takeFromExternrefTable0(ret[2]);
276
354
  }
277
- var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
355
+ var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
278
356
  wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
279
- return v2;
357
+ return v3;
280
358
  }
281
359
  /**
282
360
  * Chamfer edges with distance and angle using the v2 blend engine.
@@ -288,15 +366,18 @@ export class BrepKernel {
288
366
  * Returns an error if the solid or edge handles are invalid, the blend
289
367
  * computation fails, or any edge could not be blended.
290
368
  * @param {number} solid
291
- * @param {Uint32Array} edge_handles
369
+ * @param {Uint32Array | number[]} edge_handles
292
370
  * @param {number} distance
293
371
  * @param {number} angle
294
372
  * @returns {number}
295
373
  */
296
374
  chamferDistanceAngle(solid, edge_handles, distance, angle) {
375
+ const val2 = +solid;
376
+ const val3 = +distance;
377
+ const val4 = +angle;
297
378
  const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
298
379
  const len0 = WASM_VECTOR_LEN;
299
- const ret = wasm.brepkernel_chamferDistanceAngle(this.__wbg_ptr, solid, ptr0, len0, distance, angle);
380
+ const ret = wasm.brepkernel_chamferDistanceAngle(this.__wbg_ptr, val2, ptr0, len0, val3, val4);
300
381
  if (ret[2]) {
301
382
  throw takeFromExternrefTable0(ret[1]);
302
383
  }
@@ -312,15 +393,18 @@ export class BrepKernel {
312
393
  * Returns an error if the solid or edge handles are invalid, the blend
313
394
  * computation fails, or any edge could not be blended.
314
395
  * @param {number} solid
315
- * @param {Uint32Array} edge_handles
396
+ * @param {Uint32Array | number[]} edge_handles
316
397
  * @param {number} d1
317
398
  * @param {number} d2
318
399
  * @returns {number}
319
400
  */
320
401
  chamferV2(solid, edge_handles, d1, d2) {
402
+ const val2 = +solid;
403
+ const val3 = +d1;
404
+ const val4 = +d2;
321
405
  const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
322
406
  const len0 = WASM_VECTOR_LEN;
323
- const ret = wasm.brepkernel_chamferV2(this.__wbg_ptr, solid, ptr0, len0, d1, d2);
407
+ const ret = wasm.brepkernel_chamferV2(this.__wbg_ptr, val2, ptr0, len0, val3, val4);
324
408
  if (ret[2]) {
325
409
  throw takeFromExternrefTable0(ret[1]);
326
410
  }
@@ -335,14 +419,16 @@ export class BrepKernel {
335
419
  *
336
420
  * Returns an error if distance is non-positive or edges are invalid.
337
421
  * @param {number} solid
338
- * @param {Uint32Array} edge_handles
422
+ * @param {Uint32Array | number[]} edge_handles
339
423
  * @param {number} distance
340
424
  * @returns {number}
341
425
  */
342
426
  chamfer(solid, edge_handles, distance) {
427
+ const val2 = +solid;
428
+ const val3 = +distance;
343
429
  const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
344
430
  const len0 = WASM_VECTOR_LEN;
345
- const ret = wasm.brepkernel_chamfer(this.__wbg_ptr, solid, ptr0, len0, distance);
431
+ const ret = wasm.brepkernel_chamfer(this.__wbg_ptr, val2, ptr0, len0, val3);
346
432
  if (ret[2]) {
347
433
  throw takeFromExternrefTable0(ret[1]);
348
434
  }
@@ -487,15 +573,22 @@ export class BrepKernel {
487
573
  * Both polygons are flat arrays `[x,y, x,y, ...]`.
488
574
  * Returns a flat array of common segment endpoints `[x1,y1, x2,y2, ...]`,
489
575
  * or an empty array if no common segments exist.
490
- * @param {Float64Array} coords_a
491
- * @param {Float64Array} coords_b
576
+ * @param {Float64Array | number[]} coords_a
577
+ * @param {Float64Array | number[]} coords_b
492
578
  * @returns {Float64Array}
493
579
  */
494
580
  commonSegment2d(coords_a, coords_b) {
495
- const ptr0 = passArrayF64ToWasm0(coords_a, wasm.__wbindgen_malloc);
496
- const len0 = WASM_VECTOR_LEN;
497
- const ptr1 = passArrayF64ToWasm0(coords_b, wasm.__wbindgen_malloc);
498
- const len1 = WASM_VECTOR_LEN;
581
+ let ptr0, len0, ptr1, len1;
582
+ try {
583
+ ptr0 = passArrayF64ToWasm0(coords_a, wasm.__wbindgen_malloc);
584
+ len0 = WASM_VECTOR_LEN;
585
+ ptr1 = passArrayF64ToWasm0(coords_b, wasm.__wbindgen_malloc);
586
+ len1 = WASM_VECTOR_LEN;
587
+ } catch (e) {
588
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
589
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
590
+ throw e;
591
+ }
499
592
  const ret = wasm.brepkernel_commonSegment2d(this.__wbg_ptr, ptr0, len0, ptr1, len1);
500
593
  if (ret[3]) {
501
594
  throw takeFromExternrefTable0(ret[2]);
@@ -513,15 +606,22 @@ export class BrepKernel {
513
606
  * # Errors
514
607
  *
515
608
  * Returns an error if either matrix doesn't have 16 elements.
516
- * @param {Float64Array} matrix_a
517
- * @param {Float64Array} matrix_b
609
+ * @param {Float64Array | number[]} matrix_a
610
+ * @param {Float64Array | number[]} matrix_b
518
611
  * @returns {Float64Array}
519
612
  */
520
613
  composeTransforms(matrix_a, matrix_b) {
521
- const ptr0 = passArrayF64ToWasm0(matrix_a, wasm.__wbindgen_malloc);
522
- const len0 = WASM_VECTOR_LEN;
523
- const ptr1 = passArrayF64ToWasm0(matrix_b, wasm.__wbindgen_malloc);
524
- const len1 = WASM_VECTOR_LEN;
614
+ let ptr0, len0, ptr1, len1;
615
+ try {
616
+ ptr0 = passArrayF64ToWasm0(matrix_a, wasm.__wbindgen_malloc);
617
+ len0 = WASM_VECTOR_LEN;
618
+ ptr1 = passArrayF64ToWasm0(matrix_b, wasm.__wbindgen_malloc);
619
+ len1 = WASM_VECTOR_LEN;
620
+ } catch (e) {
621
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
622
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
623
+ throw e;
624
+ }
525
625
  const ret = wasm.brepkernel_composeTransforms(this.__wbg_ptr, ptr0, len0, ptr1, len1);
526
626
  if (ret[3]) {
527
627
  throw takeFromExternrefTable0(ret[2]);
@@ -543,13 +643,14 @@ export class BrepKernel {
543
643
  *
544
644
  * Returns an error if any handle is invalid or the operation fails.
545
645
  * @param {number} target
546
- * @param {Uint32Array} tool_ids
646
+ * @param {Uint32Array | number[]} tool_ids
547
647
  * @returns {number}
548
648
  */
549
649
  compoundCut(target, tool_ids) {
650
+ const val2 = +target;
550
651
  const ptr0 = passArray32ToWasm0(tool_ids, wasm.__wbindgen_malloc);
551
652
  const len0 = WASM_VECTOR_LEN;
552
- const ret = wasm.brepkernel_compoundCut(this.__wbg_ptr, target, ptr0, len0);
653
+ const ret = wasm.brepkernel_compoundCut(this.__wbg_ptr, val2, ptr0, len0);
553
654
  if (ret[2]) {
554
655
  throw takeFromExternrefTable0(ret[1]);
555
656
  }
@@ -612,7 +713,7 @@ export class BrepKernel {
612
713
  * # Errors
613
714
  *
614
715
  * Returns an error if fewer than 4 non-coplanar points are provided.
615
- * @param {Float64Array} coords
716
+ * @param {Float64Array | number[]} coords
616
717
  * @returns {number}
617
718
  */
618
719
  convexHull(coords) {
@@ -635,13 +736,14 @@ export class BrepKernel {
635
736
  * Returns an error if the solid handle is invalid, the matrix doesn't
636
737
  * have 16 elements, or the matrix is singular.
637
738
  * @param {number} solid
638
- * @param {Float64Array} matrix
739
+ * @param {Float64Array | number[]} matrix
639
740
  * @returns {number}
640
741
  */
641
742
  copyAndTransformSolid(solid, matrix) {
743
+ const val2 = +solid;
642
744
  const ptr0 = passArrayF64ToWasm0(matrix, wasm.__wbindgen_malloc);
643
745
  const len0 = WASM_VECTOR_LEN;
644
- const ret = wasm.brepkernel_copyAndTransformSolid(this.__wbg_ptr, solid, ptr0, len0);
746
+ const ret = wasm.brepkernel_copyAndTransformSolid(this.__wbg_ptr, val2, ptr0, len0);
645
747
  if (ret[2]) {
646
748
  throw takeFromExternrefTable0(ret[1]);
647
749
  }
@@ -827,13 +929,14 @@ export class BrepKernel {
827
929
  * `face_handles` is an array of face handles to remove.
828
930
  * Returns a new solid handle.
829
931
  * @param {number} solid
830
- * @param {Uint32Array} face_handles
932
+ * @param {Uint32Array | number[]} face_handles
831
933
  * @returns {number}
832
934
  */
833
935
  defeature(solid, face_handles) {
936
+ const val2 = +solid;
834
937
  const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
835
938
  const len0 = WASM_VECTOR_LEN;
836
- const ret = wasm.brepkernel_defeature(this.__wbg_ptr, solid, ptr0, len0);
939
+ const ret = wasm.brepkernel_defeature(this.__wbg_ptr, val2, ptr0, len0);
837
940
  if (ret[2]) {
838
941
  throw takeFromExternrefTable0(ret[1]);
839
942
  }
@@ -845,7 +948,7 @@ export class BrepKernel {
845
948
  * # Errors
846
949
  *
847
950
  * Returns an error if the buffer is malformed or reconstruction fails.
848
- * @param {Uint8Array} data
951
+ * @param {Uint8Array | number[]} data
849
952
  * @returns {number}
850
953
  */
851
954
  deserializeSolid(data) {
@@ -939,7 +1042,7 @@ export class BrepKernel {
939
1042
  *
940
1043
  * Returns an error if angle is zero or faces are invalid.
941
1044
  * @param {number} solid
942
- * @param {Uint32Array} face_handles
1045
+ * @param {Uint32Array | number[]} face_handles
943
1046
  * @param {number} pull_x
944
1047
  * @param {number} pull_y
945
1048
  * @param {number} pull_z
@@ -950,9 +1053,17 @@ export class BrepKernel {
950
1053
  * @returns {number}
951
1054
  */
952
1055
  draft(solid, face_handles, pull_x, pull_y, pull_z, neutral_x, neutral_y, neutral_z, angle_degrees) {
1056
+ const val2 = +solid;
1057
+ const val3 = +pull_x;
1058
+ const val4 = +pull_y;
1059
+ const val5 = +pull_z;
1060
+ const val6 = +neutral_x;
1061
+ const val7 = +neutral_y;
1062
+ const val8 = +neutral_z;
1063
+ const val9 = +angle_degrees;
953
1064
  const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
954
1065
  const len0 = WASM_VECTOR_LEN;
955
- const ret = wasm.brepkernel_draft(this.__wbg_ptr, solid, ptr0, len0, pull_x, pull_y, pull_z, neutral_x, neutral_y, neutral_z, angle_degrees);
1066
+ const ret = wasm.brepkernel_draft(this.__wbg_ptr, val2, ptr0, len0, val3, val4, val5, val6, val7, val8, val9);
956
1067
  if (ret[2]) {
957
1068
  throw takeFromExternrefTable0(ret[1]);
958
1069
  }
@@ -1162,7 +1273,7 @@ export class BrepKernel {
1162
1273
  * # Errors
1163
1274
  *
1164
1275
  * Returns an error if a solid handle is invalid or export fails.
1165
- * @param {Uint32Array} solids
1276
+ * @param {Uint32Array | number[]} solids
1166
1277
  * @returns {Uint8Array}
1167
1278
  */
1168
1279
  exportIgesSolids(solids) {
@@ -1391,21 +1502,48 @@ export class BrepKernel {
1391
1502
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1392
1503
  return v1;
1393
1504
  }
1505
+ /**
1506
+ * Smooth a surface, staying within `tolerance` of it, with its boundary
1507
+ * held. A surface with no bumps to remove comes back unchanged.
1508
+ *
1509
+ * Returns a new face handle.
1510
+ *
1511
+ * # Errors
1512
+ *
1513
+ * Returns an error if the handle is invalid or `tolerance` is not positive.
1514
+ * @param {number} face
1515
+ * @param {number} tolerance
1516
+ * @returns {number}
1517
+ */
1518
+ fairSurface(face, tolerance) {
1519
+ const ret = wasm.brepkernel_fairSurface(this.__wbg_ptr, face, tolerance);
1520
+ if (ret[2]) {
1521
+ throw takeFromExternrefTable0(ret[1]);
1522
+ }
1523
+ return ret[0] >>> 0;
1524
+ }
1394
1525
  /**
1395
1526
  * Fill a 4-sided boundary with a Coons patch surface.
1396
1527
  *
1397
1528
  * `boundary_coords` is flat `[x,y,z, ...]` for all 4 curves concatenated.
1398
1529
  * `curve_lengths` is `[n0, n1, n2, n3]` — number of points per curve.
1399
1530
  * Returns a face handle.
1400
- * @param {Float64Array} boundary_coords
1401
- * @param {Uint32Array} curve_lengths
1531
+ * @param {Float64Array | number[]} boundary_coords
1532
+ * @param {Uint32Array | number[]} curve_lengths
1402
1533
  * @returns {number}
1403
1534
  */
1404
1535
  fillCoonsPatch(boundary_coords, curve_lengths) {
1405
- const ptr0 = passArrayF64ToWasm0(boundary_coords, wasm.__wbindgen_malloc);
1406
- const len0 = WASM_VECTOR_LEN;
1407
- const ptr1 = passArray32ToWasm0(curve_lengths, wasm.__wbindgen_malloc);
1408
- const len1 = WASM_VECTOR_LEN;
1536
+ let ptr0, len0, ptr1, len1;
1537
+ try {
1538
+ ptr0 = passArrayF64ToWasm0(boundary_coords, wasm.__wbindgen_malloc);
1539
+ len0 = WASM_VECTOR_LEN;
1540
+ ptr1 = passArray32ToWasm0(curve_lengths, wasm.__wbindgen_malloc);
1541
+ len1 = WASM_VECTOR_LEN;
1542
+ } catch (e) {
1543
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 4, 4); }
1544
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
1545
+ throw e;
1546
+ }
1409
1547
  const ret = wasm.brepkernel_fillCoonsPatch(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1410
1548
  if (ret[2]) {
1411
1549
  throw takeFromExternrefTable0(ret[1]);
@@ -1418,20 +1556,60 @@ export class BrepKernel {
1418
1556
  * `coords` is a flat array `[x,y, x,y, ...]`.
1419
1557
  * `radius` is the fillet radius.
1420
1558
  * Returns a flat array of the filleted polygon coordinates.
1421
- * @param {Float64Array} coords
1559
+ * @param {Float64Array | number[]} coords
1422
1560
  * @param {number} radius
1423
1561
  * @returns {Float64Array}
1424
1562
  */
1425
1563
  fillet2d(coords, radius) {
1564
+ const val2 = +radius;
1426
1565
  const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
1427
1566
  const len0 = WASM_VECTOR_LEN;
1428
- const ret = wasm.brepkernel_fillet2d(this.__wbg_ptr, ptr0, len0, radius);
1567
+ const ret = wasm.brepkernel_fillet2d(this.__wbg_ptr, ptr0, len0, val2);
1429
1568
  if (ret[3]) {
1430
1569
  throw takeFromExternrefTable0(ret[2]);
1431
1570
  }
1432
- var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
1571
+ var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
1433
1572
  wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
1434
- return v2;
1573
+ return v3;
1574
+ }
1575
+ /**
1576
+ * Fillet edges with options at corners where three of them meet: how far
1577
+ * back along each edge its round stops, and what closes the hole that
1578
+ * leaves. `corners_json` is an array of
1579
+ * `{"vertex": h, "setbacks": [{"edge": h, "distance": d}, ...], "corner": "rolling" | "g2"}`,
1580
+ * with `setbacks` and `corner` optional: no set-backs and `"g2"` stops each
1581
+ * round one radius past where a ball would.
1582
+ *
1583
+ * # Errors
1584
+ *
1585
+ * Returns an error if a handle is invalid, the JSON is malformed, the blend
1586
+ * computation fails, or a corner is not three straight rounds between flat
1587
+ * faces with set-backs past the ball and short of each edge's far end.
1588
+ * @param {number} solid
1589
+ * @param {Uint32Array | number[]} edge_handles
1590
+ * @param {number} radius
1591
+ * @param {string} corners_json
1592
+ * @returns {number}
1593
+ */
1594
+ filletV2Corners(solid, edge_handles, radius, corners_json) {
1595
+ const val3 = +solid;
1596
+ const val4 = +radius;
1597
+ let ptr0, len0, ptr1, len1;
1598
+ try {
1599
+ ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
1600
+ len0 = WASM_VECTOR_LEN;
1601
+ ptr1 = passStringToWasm0(corners_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1602
+ len1 = WASM_VECTOR_LEN;
1603
+ } catch (e) {
1604
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
1605
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 4, 4); }
1606
+ throw e;
1607
+ }
1608
+ const ret = wasm.brepkernel_filletV2Corners(this.__wbg_ptr, val3, ptr0, len0, val4, ptr1, len1);
1609
+ if (ret[2]) {
1610
+ throw takeFromExternrefTable0(ret[1]);
1611
+ }
1612
+ return ret[0] >>> 0;
1435
1613
  }
1436
1614
  /**
1437
1615
  * Fillet edges using the v2 walking-based blend engine.
@@ -1443,14 +1621,16 @@ export class BrepKernel {
1443
1621
  * Returns an error if the solid or edge handles are invalid, the blend
1444
1622
  * computation fails, or any edge could not be blended.
1445
1623
  * @param {number} solid
1446
- * @param {Uint32Array} edge_handles
1624
+ * @param {Uint32Array | number[]} edge_handles
1447
1625
  * @param {number} radius
1448
1626
  * @returns {number}
1449
1627
  */
1450
1628
  filletV2(solid, edge_handles, radius) {
1629
+ const val2 = +solid;
1630
+ const val3 = +radius;
1451
1631
  const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
1452
1632
  const len0 = WASM_VECTOR_LEN;
1453
- const ret = wasm.brepkernel_filletV2(this.__wbg_ptr, solid, ptr0, len0, radius);
1633
+ const ret = wasm.brepkernel_filletV2(this.__wbg_ptr, val2, ptr0, len0, val3);
1454
1634
  if (ret[2]) {
1455
1635
  throw takeFromExternrefTable0(ret[1]);
1456
1636
  }
@@ -1470,9 +1650,10 @@ export class BrepKernel {
1470
1650
  * @returns {number}
1471
1651
  */
1472
1652
  filletVariable(solid, json) {
1653
+ const val2 = +solid;
1473
1654
  const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1474
1655
  const len0 = WASM_VECTOR_LEN;
1475
- const ret = wasm.brepkernel_filletVariable(this.__wbg_ptr, solid, ptr0, len0);
1656
+ const ret = wasm.brepkernel_filletVariable(this.__wbg_ptr, val2, ptr0, len0);
1476
1657
  if (ret[2]) {
1477
1658
  throw takeFromExternrefTable0(ret[1]);
1478
1659
  }
@@ -1492,14 +1673,16 @@ export class BrepKernel {
1492
1673
  * Returns an error if a handle is invalid, the radius is non-positive, or
1493
1674
  * the fillet fails.
1494
1675
  * @param {number} solid
1495
- * @param {Uint32Array} edge_handles
1676
+ * @param {Uint32Array | number[]} edge_handles
1496
1677
  * @param {number} radius
1497
1678
  * @returns {any}
1498
1679
  */
1499
1680
  filletWithEvolution(solid, edge_handles, radius) {
1681
+ const val2 = +solid;
1682
+ const val3 = +radius;
1500
1683
  const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
1501
1684
  const len0 = WASM_VECTOR_LEN;
1502
- const ret = wasm.brepkernel_filletWithEvolution(this.__wbg_ptr, solid, ptr0, len0, radius);
1685
+ const ret = wasm.brepkernel_filletWithEvolution(this.__wbg_ptr, val2, ptr0, len0, val3);
1503
1686
  if (ret[2]) {
1504
1687
  throw takeFromExternrefTable0(ret[1]);
1505
1688
  }
@@ -1515,14 +1698,16 @@ export class BrepKernel {
1515
1698
  * Returns an error if radius is non-positive, edges are invalid, or no
1516
1699
  * fillet engine can produce a valid changed solid.
1517
1700
  * @param {number} solid
1518
- * @param {Uint32Array} edge_handles
1701
+ * @param {Uint32Array | number[]} edge_handles
1519
1702
  * @param {number} radius
1520
1703
  * @returns {number}
1521
1704
  */
1522
1705
  fillet(solid, edge_handles, radius) {
1706
+ const val2 = +solid;
1707
+ const val3 = +radius;
1523
1708
  const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
1524
1709
  const len0 = WASM_VECTOR_LEN;
1525
- const ret = wasm.brepkernel_fillet(this.__wbg_ptr, solid, ptr0, len0, radius);
1710
+ const ret = wasm.brepkernel_fillet(this.__wbg_ptr, val2, ptr0, len0, val3);
1526
1711
  if (ret[2]) {
1527
1712
  throw takeFromExternrefTable0(ret[1]);
1528
1713
  }
@@ -1580,7 +1765,7 @@ export class BrepKernel {
1580
1765
  *
1581
1766
  * Returns an error if any solid handle is invalid, the list is empty,
1582
1767
  * or a boolean operation produces an empty or non-manifold result.
1583
- * @param {Uint32Array} solid_handles
1768
+ * @param {Uint32Array | number[]} solid_handles
1584
1769
  * @returns {number}
1585
1770
  */
1586
1771
  fuseAll(solid_handles) {
@@ -2261,29 +2446,43 @@ export class BrepKernel {
2261
2446
  * profile, or a degenerate path.
2262
2447
  * @param {number} face
2263
2448
  * @param {number} spine_degree
2264
- * @param {Float64Array} spine_knots
2265
- * @param {Float64Array} spine_control_points
2266
- * @param {Float64Array} spine_weights
2449
+ * @param {Float64Array | number[]} spine_knots
2450
+ * @param {Float64Array | number[]} spine_control_points
2451
+ * @param {Float64Array | number[]} spine_weights
2267
2452
  * @param {number} aux_degree
2268
- * @param {Float64Array} aux_knots
2269
- * @param {Float64Array} aux_control_points
2270
- * @param {Float64Array} aux_weights
2453
+ * @param {Float64Array | number[]} aux_knots
2454
+ * @param {Float64Array | number[]} aux_control_points
2455
+ * @param {Float64Array | number[]} aux_weights
2271
2456
  * @returns {number}
2272
2457
  */
2273
2458
  guidedSweep(face, spine_degree, spine_knots, spine_control_points, spine_weights, aux_degree, aux_knots, aux_control_points, aux_weights) {
2274
- const ptr0 = passArrayF64ToWasm0(spine_knots, wasm.__wbindgen_malloc);
2275
- const len0 = WASM_VECTOR_LEN;
2276
- const ptr1 = passArrayF64ToWasm0(spine_control_points, wasm.__wbindgen_malloc);
2277
- const len1 = WASM_VECTOR_LEN;
2278
- const ptr2 = passArrayF64ToWasm0(spine_weights, wasm.__wbindgen_malloc);
2279
- const len2 = WASM_VECTOR_LEN;
2280
- const ptr3 = passArrayF64ToWasm0(aux_knots, wasm.__wbindgen_malloc);
2281
- const len3 = WASM_VECTOR_LEN;
2282
- const ptr4 = passArrayF64ToWasm0(aux_control_points, wasm.__wbindgen_malloc);
2283
- const len4 = WASM_VECTOR_LEN;
2284
- const ptr5 = passArrayF64ToWasm0(aux_weights, wasm.__wbindgen_malloc);
2285
- const len5 = WASM_VECTOR_LEN;
2286
- const ret = wasm.brepkernel_guidedSweep(this.__wbg_ptr, face, spine_degree, ptr0, len0, ptr1, len1, ptr2, len2, aux_degree, ptr3, len3, ptr4, len4, ptr5, len5);
2459
+ const val7 = +face;
2460
+ const val8 = +spine_degree;
2461
+ const val9 = +aux_degree;
2462
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5;
2463
+ try {
2464
+ ptr0 = passArrayF64ToWasm0(spine_knots, wasm.__wbindgen_malloc);
2465
+ len0 = WASM_VECTOR_LEN;
2466
+ ptr1 = passArrayF64ToWasm0(spine_control_points, wasm.__wbindgen_malloc);
2467
+ len1 = WASM_VECTOR_LEN;
2468
+ ptr2 = passArrayF64ToWasm0(spine_weights, wasm.__wbindgen_malloc);
2469
+ len2 = WASM_VECTOR_LEN;
2470
+ ptr3 = passArrayF64ToWasm0(aux_knots, wasm.__wbindgen_malloc);
2471
+ len3 = WASM_VECTOR_LEN;
2472
+ ptr4 = passArrayF64ToWasm0(aux_control_points, wasm.__wbindgen_malloc);
2473
+ len4 = WASM_VECTOR_LEN;
2474
+ ptr5 = passArrayF64ToWasm0(aux_weights, wasm.__wbindgen_malloc);
2475
+ len5 = WASM_VECTOR_LEN;
2476
+ } catch (e) {
2477
+ if (ptr5) { wasm.__wbindgen_free(ptr5, len5 * 8, 8); }
2478
+ if (ptr4) { wasm.__wbindgen_free(ptr4, len4 * 8, 8); }
2479
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 8, 8); }
2480
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 8, 8); }
2481
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
2482
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
2483
+ throw e;
2484
+ }
2485
+ const ret = wasm.brepkernel_guidedSweep(this.__wbg_ptr, val7, val8, ptr0, len0, ptr1, len1, ptr2, len2, val9, ptr3, len3, ptr4, len4, ptr5, len5);
2287
2486
  if (ret[2]) {
2288
2487
  throw takeFromExternrefTable0(ret[1]);
2289
2488
  }
@@ -2339,7 +2538,7 @@ export class BrepKernel {
2339
2538
  * # Errors
2340
2539
  *
2341
2540
  * Returns an error if the 3MF data is malformed.
2342
- * @param {Uint8Array} data
2541
+ * @param {Uint8Array | number[]} data
2343
2542
  * @returns {Uint32Array}
2344
2543
  */
2345
2544
  import3mf(data) {
@@ -2359,7 +2558,7 @@ export class BrepKernel {
2359
2558
  * # Errors
2360
2559
  *
2361
2560
  * Returns an error if the file is malformed or mesh import fails.
2362
- * @param {Uint8Array} data
2561
+ * @param {Uint8Array | number[]} data
2363
2562
  * @returns {number}
2364
2563
  */
2365
2564
  importGlb(data) {
@@ -2377,7 +2576,7 @@ export class BrepKernel {
2377
2576
  * # Errors
2378
2577
  *
2379
2578
  * Returns an error if the IGES data is malformed.
2380
- * @param {Uint8Array} data
2579
+ * @param {Uint8Array | number[]} data
2381
2580
  * @returns {Uint32Array}
2382
2581
  */
2383
2582
  importIges(data) {
@@ -2401,15 +2600,22 @@ export class BrepKernel {
2401
2600
  * # Errors
2402
2601
  *
2403
2602
  * Returns an error if the arrays are malformed or mesh import fails.
2404
- * @param {Float64Array} positions
2405
- * @param {Uint32Array} indices
2603
+ * @param {Float64Array | number[]} positions
2604
+ * @param {Uint32Array | number[]} indices
2406
2605
  * @returns {number}
2407
2606
  */
2408
2607
  importIndexedMesh(positions, indices) {
2409
- const ptr0 = passArrayF64ToWasm0(positions, wasm.__wbindgen_malloc);
2410
- const len0 = WASM_VECTOR_LEN;
2411
- const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
2412
- const len1 = WASM_VECTOR_LEN;
2608
+ let ptr0, len0, ptr1, len1;
2609
+ try {
2610
+ ptr0 = passArrayF64ToWasm0(positions, wasm.__wbindgen_malloc);
2611
+ len0 = WASM_VECTOR_LEN;
2612
+ ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
2613
+ len1 = WASM_VECTOR_LEN;
2614
+ } catch (e) {
2615
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 4, 4); }
2616
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
2617
+ throw e;
2618
+ }
2413
2619
  const ret = wasm.brepkernel_importIndexedMesh(this.__wbg_ptr, ptr0, len0, ptr1, len1);
2414
2620
  if (ret[2]) {
2415
2621
  throw takeFromExternrefTable0(ret[1]);
@@ -2422,7 +2628,7 @@ export class BrepKernel {
2422
2628
  * # Errors
2423
2629
  *
2424
2630
  * Returns an error if the file is malformed or mesh import fails.
2425
- * @param {Uint8Array} data
2631
+ * @param {Uint8Array | number[]} data
2426
2632
  * @returns {number}
2427
2633
  */
2428
2634
  importObj(data) {
@@ -2442,7 +2648,7 @@ export class BrepKernel {
2442
2648
  * # Errors
2443
2649
  *
2444
2650
  * Returns an error if the STEP data is malformed.
2445
- * @param {Uint8Array} data
2651
+ * @param {Uint8Array | number[]} data
2446
2652
  * @returns {Uint32Array}
2447
2653
  */
2448
2654
  importStep(data) {
@@ -2465,7 +2671,7 @@ export class BrepKernel {
2465
2671
  * # Errors
2466
2672
  *
2467
2673
  * Returns an error if the STL data is malformed or empty.
2468
- * @param {Uint8Array} data
2674
+ * @param {Uint8Array | number[]} data
2469
2675
  * @returns {number}
2470
2676
  */
2471
2677
  importStl(data) {
@@ -2489,16 +2695,24 @@ export class BrepKernel {
2489
2695
  * along its marks, or the result would not be a valid solid of the same
2490
2696
  * volume.
2491
2697
  * @param {number} solid
2492
- * @param {Uint32Array} face_handles
2493
- * @param {Uint32Array} edge_handles
2698
+ * @param {Uint32Array | number[]} face_handles
2699
+ * @param {Uint32Array | number[]} edge_handles
2494
2700
  * @returns {number}
2495
2701
  */
2496
2702
  imprintFaces(solid, face_handles, edge_handles) {
2497
- const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
2498
- const len0 = WASM_VECTOR_LEN;
2499
- const ptr1 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
2500
- const len1 = WASM_VECTOR_LEN;
2501
- const ret = wasm.brepkernel_imprintFaces(this.__wbg_ptr, solid, ptr0, len0, ptr1, len1);
2703
+ const val3 = +solid;
2704
+ let ptr0, len0, ptr1, len1;
2705
+ try {
2706
+ ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
2707
+ len0 = WASM_VECTOR_LEN;
2708
+ ptr1 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
2709
+ len1 = WASM_VECTOR_LEN;
2710
+ } catch (e) {
2711
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 4, 4); }
2712
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 4, 4); }
2713
+ throw e;
2714
+ }
2715
+ const ret = wasm.brepkernel_imprintFaces(this.__wbg_ptr, val3, ptr0, len0, ptr1, len1);
2502
2716
  if (ret[2]) {
2503
2717
  throw takeFromExternrefTable0(ret[1]);
2504
2718
  }
@@ -2509,14 +2723,15 @@ export class BrepKernel {
2509
2723
  *
2510
2724
  * Uses chord-length parameterization with the given degree.
2511
2725
  * Returns an edge handle (`u32`).
2512
- * @param {Float64Array} coords
2726
+ * @param {Float64Array | number[]} coords
2513
2727
  * @param {number} degree
2514
2728
  * @returns {number}
2515
2729
  */
2516
2730
  interpolatePoints(coords, degree) {
2731
+ const val2 = +degree;
2517
2732
  const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
2518
2733
  const len0 = WASM_VECTOR_LEN;
2519
- const ret = wasm.brepkernel_interpolatePoints(this.__wbg_ptr, ptr0, len0, degree);
2734
+ const ret = wasm.brepkernel_interpolatePoints(this.__wbg_ptr, ptr0, len0, val2);
2520
2735
  if (ret[2]) {
2521
2736
  throw takeFromExternrefTable0(ret[1]);
2522
2737
  }
@@ -2527,7 +2742,7 @@ export class BrepKernel {
2527
2742
  *
2528
2743
  * `coords` is a flat array `[x,y,z, ...]` of `rows * cols` points.
2529
2744
  * Returns a face handle.
2530
- * @param {Float64Array} coords
2745
+ * @param {Float64Array | number[]} coords
2531
2746
  * @param {number} rows
2532
2747
  * @param {number} cols
2533
2748
  * @param {number} degree_u
@@ -2535,9 +2750,13 @@ export class BrepKernel {
2535
2750
  * @returns {number}
2536
2751
  */
2537
2752
  interpolateSurface(coords, rows, cols, degree_u, degree_v) {
2753
+ const val2 = +rows;
2754
+ const val3 = +cols;
2755
+ const val4 = +degree_u;
2756
+ const val5 = +degree_v;
2538
2757
  const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
2539
2758
  const len0 = WASM_VECTOR_LEN;
2540
- const ret = wasm.brepkernel_interpolateSurface(this.__wbg_ptr, ptr0, len0, rows, cols, degree_u, degree_v);
2759
+ const ret = wasm.brepkernel_interpolateSurface(this.__wbg_ptr, ptr0, len0, val2, val3, val4, val5);
2541
2760
  if (ret[2]) {
2542
2761
  throw takeFromExternrefTable0(ret[1]);
2543
2762
  }
@@ -2551,15 +2770,22 @@ export class BrepKernel {
2551
2770
  * or an empty array if they don't intersect.
2552
2771
  *
2553
2772
  * Uses the Sutherland-Hodgman algorithm (convex clipper).
2554
- * @param {Float64Array} coords_a
2555
- * @param {Float64Array} coords_b
2773
+ * @param {Float64Array | number[]} coords_a
2774
+ * @param {Float64Array | number[]} coords_b
2556
2775
  * @returns {Float64Array}
2557
2776
  */
2558
2777
  intersectPolygons2d(coords_a, coords_b) {
2559
- const ptr0 = passArrayF64ToWasm0(coords_a, wasm.__wbindgen_malloc);
2560
- const len0 = WASM_VECTOR_LEN;
2561
- const ptr1 = passArrayF64ToWasm0(coords_b, wasm.__wbindgen_malloc);
2562
- const len1 = WASM_VECTOR_LEN;
2778
+ let ptr0, len0, ptr1, len1;
2779
+ try {
2780
+ ptr0 = passArrayF64ToWasm0(coords_a, wasm.__wbindgen_malloc);
2781
+ len0 = WASM_VECTOR_LEN;
2782
+ ptr1 = passArrayF64ToWasm0(coords_b, wasm.__wbindgen_malloc);
2783
+ len1 = WASM_VECTOR_LEN;
2784
+ } catch (e) {
2785
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
2786
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
2787
+ throw e;
2788
+ }
2563
2789
  const ret = wasm.brepkernel_intersectPolygons2d(this.__wbg_ptr, ptr0, len0, ptr1, len1);
2564
2790
  if (ret[3]) {
2565
2791
  throw takeFromExternrefTable0(ret[2]);
@@ -2664,7 +2890,7 @@ export class BrepKernel {
2664
2890
  *
2665
2891
  * Returns an edge handle (`u32`).
2666
2892
  * @param {number} curve_type
2667
- * @param {Float64Array} curve_params
2893
+ * @param {Float64Array | number[]} curve_params
2668
2894
  * @param {number} origin_x
2669
2895
  * @param {number} origin_y
2670
2896
  * @param {number} origin_z
@@ -2679,9 +2905,21 @@ export class BrepKernel {
2679
2905
  * @returns {number}
2680
2906
  */
2681
2907
  liftCurve2dToPlane(curve_type, curve_params, origin_x, origin_y, origin_z, x_axis_x, x_axis_y, x_axis_z, normal_x, normal_y, normal_z, t_start, t_end) {
2908
+ const val2 = +curve_type;
2909
+ const val3 = +origin_x;
2910
+ const val4 = +origin_y;
2911
+ const val5 = +origin_z;
2912
+ const val6 = +x_axis_x;
2913
+ const val7 = +x_axis_y;
2914
+ const val8 = +x_axis_z;
2915
+ const val9 = +normal_x;
2916
+ const val10 = +normal_y;
2917
+ const val11 = +normal_z;
2918
+ const val12 = +t_start;
2919
+ const val13 = +t_end;
2682
2920
  const ptr0 = passArrayF64ToWasm0(curve_params, wasm.__wbindgen_malloc);
2683
2921
  const len0 = WASM_VECTOR_LEN;
2684
- const ret = wasm.brepkernel_liftCurve2dToPlane(this.__wbg_ptr, curve_type, ptr0, len0, origin_x, origin_y, origin_z, x_axis_x, x_axis_y, x_axis_z, normal_x, normal_y, normal_z, t_start, t_end);
2922
+ const ret = wasm.brepkernel_liftCurve2dToPlane(this.__wbg_ptr, val2, ptr0, len0, val3, val4, val5, val6, val7, val8, val9, val10, val11, val12, val13);
2685
2923
  if (ret[2]) {
2686
2924
  throw takeFromExternrefTable0(ret[1]);
2687
2925
  }
@@ -2723,7 +2961,7 @@ export class BrepKernel {
2723
2961
  *
2724
2962
  * Returns an error if fewer than 2 profiles are given, profiles have
2725
2963
  * different vertex counts, or surface fitting fails.
2726
- * @param {Uint32Array} faces
2964
+ * @param {Uint32Array | number[]} faces
2727
2965
  * @returns {number}
2728
2966
  */
2729
2967
  loftSmooth(faces) {
@@ -2745,7 +2983,7 @@ export class BrepKernel {
2745
2983
  * Returns an error if a handle is invalid, fewer than two wires are given,
2746
2984
  * their edge counts differ, a wire is closed, meets itself or breaks, two
2747
2985
  * wires touch where they would be joined, or two lines cross or fold over.
2748
- * @param {Uint32Array} wires
2986
+ * @param {Uint32Array | number[]} wires
2749
2987
  * @returns {number}
2750
2988
  */
2751
2989
  loftWires(wires) {
@@ -2767,15 +3005,34 @@ export class BrepKernel {
2767
3005
  * - `solid: bool` — true (default) returns a solid handle; false returns
2768
3006
  * a shell handle holding the loft's faces without the caps on its end
2769
3007
  * profiles
2770
- * @param {Uint32Array} faces
3008
+ * - `rails: number[]`: edge handles of guide rails, each through a vertex
3009
+ * of every profile
3010
+ * - `railWires: number[]`: wire handles of guide rails, the same
3011
+ * - `start`, `end`: how the surface leaves the first or last profile, as
3012
+ * `"free"` (default), `"normal"`, `{ kind: "normal", weight }` or
3013
+ * `{ kind: "tangent", face, weight }`, `face` the handle of a face the
3014
+ * profile lies on and `weight` scaling the derivative from its natural
3015
+ * size (default 1, negative for the profile's other side)
3016
+ *
3017
+ * Rails and conditions build a surface no ruled loft can, and close their
3018
+ * ends on the profiles: with them, `ruled` defaults to false, and an
3019
+ * explicit `ruled: true`, a `startPoint` or an `endPoint` is refused.
3020
+ * @param {Uint32Array | number[]} faces
2771
3021
  * @param {string} options
2772
3022
  * @returns {number}
2773
3023
  */
2774
3024
  loftWithOptions(faces, options) {
2775
- const ptr0 = passArray32ToWasm0(faces, wasm.__wbindgen_malloc);
2776
- const len0 = WASM_VECTOR_LEN;
2777
- const ptr1 = passStringToWasm0(options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2778
- const len1 = WASM_VECTOR_LEN;
3025
+ let ptr0, len0, ptr1, len1;
3026
+ try {
3027
+ ptr0 = passArray32ToWasm0(faces, wasm.__wbindgen_malloc);
3028
+ len0 = WASM_VECTOR_LEN;
3029
+ ptr1 = passStringToWasm0(options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3030
+ len1 = WASM_VECTOR_LEN;
3031
+ } catch (e) {
3032
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3033
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 4, 4); }
3034
+ throw e;
3035
+ }
2779
3036
  const ret = wasm.brepkernel_loftWithOptions(this.__wbg_ptr, ptr0, len0, ptr1, len1);
2780
3037
  if (ret[2]) {
2781
3038
  throw takeFromExternrefTable0(ret[1]);
@@ -2791,7 +3048,7 @@ export class BrepKernel {
2791
3048
  *
2792
3049
  * Returns an error if fewer than 2 faces or profiles have
2793
3050
  * different vertex counts.
2794
- * @param {Uint32Array} faces
3051
+ * @param {Uint32Array | number[]} faces
2795
3052
  * @returns {number}
2796
3053
  */
2797
3054
  loft(faces) {
@@ -2961,7 +3218,7 @@ export class BrepKernel {
2961
3218
  * Create a compound from multiple solid handles.
2962
3219
  *
2963
3220
  * Returns a compound handle (stored as `u32`).
2964
- * @param {Uint32Array} solid_handles
3221
+ * @param {Uint32Array | number[]} solid_handles
2965
3222
  * @returns {number}
2966
3223
  */
2967
3224
  makeCompound(solid_handles) {
@@ -3197,19 +3454,34 @@ export class BrepKernel {
3197
3454
  * @param {number} end_y
3198
3455
  * @param {number} end_z
3199
3456
  * @param {number} degree
3200
- * @param {Float64Array} knots
3201
- * @param {Float64Array} control_points
3202
- * @param {Float64Array} weights
3457
+ * @param {Float64Array | number[]} knots
3458
+ * @param {Float64Array | number[]} control_points
3459
+ * @param {Float64Array | number[]} weights
3203
3460
  * @returns {number}
3204
3461
  */
3205
3462
  makeNurbsEdge(start_x, start_y, start_z, end_x, end_y, end_z, degree, knots, control_points, weights) {
3206
- const ptr0 = passArrayF64ToWasm0(knots, wasm.__wbindgen_malloc);
3207
- const len0 = WASM_VECTOR_LEN;
3208
- const ptr1 = passArrayF64ToWasm0(control_points, wasm.__wbindgen_malloc);
3209
- const len1 = WASM_VECTOR_LEN;
3210
- const ptr2 = passArrayF64ToWasm0(weights, wasm.__wbindgen_malloc);
3211
- const len2 = WASM_VECTOR_LEN;
3212
- const ret = wasm.brepkernel_makeNurbsEdge(this.__wbg_ptr, start_x, start_y, start_z, end_x, end_y, end_z, degree, ptr0, len0, ptr1, len1, ptr2, len2);
3463
+ const val4 = +start_x;
3464
+ const val5 = +start_y;
3465
+ const val6 = +start_z;
3466
+ const val7 = +end_x;
3467
+ const val8 = +end_y;
3468
+ const val9 = +end_z;
3469
+ const val10 = +degree;
3470
+ let ptr0, len0, ptr1, len1, ptr2, len2;
3471
+ try {
3472
+ ptr0 = passArrayF64ToWasm0(knots, wasm.__wbindgen_malloc);
3473
+ len0 = WASM_VECTOR_LEN;
3474
+ ptr1 = passArrayF64ToWasm0(control_points, wasm.__wbindgen_malloc);
3475
+ len1 = WASM_VECTOR_LEN;
3476
+ ptr2 = passArrayF64ToWasm0(weights, wasm.__wbindgen_malloc);
3477
+ len2 = WASM_VECTOR_LEN;
3478
+ } catch (e) {
3479
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 8, 8); }
3480
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
3481
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
3482
+ throw e;
3483
+ }
3484
+ const ret = wasm.brepkernel_makeNurbsEdge(this.__wbg_ptr, val4, val5, val6, val7, val8, val9, val10, ptr0, len0, ptr1, len1, ptr2, len2);
3213
3485
  if (ret[2]) {
3214
3486
  throw takeFromExternrefTable0(ret[1]);
3215
3487
  }
@@ -3237,7 +3509,7 @@ export class BrepKernel {
3237
3509
  * Create a closed polygon wire from flat coordinates.
3238
3510
  *
3239
3511
  * Returns a wire handle.
3240
- * @param {Float64Array} coords
3512
+ * @param {Float64Array | number[]} coords
3241
3513
  * @returns {number}
3242
3514
  */
3243
3515
  makePolygonWire(coords) {
@@ -3259,7 +3531,7 @@ export class BrepKernel {
3259
3531
  *
3260
3532
  * Returns an error if `coords` length is not a multiple of 3,
3261
3533
  * fewer than 3 points are provided, or the face normal is degenerate.
3262
- * @param {Float64Array} coords
3534
+ * @param {Float64Array | number[]} coords
3263
3535
  * @returns {number}
3264
3536
  */
3265
3537
  makePolygon(coords) {
@@ -3311,7 +3583,7 @@ export class BrepKernel {
3311
3583
  *
3312
3584
  * Alias for `sewFaces` with a default tolerance. This is the equivalent
3313
3585
  * of sewing faces into a closed shell and building a solid.
3314
- * @param {Uint32Array} face_handles
3586
+ * @param {Uint32Array | number[]} face_handles
3315
3587
  * @returns {number}
3316
3588
  */
3317
3589
  makeSolid(face_handles) {
@@ -3408,14 +3680,46 @@ export class BrepKernel {
3408
3680
  * Create a closed wire from an ordered array of edge handles.
3409
3681
  *
3410
3682
  * Returns a wire handle (`u32`).
3411
- * @param {Uint32Array} edge_handles
3683
+ * @param {Uint32Array | number[]} edge_handles
3412
3684
  * @param {boolean} closed
3413
3685
  * @returns {number}
3414
3686
  */
3415
3687
  makeWire(edge_handles, closed) {
3688
+ const val2 = +closed;
3416
3689
  const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
3417
3690
  const len0 = WASM_VECTOR_LEN;
3418
- const ret = wasm.brepkernel_makeWire(this.__wbg_ptr, ptr0, len0, closed);
3691
+ const ret = wasm.brepkernel_makeWire(this.__wbg_ptr, ptr0, len0, val2);
3692
+ if (ret[2]) {
3693
+ throw takeFromExternrefTable0(ret[1]);
3694
+ }
3695
+ return ret[0] >>> 0;
3696
+ }
3697
+ /**
3698
+ * Move one surface's edge on to another's at G0, G1 or G2, keeping the
3699
+ * rest of the surface as close as the move allows.
3700
+ *
3701
+ * `options` is JSON: `{ "continuity": "g0" | "g1" | "g2", "targetFace"?: face }`.
3702
+ * `targetFace` names the face a solid's edge is matched to, since it
3703
+ * bounds two. Returns a new face handle.
3704
+ *
3705
+ * # Errors
3706
+ *
3707
+ * Returns an error if a handle or the options are invalid, `edge` is not on
3708
+ * the face's outer boundary, or the target bounds no face or several when
3709
+ * a surface is needed and none is named.
3710
+ * @param {number} face
3711
+ * @param {number} edge
3712
+ * @param {number} target_edge
3713
+ * @param {string} options
3714
+ * @returns {number}
3715
+ */
3716
+ matchSurface(face, edge, target_edge, options) {
3717
+ const val2 = +face;
3718
+ const val3 = +edge;
3719
+ const val4 = +target_edge;
3720
+ const ptr0 = passStringToWasm0(options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3721
+ const len0 = WASM_VECTOR_LEN;
3722
+ const ret = wasm.brepkernel_matchSurface(this.__wbg_ptr, val2, val3, val4, ptr0, len0);
3419
3723
  if (ret[2]) {
3420
3724
  throw takeFromExternrefTable0(ret[1]);
3421
3725
  }
@@ -3477,26 +3781,37 @@ export class BrepKernel {
3477
3781
  * Perform a mesh boolean on raw triangle data.
3478
3782
  *
3479
3783
  * Returns a `JsMesh` with the result.
3480
- * @param {Float64Array} positions_a
3481
- * @param {Uint32Array} indices_a
3482
- * @param {Float64Array} positions_b
3483
- * @param {Uint32Array} indices_b
3784
+ * @param {Float64Array | number[]} positions_a
3785
+ * @param {Uint32Array | number[]} indices_a
3786
+ * @param {Float64Array | number[]} positions_b
3787
+ * @param {Uint32Array | number[]} indices_b
3484
3788
  * @param {string} op
3485
3789
  * @param {number} tolerance
3486
3790
  * @returns {JsMesh}
3487
3791
  */
3488
3792
  meshBoolean(positions_a, indices_a, positions_b, indices_b, op, tolerance) {
3489
- const ptr0 = passArrayF64ToWasm0(positions_a, wasm.__wbindgen_malloc);
3490
- const len0 = WASM_VECTOR_LEN;
3491
- const ptr1 = passArray32ToWasm0(indices_a, wasm.__wbindgen_malloc);
3492
- const len1 = WASM_VECTOR_LEN;
3493
- const ptr2 = passArrayF64ToWasm0(positions_b, wasm.__wbindgen_malloc);
3494
- const len2 = WASM_VECTOR_LEN;
3495
- const ptr3 = passArray32ToWasm0(indices_b, wasm.__wbindgen_malloc);
3496
- const len3 = WASM_VECTOR_LEN;
3497
- const ptr4 = passStringToWasm0(op, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3498
- const len4 = WASM_VECTOR_LEN;
3499
- const ret = wasm.brepkernel_meshBoolean(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, tolerance);
3793
+ const val6 = +tolerance;
3794
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4;
3795
+ try {
3796
+ ptr0 = passArrayF64ToWasm0(positions_a, wasm.__wbindgen_malloc);
3797
+ len0 = WASM_VECTOR_LEN;
3798
+ ptr1 = passArray32ToWasm0(indices_a, wasm.__wbindgen_malloc);
3799
+ len1 = WASM_VECTOR_LEN;
3800
+ ptr2 = passArrayF64ToWasm0(positions_b, wasm.__wbindgen_malloc);
3801
+ len2 = WASM_VECTOR_LEN;
3802
+ ptr3 = passArray32ToWasm0(indices_b, wasm.__wbindgen_malloc);
3803
+ len3 = WASM_VECTOR_LEN;
3804
+ ptr4 = passStringToWasm0(op, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3805
+ len4 = WASM_VECTOR_LEN;
3806
+ } catch (e) {
3807
+ if (ptr4) { wasm.__wbindgen_free(ptr4, len4 * 1, 1); }
3808
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 4, 4); }
3809
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 8, 8); }
3810
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 4, 4); }
3811
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
3812
+ throw e;
3813
+ }
3814
+ const ret = wasm.brepkernel_meshBoolean(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, val6);
3500
3815
  if (ret[2]) {
3501
3816
  throw takeFromExternrefTable0(ret[1]);
3502
3817
  }
@@ -3617,27 +3932,39 @@ export class BrepKernel {
3617
3932
  *
3618
3933
  * Returns an error for fewer than two sections, mismatched array lengths, a
3619
3934
  * non-finite or out-of-range value, a non-planar profile, or loft failure.
3620
- * @param {Uint32Array} face_handles
3621
- * @param {Float64Array} params
3935
+ * @param {Uint32Array | number[]} face_handles
3936
+ * @param {Float64Array | number[]} params
3622
3937
  * @param {number} spine_degree
3623
- * @param {Float64Array} spine_knots
3624
- * @param {Float64Array} spine_control_points
3625
- * @param {Float64Array} spine_weights
3938
+ * @param {Float64Array | number[]} spine_knots
3939
+ * @param {Float64Array | number[]} spine_control_points
3940
+ * @param {Float64Array | number[]} spine_weights
3626
3941
  * @param {boolean} ruled
3627
3942
  * @returns {number}
3628
3943
  */
3629
3944
  multiSectionSweep(face_handles, params, spine_degree, spine_knots, spine_control_points, spine_weights, ruled) {
3630
- const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
3631
- const len0 = WASM_VECTOR_LEN;
3632
- const ptr1 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
3633
- const len1 = WASM_VECTOR_LEN;
3634
- const ptr2 = passArrayF64ToWasm0(spine_knots, wasm.__wbindgen_malloc);
3635
- const len2 = WASM_VECTOR_LEN;
3636
- const ptr3 = passArrayF64ToWasm0(spine_control_points, wasm.__wbindgen_malloc);
3637
- const len3 = WASM_VECTOR_LEN;
3638
- const ptr4 = passArrayF64ToWasm0(spine_weights, wasm.__wbindgen_malloc);
3639
- const len4 = WASM_VECTOR_LEN;
3640
- const ret = wasm.brepkernel_multiSectionSweep(this.__wbg_ptr, ptr0, len0, ptr1, len1, spine_degree, ptr2, len2, ptr3, len3, ptr4, len4, ruled);
3945
+ const val6 = +spine_degree;
3946
+ const val7 = +ruled;
3947
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4;
3948
+ try {
3949
+ ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
3950
+ len0 = WASM_VECTOR_LEN;
3951
+ ptr1 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
3952
+ len1 = WASM_VECTOR_LEN;
3953
+ ptr2 = passArrayF64ToWasm0(spine_knots, wasm.__wbindgen_malloc);
3954
+ len2 = WASM_VECTOR_LEN;
3955
+ ptr3 = passArrayF64ToWasm0(spine_control_points, wasm.__wbindgen_malloc);
3956
+ len3 = WASM_VECTOR_LEN;
3957
+ ptr4 = passArrayF64ToWasm0(spine_weights, wasm.__wbindgen_malloc);
3958
+ len4 = WASM_VECTOR_LEN;
3959
+ } catch (e) {
3960
+ if (ptr4) { wasm.__wbindgen_free(ptr4, len4 * 8, 8); }
3961
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 8, 8); }
3962
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 8, 8); }
3963
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
3964
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 4, 4); }
3965
+ throw e;
3966
+ }
3967
+ const ret = wasm.brepkernel_multiSectionSweep(this.__wbg_ptr, ptr0, len0, ptr1, len1, val6, ptr2, len2, ptr3, len3, ptr4, len4, val7);
3641
3968
  if (ret[2]) {
3642
3969
  throw takeFromExternrefTable0(ret[1]);
3643
3970
  }
@@ -3677,21 +4004,23 @@ export class BrepKernel {
3677
4004
  *
3678
4005
  * `coords` is a flat array `[x,y, x,y, ...]` of 2D points.
3679
4006
  * Returns a flat array of offset polygon coordinates.
3680
- * @param {Float64Array} coords
4007
+ * @param {Float64Array | number[]} coords
3681
4008
  * @param {number} distance
3682
4009
  * @param {number} tolerance
3683
4010
  * @returns {Float64Array}
3684
4011
  */
3685
4012
  offsetPolygon2d(coords, distance, tolerance) {
4013
+ const val2 = +distance;
4014
+ const val3 = +tolerance;
3686
4015
  const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
3687
4016
  const len0 = WASM_VECTOR_LEN;
3688
- const ret = wasm.brepkernel_offsetPolygon2d(this.__wbg_ptr, ptr0, len0, distance, tolerance);
4017
+ const ret = wasm.brepkernel_offsetPolygon2d(this.__wbg_ptr, ptr0, len0, val2, val3);
3689
4018
  if (ret[3]) {
3690
4019
  throw takeFromExternrefTable0(ret[2]);
3691
4020
  }
3692
- var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
4021
+ var v4 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
3693
4022
  wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
3694
- return v2;
4023
+ return v4;
3695
4024
  }
3696
4025
  /**
3697
4026
  * Offset all faces of a solid outward or inward (V2 pipeline).
@@ -3755,9 +4084,11 @@ export class BrepKernel {
3755
4084
  * @returns {number}
3756
4085
  */
3757
4086
  offsetWire2DWithJoin(wire, distance, join_type) {
4087
+ const val2 = +wire;
4088
+ const val3 = +distance;
3758
4089
  const ptr0 = passStringToWasm0(join_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3759
4090
  const len0 = WASM_VECTOR_LEN;
3760
- const ret = wasm.brepkernel_offsetWire2DWithJoin(this.__wbg_ptr, wire, distance, ptr0, len0);
4091
+ const ret = wasm.brepkernel_offsetWire2DWithJoin(this.__wbg_ptr, val2, val3, ptr0, len0);
3761
4092
  if (ret[2]) {
3762
4093
  throw takeFromExternrefTable0(ret[1]);
3763
4094
  }
@@ -3779,9 +4110,11 @@ export class BrepKernel {
3779
4110
  * @returns {number}
3780
4111
  */
3781
4112
  offsetWireWithJoinType(face, distance, join_type) {
4113
+ const val2 = +face;
4114
+ const val3 = +distance;
3782
4115
  const ptr0 = passStringToWasm0(join_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3783
4116
  const len0 = WASM_VECTOR_LEN;
3784
- const ret = wasm.brepkernel_offsetWireWithJoinType(this.__wbg_ptr, face, distance, ptr0, len0);
4117
+ const ret = wasm.brepkernel_offsetWireWithJoinType(this.__wbg_ptr, val2, val3, ptr0, len0);
3785
4118
  if (ret[2]) {
3786
4119
  throw takeFromExternrefTable0(ret[1]);
3787
4120
  }
@@ -3812,19 +4145,29 @@ export class BrepKernel {
3812
4145
  * Returns an error if the face or path is invalid.
3813
4146
  * @param {number} face
3814
4147
  * @param {number} path_degree
3815
- * @param {Float64Array} path_knots
3816
- * @param {Float64Array} path_control_points
3817
- * @param {Float64Array} path_weights
4148
+ * @param {Float64Array | number[]} path_knots
4149
+ * @param {Float64Array | number[]} path_control_points
4150
+ * @param {Float64Array | number[]} path_weights
3818
4151
  * @returns {number}
3819
4152
  */
3820
4153
  pipe(face, path_degree, path_knots, path_control_points, path_weights) {
3821
- const ptr0 = passArrayF64ToWasm0(path_knots, wasm.__wbindgen_malloc);
3822
- const len0 = WASM_VECTOR_LEN;
3823
- const ptr1 = passArrayF64ToWasm0(path_control_points, wasm.__wbindgen_malloc);
3824
- const len1 = WASM_VECTOR_LEN;
3825
- const ptr2 = passArrayF64ToWasm0(path_weights, wasm.__wbindgen_malloc);
3826
- const len2 = WASM_VECTOR_LEN;
3827
- const ret = wasm.brepkernel_pipe(this.__wbg_ptr, face, path_degree, ptr0, len0, ptr1, len1, ptr2, len2);
4154
+ const val4 = +face;
4155
+ const val5 = +path_degree;
4156
+ let ptr0, len0, ptr1, len1, ptr2, len2;
4157
+ try {
4158
+ ptr0 = passArrayF64ToWasm0(path_knots, wasm.__wbindgen_malloc);
4159
+ len0 = WASM_VECTOR_LEN;
4160
+ ptr1 = passArrayF64ToWasm0(path_control_points, wasm.__wbindgen_malloc);
4161
+ len1 = WASM_VECTOR_LEN;
4162
+ ptr2 = passArrayF64ToWasm0(path_weights, wasm.__wbindgen_malloc);
4163
+ len2 = WASM_VECTOR_LEN;
4164
+ } catch (e) {
4165
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 8, 8); }
4166
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
4167
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
4168
+ throw e;
4169
+ }
4170
+ const ret = wasm.brepkernel_pipe(this.__wbg_ptr, val4, val5, ptr0, len0, ptr1, len1, ptr2, len2);
3828
4171
  if (ret[2]) {
3829
4172
  throw takeFromExternrefTable0(ret[1]);
3830
4173
  }
@@ -3835,15 +4178,17 @@ export class BrepKernel {
3835
4178
  *
3836
4179
  * `polygon_coords` is a flat array `[x,y, x,y, ...]`.
3837
4180
  * Returns `true` if the point is inside the polygon (winding number test).
3838
- * @param {Float64Array} polygon_coords
4181
+ * @param {Float64Array | number[]} polygon_coords
3839
4182
  * @param {number} px
3840
4183
  * @param {number} py
3841
4184
  * @returns {boolean}
3842
4185
  */
3843
4186
  pointInPolygon2d(polygon_coords, px, py) {
4187
+ const val2 = +px;
4188
+ const val3 = +py;
3844
4189
  const ptr0 = passArrayF64ToWasm0(polygon_coords, wasm.__wbindgen_malloc);
3845
4190
  const len0 = WASM_VECTOR_LEN;
3846
- const ret = wasm.brepkernel_pointInPolygon2d(this.__wbg_ptr, ptr0, len0, px, py);
4191
+ const ret = wasm.brepkernel_pointInPolygon2d(this.__wbg_ptr, ptr0, len0, val2, val3);
3847
4192
  if (ret[2]) {
3848
4193
  throw takeFromExternrefTable0(ret[1]);
3849
4194
  }
@@ -3924,15 +4269,22 @@ export class BrepKernel {
3924
4269
  * Both polygons are flat arrays `[x,y, x,y, ...]`.
3925
4270
  * Returns `true` if any vertex of one polygon is inside the other
3926
4271
  * or if any edges cross.
3927
- * @param {Float64Array} coords_a
3928
- * @param {Float64Array} coords_b
4272
+ * @param {Float64Array | number[]} coords_a
4273
+ * @param {Float64Array | number[]} coords_b
3929
4274
  * @returns {boolean}
3930
4275
  */
3931
4276
  polygonsIntersect2d(coords_a, coords_b) {
3932
- const ptr0 = passArrayF64ToWasm0(coords_a, wasm.__wbindgen_malloc);
3933
- const len0 = WASM_VECTOR_LEN;
3934
- const ptr1 = passArrayF64ToWasm0(coords_b, wasm.__wbindgen_malloc);
3935
- const len1 = WASM_VECTOR_LEN;
4277
+ let ptr0, len0, ptr1, len1;
4278
+ try {
4279
+ ptr0 = passArrayF64ToWasm0(coords_a, wasm.__wbindgen_malloc);
4280
+ len0 = WASM_VECTOR_LEN;
4281
+ ptr1 = passArrayF64ToWasm0(coords_b, wasm.__wbindgen_malloc);
4282
+ len1 = WASM_VECTOR_LEN;
4283
+ } catch (e) {
4284
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
4285
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
4286
+ throw e;
4287
+ }
3936
4288
  const ret = wasm.brepkernel_polygonsIntersect2d(this.__wbg_ptr, ptr0, len0, ptr1, len1);
3937
4289
  if (ret[2]) {
3938
4290
  throw takeFromExternrefTable0(ret[1]);
@@ -4000,7 +4352,7 @@ export class BrepKernel {
4000
4352
  *
4001
4353
  * Returns an error for an empty list, an invalid handle, a non-positive
4002
4354
  * `deflection`, or a degenerate `dir`/`x_axis`.
4003
- * @param {Uint32Array} solids
4355
+ * @param {Uint32Array | number[]} solids
4004
4356
  * @param {number} origin_x
4005
4357
  * @param {number} origin_y
4006
4358
  * @param {number} origin_z
@@ -4015,9 +4367,20 @@ export class BrepKernel {
4015
4367
  * @returns {any}
4016
4368
  */
4017
4369
  projectSolidsEdges(solids, origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, x_axis_x, x_axis_y, x_axis_z, hidden_lines, deflection) {
4370
+ const val2 = +origin_x;
4371
+ const val3 = +origin_y;
4372
+ const val4 = +origin_z;
4373
+ const val5 = +dir_x;
4374
+ const val6 = +dir_y;
4375
+ const val7 = +dir_z;
4376
+ const val8 = +x_axis_x;
4377
+ const val9 = +x_axis_y;
4378
+ const val10 = +x_axis_z;
4379
+ const val11 = +hidden_lines;
4380
+ const val12 = +deflection;
4018
4381
  const ptr0 = passArray32ToWasm0(solids, wasm.__wbindgen_malloc);
4019
4382
  const len0 = WASM_VECTOR_LEN;
4020
- const ret = wasm.brepkernel_projectSolidsEdges(this.__wbg_ptr, ptr0, len0, origin_x, origin_y, origin_z, dir_x, dir_y, dir_z, x_axis_x, x_axis_y, x_axis_z, hidden_lines, deflection);
4383
+ const ret = wasm.brepkernel_projectSolidsEdges(this.__wbg_ptr, ptr0, len0, val2, val3, val4, val5, val6, val7, val8, val9, val10, val11, val12);
4021
4384
  if (ret[2]) {
4022
4385
  throw takeFromExternrefTable0(ret[1]);
4023
4386
  }
@@ -4254,14 +4617,15 @@ export class BrepKernel {
4254
4617
  * # Errors
4255
4618
  *
4256
4619
  * Returns an error if fewer than 2 faces or sewing fails.
4257
- * @param {Uint32Array} face_handles
4620
+ * @param {Uint32Array | number[]} face_handles
4258
4621
  * @param {number} tolerance
4259
4622
  * @returns {number}
4260
4623
  */
4261
4624
  sewFaces(face_handles, tolerance) {
4625
+ const val2 = +tolerance;
4262
4626
  const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
4263
4627
  const len0 = WASM_VECTOR_LEN;
4264
- const ret = wasm.brepkernel_sewFaces(this.__wbg_ptr, ptr0, len0, tolerance);
4628
+ const ret = wasm.brepkernel_sewFaces(this.__wbg_ptr, ptr0, len0, val2);
4265
4629
  if (ret[2]) {
4266
4630
  throw takeFromExternrefTable0(ret[1]);
4267
4631
  }
@@ -4295,13 +4659,15 @@ export class BrepKernel {
4295
4659
  * Returns an error if thickness is non-positive or the solid is invalid.
4296
4660
  * @param {number} solid
4297
4661
  * @param {number} thickness
4298
- * @param {Uint32Array} open_faces
4662
+ * @param {Uint32Array | number[]} open_faces
4299
4663
  * @returns {number}
4300
4664
  */
4301
4665
  shell(solid, thickness, open_faces) {
4666
+ const val2 = +solid;
4667
+ const val3 = +thickness;
4302
4668
  const ptr0 = passArray32ToWasm0(open_faces, wasm.__wbindgen_malloc);
4303
4669
  const len0 = WASM_VECTOR_LEN;
4304
- const ret = wasm.brepkernel_shell(this.__wbg_ptr, solid, thickness, ptr0, len0);
4670
+ const ret = wasm.brepkernel_shell(this.__wbg_ptr, val2, val3, ptr0, len0);
4305
4671
  if (ret[2]) {
4306
4672
  throw takeFromExternrefTable0(ret[1]);
4307
4673
  }
@@ -4350,9 +4716,10 @@ export class BrepKernel {
4350
4716
  * @param {string} json
4351
4717
  */
4352
4718
  sketchAddConstraint(sketch, json) {
4719
+ const val2 = +sketch;
4353
4720
  const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4354
4721
  const len0 = WASM_VECTOR_LEN;
4355
- const ret = wasm.brepkernel_sketchAddConstraint(this.__wbg_ptr, sketch, ptr0, len0);
4722
+ const ret = wasm.brepkernel_sketchAddConstraint(this.__wbg_ptr, val2, ptr0, len0);
4356
4723
  if (ret[1]) {
4357
4724
  throw takeFromExternrefTable0(ret[0]);
4358
4725
  }
@@ -4486,19 +4853,20 @@ export class BrepKernel {
4486
4853
  * along its marks, or the pieces would not be valid solids summing to the
4487
4854
  * solid's volume.
4488
4855
  * @param {number} solid
4489
- * @param {Uint32Array} face_handles
4856
+ * @param {Uint32Array | number[]} face_handles
4490
4857
  * @returns {Uint32Array}
4491
4858
  */
4492
4859
  splitByFaces(solid, face_handles) {
4860
+ const val2 = +solid;
4493
4861
  const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
4494
4862
  const len0 = WASM_VECTOR_LEN;
4495
- const ret = wasm.brepkernel_splitByFaces(this.__wbg_ptr, solid, ptr0, len0);
4863
+ const ret = wasm.brepkernel_splitByFaces(this.__wbg_ptr, val2, ptr0, len0);
4496
4864
  if (ret[3]) {
4497
4865
  throw takeFromExternrefTable0(ret[2]);
4498
4866
  }
4499
- var v2 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
4867
+ var v3 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
4500
4868
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
4501
- return v2;
4869
+ return v3;
4502
4870
  }
4503
4871
  /**
4504
4872
  * Split a solid into two halves along a plane.
@@ -4557,13 +4925,14 @@ export class BrepKernel {
4557
4925
  *
4558
4926
  * Returns an error if fewer than 2 edges or the fit fails.
4559
4927
  * @param {number} face
4560
- * @param {Uint32Array} edge_handles
4928
+ * @param {Uint32Array | number[]} edge_handles
4561
4929
  * @returns {number}
4562
4930
  */
4563
4931
  sweepAlongEdges(face, edge_handles) {
4932
+ const val2 = +face;
4564
4933
  const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
4565
4934
  const len0 = WASM_VECTOR_LEN;
4566
- const ret = wasm.brepkernel_sweepAlongEdges(this.__wbg_ptr, face, ptr0, len0);
4935
+ const ret = wasm.brepkernel_sweepAlongEdges(this.__wbg_ptr, val2, ptr0, len0);
4567
4936
  if (ret[2]) {
4568
4937
  throw takeFromExternrefTable0(ret[1]);
4569
4938
  }
@@ -4583,19 +4952,29 @@ export class BrepKernel {
4583
4952
  * Returns an error if the face or path is invalid, or surface fitting fails.
4584
4953
  * @param {number} face
4585
4954
  * @param {number} path_degree
4586
- * @param {Float64Array} path_knots
4587
- * @param {Float64Array} path_control_points
4588
- * @param {Float64Array} path_weights
4955
+ * @param {Float64Array | number[]} path_knots
4956
+ * @param {Float64Array | number[]} path_control_points
4957
+ * @param {Float64Array | number[]} path_weights
4589
4958
  * @returns {number}
4590
4959
  */
4591
4960
  sweepSmooth(face, path_degree, path_knots, path_control_points, path_weights) {
4592
- const ptr0 = passArrayF64ToWasm0(path_knots, wasm.__wbindgen_malloc);
4593
- const len0 = WASM_VECTOR_LEN;
4594
- const ptr1 = passArrayF64ToWasm0(path_control_points, wasm.__wbindgen_malloc);
4595
- const len1 = WASM_VECTOR_LEN;
4596
- const ptr2 = passArrayF64ToWasm0(path_weights, wasm.__wbindgen_malloc);
4597
- const len2 = WASM_VECTOR_LEN;
4598
- const ret = wasm.brepkernel_sweepSmooth(this.__wbg_ptr, face, path_degree, ptr0, len0, ptr1, len1, ptr2, len2);
4961
+ const val4 = +face;
4962
+ const val5 = +path_degree;
4963
+ let ptr0, len0, ptr1, len1, ptr2, len2;
4964
+ try {
4965
+ ptr0 = passArrayF64ToWasm0(path_knots, wasm.__wbindgen_malloc);
4966
+ len0 = WASM_VECTOR_LEN;
4967
+ ptr1 = passArrayF64ToWasm0(path_control_points, wasm.__wbindgen_malloc);
4968
+ len1 = WASM_VECTOR_LEN;
4969
+ ptr2 = passArrayF64ToWasm0(path_weights, wasm.__wbindgen_malloc);
4970
+ len2 = WASM_VECTOR_LEN;
4971
+ } catch (e) {
4972
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 8, 8); }
4973
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
4974
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
4975
+ throw e;
4976
+ }
4977
+ const ret = wasm.brepkernel_sweepSmooth(this.__wbg_ptr, val4, val5, ptr0, len0, ptr1, len1, ptr2, len2);
4599
4978
  if (ret[2]) {
4600
4979
  throw takeFromExternrefTable0(ret[1]);
4601
4980
  }
@@ -4614,13 +4993,14 @@ export class BrepKernel {
4614
4993
  * Returns an error if a handle is invalid, the chain has no edges, breaks,
4615
4994
  * closes or has a kink, or the wire is closed.
4616
4995
  * @param {number} wire
4617
- * @param {Uint32Array} path_edges
4996
+ * @param {Uint32Array | number[]} path_edges
4618
4997
  * @returns {number}
4619
4998
  */
4620
4999
  sweepWire(wire, path_edges) {
5000
+ const val2 = +wire;
4621
5001
  const ptr0 = passArray32ToWasm0(path_edges, wasm.__wbindgen_malloc);
4622
5002
  const len0 = WASM_VECTOR_LEN;
4623
- const ret = wasm.brepkernel_sweepWire(this.__wbg_ptr, wire, ptr0, len0);
5003
+ const ret = wasm.brepkernel_sweepWire(this.__wbg_ptr, val2, ptr0, len0);
4624
5004
  if (ret[2]) {
4625
5005
  throw takeFromExternrefTable0(ret[1]);
4626
5006
  }
@@ -4636,19 +5016,30 @@ export class BrepKernel {
4636
5016
  * @param {number} profile
4637
5017
  * @param {number} path_edge
4638
5018
  * @param {string} contact_mode
4639
- * @param {Float64Array} scale_values
5019
+ * @param {Float64Array | number[]} scale_values
4640
5020
  * @param {number} segments
4641
5021
  * @param {string} corner_mode
4642
5022
  * @returns {number}
4643
5023
  */
4644
5024
  sweepWithOptions(profile, path_edge, contact_mode, scale_values, segments, corner_mode) {
4645
- const ptr0 = passStringToWasm0(contact_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4646
- const len0 = WASM_VECTOR_LEN;
4647
- const ptr1 = passArrayF64ToWasm0(scale_values, wasm.__wbindgen_malloc);
4648
- const len1 = WASM_VECTOR_LEN;
4649
- const ptr2 = passStringToWasm0(corner_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4650
- const len2 = WASM_VECTOR_LEN;
4651
- const ret = wasm.brepkernel_sweepWithOptions(this.__wbg_ptr, profile, path_edge, ptr0, len0, ptr1, len1, segments, ptr2, len2);
5025
+ const val4 = +profile;
5026
+ const val5 = +path_edge;
5027
+ const val6 = +segments;
5028
+ let ptr0, len0, ptr1, len1, ptr2, len2;
5029
+ try {
5030
+ ptr0 = passStringToWasm0(contact_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5031
+ len0 = WASM_VECTOR_LEN;
5032
+ ptr1 = passArrayF64ToWasm0(scale_values, wasm.__wbindgen_malloc);
5033
+ len1 = WASM_VECTOR_LEN;
5034
+ ptr2 = passStringToWasm0(corner_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5035
+ len2 = WASM_VECTOR_LEN;
5036
+ } catch (e) {
5037
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
5038
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
5039
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
5040
+ throw e;
5041
+ }
5042
+ const ret = wasm.brepkernel_sweepWithOptions(this.__wbg_ptr, val4, val5, ptr0, len0, ptr1, len1, val6, ptr2, len2);
4652
5043
  if (ret[2]) {
4653
5044
  throw takeFromExternrefTable0(ret[1]);
4654
5045
  }
@@ -4671,19 +5062,29 @@ export class BrepKernel {
4671
5062
  * inconsistent lengths, or the sweep operation fails.
4672
5063
  * @param {number} face
4673
5064
  * @param {number} path_degree
4674
- * @param {Float64Array} path_knots
4675
- * @param {Float64Array} path_control_points
4676
- * @param {Float64Array} path_weights
5065
+ * @param {Float64Array | number[]} path_knots
5066
+ * @param {Float64Array | number[]} path_control_points
5067
+ * @param {Float64Array | number[]} path_weights
4677
5068
  * @returns {number}
4678
5069
  */
4679
5070
  sweep(face, path_degree, path_knots, path_control_points, path_weights) {
4680
- const ptr0 = passArrayF64ToWasm0(path_knots, wasm.__wbindgen_malloc);
4681
- const len0 = WASM_VECTOR_LEN;
4682
- const ptr1 = passArrayF64ToWasm0(path_control_points, wasm.__wbindgen_malloc);
4683
- const len1 = WASM_VECTOR_LEN;
4684
- const ptr2 = passArrayF64ToWasm0(path_weights, wasm.__wbindgen_malloc);
4685
- const len2 = WASM_VECTOR_LEN;
4686
- const ret = wasm.brepkernel_sweep(this.__wbg_ptr, face, path_degree, ptr0, len0, ptr1, len1, ptr2, len2);
5071
+ const val4 = +face;
5072
+ const val5 = +path_degree;
5073
+ let ptr0, len0, ptr1, len1, ptr2, len2;
5074
+ try {
5075
+ ptr0 = passArrayF64ToWasm0(path_knots, wasm.__wbindgen_malloc);
5076
+ len0 = WASM_VECTOR_LEN;
5077
+ ptr1 = passArrayF64ToWasm0(path_control_points, wasm.__wbindgen_malloc);
5078
+ len1 = WASM_VECTOR_LEN;
5079
+ ptr2 = passArrayF64ToWasm0(path_weights, wasm.__wbindgen_malloc);
5080
+ len2 = WASM_VECTOR_LEN;
5081
+ } catch (e) {
5082
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 8, 8); }
5083
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
5084
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
5085
+ throw e;
5086
+ }
5087
+ const ret = wasm.brepkernel_sweep(this.__wbg_ptr, val4, val5, ptr0, len0, ptr1, len1, ptr2, len2);
4687
5088
  if (ret[2]) {
4688
5089
  throw takeFromExternrefTable0(ret[1]);
4689
5090
  }
@@ -4884,12 +5285,13 @@ export class BrepKernel {
4884
5285
  * Returns an error if the face handle is invalid, the matrix doesn't
4885
5286
  * have 16 elements, or the matrix is singular.
4886
5287
  * @param {number} face
4887
- * @param {Float64Array} matrix
5288
+ * @param {Float64Array | number[]} matrix
4888
5289
  */
4889
5290
  transformFace(face, matrix) {
5291
+ const val2 = +face;
4890
5292
  const ptr0 = passArrayF64ToWasm0(matrix, wasm.__wbindgen_malloc);
4891
5293
  const len0 = WASM_VECTOR_LEN;
4892
- const ret = wasm.brepkernel_transformFace(this.__wbg_ptr, face, ptr0, len0);
5294
+ const ret = wasm.brepkernel_transformFace(this.__wbg_ptr, val2, ptr0, len0);
4893
5295
  if (ret[1]) {
4894
5296
  throw takeFromExternrefTable0(ret[0]);
4895
5297
  }
@@ -4904,12 +5306,13 @@ export class BrepKernel {
4904
5306
  * Returns an error if the solid handle is invalid, the matrix doesn't
4905
5307
  * have 16 elements, or the matrix is singular.
4906
5308
  * @param {number} solid
4907
- * @param {Float64Array} matrix
5309
+ * @param {Float64Array | number[]} matrix
4908
5310
  */
4909
5311
  transformSolid(solid, matrix) {
5312
+ const val2 = +solid;
4910
5313
  const ptr0 = passArrayF64ToWasm0(matrix, wasm.__wbindgen_malloc);
4911
5314
  const len0 = WASM_VECTOR_LEN;
4912
- const ret = wasm.brepkernel_transformSolid(this.__wbg_ptr, solid, ptr0, len0);
5315
+ const ret = wasm.brepkernel_transformSolid(this.__wbg_ptr, val2, ptr0, len0);
4913
5316
  if (ret[1]) {
4914
5317
  throw takeFromExternrefTable0(ret[0]);
4915
5318
  }
@@ -4924,12 +5327,13 @@ export class BrepKernel {
4924
5327
  * Returns an error if the wire handle is invalid, the matrix doesn't
4925
5328
  * have 16 elements, or the matrix is singular.
4926
5329
  * @param {number} wire
4927
- * @param {Float64Array} matrix
5330
+ * @param {Float64Array | number[]} matrix
4928
5331
  */
4929
5332
  transformWire(wire, matrix) {
5333
+ const val2 = +wire;
4930
5334
  const ptr0 = passArrayF64ToWasm0(matrix, wasm.__wbindgen_malloc);
4931
5335
  const len0 = WASM_VECTOR_LEN;
4932
- const ret = wasm.brepkernel_transformWire(this.__wbg_ptr, wire, ptr0, len0);
5336
+ const ret = wasm.brepkernel_transformWire(this.__wbg_ptr, val2, ptr0, len0);
4933
5337
  if (ret[1]) {
4934
5338
  throw takeFromExternrefTable0(ret[0]);
4935
5339
  }
@@ -5053,14 +5457,15 @@ export class BrepKernel {
5053
5457
  *
5054
5458
  * Accepts an array of face handles from potentially different shells.
5055
5459
  * Sews all faces together into a single solid.
5056
- * @param {Uint32Array} face_handles
5460
+ * @param {Uint32Array | number[]} face_handles
5057
5461
  * @param {number} tolerance
5058
5462
  * @returns {number}
5059
5463
  */
5060
5464
  weldShellsAndFaces(face_handles, tolerance) {
5465
+ const val2 = +tolerance;
5061
5466
  const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
5062
5467
  const len0 = WASM_VECTOR_LEN;
5063
- const ret = wasm.brepkernel_weldShellsAndFaces(this.__wbg_ptr, ptr0, len0, tolerance);
5468
+ const ret = wasm.brepkernel_weldShellsAndFaces(this.__wbg_ptr, ptr0, len0, val2);
5064
5469
  if (ret[2]) {
5065
5470
  throw takeFromExternrefTable0(ret[1]);
5066
5471
  }
@@ -5518,30 +5923,30 @@ export function setLogLevel(level) {
5518
5923
  throw takeFromExternrefTable0(ret[0]);
5519
5924
  }
5520
5925
  }
5521
- export function __wbg_Error_30c8987f7c2ed4e2(arg0, arg1) {
5926
+ export function __wbg_Error_208446807d0d1e30(arg0, arg1) {
5522
5927
  const ret = Error(getStringFromWasm0(arg0, arg1));
5523
5928
  return ret;
5524
5929
  }
5525
- export function __wbg___wbindgen_debug_string_4687d8d8c2017d52(arg0, arg1) {
5930
+ export function __wbg___wbindgen_debug_string_f249a2a76caa9a55(arg0, arg1) {
5526
5931
  const ret = debugString(arg1);
5527
5932
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5528
5933
  const len1 = WASM_VECTOR_LEN;
5529
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
5530
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
5934
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
5935
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
5531
5936
  }
5532
- export function __wbg___wbindgen_throw_41e9ee4f547fc59a(arg0, arg1) {
5937
+ export function __wbg___wbindgen_throw_4c88d8bf264fd984(arg0, arg1) {
5533
5938
  throw new Error(getStringFromWasm0(arg0, arg1));
5534
5939
  }
5535
- export function __wbg_error_edd2929c907c1d29(arg0, arg1) {
5940
+ export function __wbg_error_4a5317fbdfb4920e(arg0, arg1) {
5536
5941
  console.error(getStringFromWasm0(arg0, arg1));
5537
5942
  }
5538
- export function __wbg_getRandomValues_436a51d0629d84e1() { return handleError(function (arg0, arg1) {
5943
+ export function __wbg_getRandomValues_8b6f1f663e6f188d() { return handleError(function (arg0, arg1) {
5539
5944
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
5540
5945
  }, arguments); }
5541
- export function __wbg_log_7a6395b35b7afc30(arg0, arg1) {
5946
+ export function __wbg_log_e0e0fa8c4a2c7863(arg0, arg1) {
5542
5947
  console.log(getStringFromWasm0(arg0, arg1));
5543
5948
  }
5544
- export function __wbg_warn_c1f48997abe88ed4(arg0, arg1) {
5949
+ export function __wbg_warn_f4db05d28a36aed9(arg0, arg1) {
5545
5950
  console.warn(getStringFromWasm0(arg0, arg1));
5546
5951
  }
5547
5952
  export function __wbindgen_generic_0000000000000001(arg0, arg1) {
@@ -5551,12 +5956,11 @@ export function __wbindgen_generic_0000000000000001(arg0, arg1) {
5551
5956
  }
5552
5957
  export function __wbindgen_init_externref_table() {
5553
5958
  const table = wasm.__wbindgen_externrefs;
5554
- const offset = table.grow(4);
5555
5959
  table.set(0, undefined);
5556
- table.set(offset + 0, undefined);
5557
- table.set(offset + 1, null);
5558
- table.set(offset + 2, true);
5559
- table.set(offset + 3, false);
5960
+ table.set(1024, undefined);
5961
+ table.set(1025, null);
5962
+ table.set(1026, true);
5963
+ table.set(1027, false);
5560
5964
  }
5561
5965
  const BrepKernelFinalization = (typeof FinalizationRegistry === 'undefined')
5562
5966
  ? { register: () => {}, unregister: () => {} }
@@ -5584,68 +5988,61 @@ function addToExternrefTable0(obj) {
5584
5988
  }
5585
5989
 
5586
5990
  function debugString(val) {
5587
- // primitive types
5588
- const type = typeof val;
5589
- if (type == 'number' || type == 'boolean' || val == null) {
5590
- return `${val}`;
5591
- }
5592
- if (type == 'string') {
5593
- return `"${val}"`;
5594
- }
5595
- if (type == 'symbol') {
5596
- const description = val.description;
5597
- if (description == null) {
5598
- return 'Symbol';
5599
- } else {
5600
- return `Symbol(${description})`;
5601
- }
5602
- }
5603
- if (type == 'function') {
5604
- const name = val.name;
5605
- if (typeof name == 'string' && name.length > 0) {
5606
- return `Function(${name})`;
5607
- } else {
5608
- return 'Function';
5609
- }
5610
- }
5611
- // objects
5612
- if (Array.isArray(val)) {
5613
- const length = val.length;
5614
- let debug = '[';
5615
- if (length > 0) {
5616
- debug += debugString(val[0]);
5617
- }
5618
- for(let i = 1; i < length; i++) {
5619
- debug += ', ' + debugString(val[i]);
5620
- }
5621
- debug += ']';
5622
- return debug;
5623
- }
5624
- // Test for built-in
5625
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
5626
- let className;
5627
- if (builtInMatches && builtInMatches.length > 1) {
5628
- className = builtInMatches[1];
5629
- } else {
5630
- // Failed to match the standard '[object ClassName]'
5631
- return toString.call(val);
5632
- }
5633
- if (className == 'Object') {
5634
- // we're a user defined class or Object
5635
- // JSON.stringify avoids problems with cycles, and is generally much
5636
- // easier than looping through ownProperties of `val`.
5637
- try {
5638
- return 'Object(' + JSON.stringify(val) + ')';
5639
- } catch (_) {
5640
- return 'Object';
5991
+ switch (typeof val) {
5992
+ // primitive types
5993
+ case 'number':
5994
+ case 'boolean':
5995
+ case 'undefined':
5996
+ return `${val}`;
5997
+ case 'string':
5998
+ return JSON.stringify(val);
5999
+ case 'bigint':
6000
+ return `${val}n`;
6001
+ case 'symbol':
6002
+ return val.description !== undefined
6003
+ ? `Symbol(${val.description})`
6004
+ : 'Symbol';
6005
+ case 'function':
6006
+ return typeof val.name === 'string' && val.name !== ''
6007
+ ? `Function(${val.name})`
6008
+ : 'Function';
6009
+ case 'object': {
6010
+ if (val === null) {
6011
+ return 'null';
6012
+ }
6013
+ // objects
6014
+ if (Array.isArray(val)) {
6015
+ return '[' + Array.from(val, debugString).join(', ') + ']';
6016
+ }
6017
+ // errors
6018
+ if (val instanceof Error) {
6019
+ return `${val.name}: ${val.message}\n${val.stack}`;
6020
+ }
6021
+
6022
+ const toStringOutput = toString.call(val);
6023
+ // Test for built-in
6024
+ const className = /\[object ([^\]]+)\]/.exec(toStringOutput)?.[1];
6025
+
6026
+ // Failed to match the standard '[object ClassName]'
6027
+ if (className === undefined) {
6028
+ return toStringOutput;
6029
+ }
6030
+ if (className === 'Object') {
6031
+ // we're a user defined class or Object
6032
+ // JSON.stringify avoids problems with cycles, and is generally much
6033
+ // easier than looping through ownProperties of `val`.
6034
+ try {
6035
+ return 'Object(' + JSON.stringify(val) + ')';
6036
+ } catch (_) {
6037
+ return 'Object';
6038
+ }
6039
+ }
6040
+ // TODO we could test for more things here, like `Set`s and `Map`s.
6041
+ return className;
5641
6042
  }
6043
+ // Per MDN: 'This list of values is exhaustive.'
6044
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description
5642
6045
  }
5643
- // errors
5644
- if (val instanceof Error) {
5645
- return `${val.name}: ${val.message}\n${val.stack}`;
5646
- }
5647
- // TODO we could test for more things here, like `Set`s and `Map`s.
5648
- return className;
5649
6046
  }
5650
6047
 
5651
6048
  function getArrayF32FromWasm0(ptr, len) {
@@ -5693,7 +6090,8 @@ function getFloat64ArrayMemory0() {
5693
6090
  }
5694
6091
 
5695
6092
  function getStringFromWasm0(ptr, len) {
5696
- return decodeText(ptr >>> 0, len);
6093
+ ptr = ptr >>> 0;
6094
+ return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
5697
6095
  }
5698
6096
 
5699
6097
  let cachedUint32ArrayMemory0 = null;
@@ -5789,18 +6187,18 @@ function takeFromExternrefTable0(idx) {
5789
6187
  return value;
5790
6188
  }
5791
6189
 
5792
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
6190
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
5793
6191
  cachedTextDecoder.decode();
5794
6192
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
5795
6193
  let numBytesDecoded = 0;
5796
- function decodeText(ptr, len) {
5797
- numBytesDecoded += len;
6194
+ function decodeText(bytes) {
6195
+ numBytesDecoded += bytes.length;
5798
6196
  if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
5799
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
6197
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
5800
6198
  cachedTextDecoder.decode();
5801
- numBytesDecoded = len;
6199
+ numBytesDecoded = bytes.length;
5802
6200
  }
5803
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
6201
+ return cachedTextDecoder.decode(bytes);
5804
6202
  }
5805
6203
 
5806
6204
  const cachedTextEncoder = new TextEncoder();