brepkit-wasm 4.9.0 → 4.10.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.
- package/brepkit_wasm.d.ts +123 -67
- package/brepkit_wasm_bg.js +718 -332
- package/brepkit_wasm_bg.wasm +0 -0
- package/brepkit_wasm_node.cjs +715 -329
- package/package.json +1 -1
package/brepkit_wasm_node.cjs
CHANGED
|
@@ -23,13 +23,14 @@ class BrepKernel {
|
|
|
23
23
|
*
|
|
24
24
|
* Returns a new face handle (`u32`).
|
|
25
25
|
* @param {number} face
|
|
26
|
-
* @param {Uint32Array} hole_wire_handles
|
|
26
|
+
* @param {Uint32Array | number[]} hole_wire_handles
|
|
27
27
|
* @returns {number}
|
|
28
28
|
*/
|
|
29
29
|
addHolesToFace(face, hole_wire_handles) {
|
|
30
|
+
const val2 = +face;
|
|
30
31
|
const ptr0 = passArray32ToWasm0(hole_wire_handles, wasm.__wbindgen_malloc);
|
|
31
32
|
const len0 = WASM_VECTOR_LEN;
|
|
32
|
-
const ret = wasm.brepkernel_addHolesToFace(this.__wbg_ptr,
|
|
33
|
+
const ret = wasm.brepkernel_addHolesToFace(this.__wbg_ptr, val2, ptr0, len0);
|
|
33
34
|
if (ret[2]) {
|
|
34
35
|
throw takeFromExternrefTable0(ret[1]);
|
|
35
36
|
}
|
|
@@ -56,7 +57,7 @@ class BrepKernel {
|
|
|
56
57
|
* Approximate a curve through points using LSPIA (progressive iteration).
|
|
57
58
|
*
|
|
58
59
|
* Returns an edge handle.
|
|
59
|
-
* @param {Float64Array} coords
|
|
60
|
+
* @param {Float64Array | number[]} coords
|
|
60
61
|
* @param {number} degree
|
|
61
62
|
* @param {number} num_control_points
|
|
62
63
|
* @param {number} tolerance
|
|
@@ -64,9 +65,13 @@ class BrepKernel {
|
|
|
64
65
|
* @returns {number}
|
|
65
66
|
*/
|
|
66
67
|
approximateCurveLspia(coords, degree, num_control_points, tolerance, max_iterations) {
|
|
68
|
+
const val2 = +degree;
|
|
69
|
+
const val3 = +num_control_points;
|
|
70
|
+
const val4 = +tolerance;
|
|
71
|
+
const val5 = +max_iterations;
|
|
67
72
|
const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
|
|
68
73
|
const len0 = WASM_VECTOR_LEN;
|
|
69
|
-
const ret = wasm.brepkernel_approximateCurveLspia(this.__wbg_ptr, ptr0, len0,
|
|
74
|
+
const ret = wasm.brepkernel_approximateCurveLspia(this.__wbg_ptr, ptr0, len0, val2, val3, val4, val5);
|
|
70
75
|
if (ret[2]) {
|
|
71
76
|
throw takeFromExternrefTable0(ret[1]);
|
|
72
77
|
}
|
|
@@ -76,15 +81,17 @@ class BrepKernel {
|
|
|
76
81
|
* Approximate a curve through points (least-squares).
|
|
77
82
|
*
|
|
78
83
|
* Returns an edge handle.
|
|
79
|
-
* @param {Float64Array} coords
|
|
84
|
+
* @param {Float64Array | number[]} coords
|
|
80
85
|
* @param {number} degree
|
|
81
86
|
* @param {number} num_control_points
|
|
82
87
|
* @returns {number}
|
|
83
88
|
*/
|
|
84
89
|
approximateCurve(coords, degree, num_control_points) {
|
|
90
|
+
const val2 = +degree;
|
|
91
|
+
const val3 = +num_control_points;
|
|
85
92
|
const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
|
|
86
93
|
const len0 = WASM_VECTOR_LEN;
|
|
87
|
-
const ret = wasm.brepkernel_approximateCurve(this.__wbg_ptr, ptr0, len0,
|
|
94
|
+
const ret = wasm.brepkernel_approximateCurve(this.__wbg_ptr, ptr0, len0, val2, val3);
|
|
88
95
|
if (ret[2]) {
|
|
89
96
|
throw takeFromExternrefTable0(ret[1]);
|
|
90
97
|
}
|
|
@@ -94,7 +101,7 @@ class BrepKernel {
|
|
|
94
101
|
* Approximate a grid of points into a NURBS surface using LSPIA.
|
|
95
102
|
*
|
|
96
103
|
* Returns a face handle.
|
|
97
|
-
* @param {Float64Array} coords
|
|
104
|
+
* @param {Float64Array | number[]} coords
|
|
98
105
|
* @param {number} rows
|
|
99
106
|
* @param {number} cols
|
|
100
107
|
* @param {number} degree_u
|
|
@@ -106,9 +113,17 @@ class BrepKernel {
|
|
|
106
113
|
* @returns {number}
|
|
107
114
|
*/
|
|
108
115
|
approximateSurfaceLspia(coords, rows, cols, degree_u, degree_v, num_cps_u, num_cps_v, tolerance, max_iterations) {
|
|
116
|
+
const val2 = +rows;
|
|
117
|
+
const val3 = +cols;
|
|
118
|
+
const val4 = +degree_u;
|
|
119
|
+
const val5 = +degree_v;
|
|
120
|
+
const val6 = +num_cps_u;
|
|
121
|
+
const val7 = +num_cps_v;
|
|
122
|
+
const val8 = +tolerance;
|
|
123
|
+
const val9 = +max_iterations;
|
|
109
124
|
const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
|
|
110
125
|
const len0 = WASM_VECTOR_LEN;
|
|
111
|
-
const ret = wasm.brepkernel_approximateSurfaceLspia(this.__wbg_ptr, ptr0, len0,
|
|
126
|
+
const ret = wasm.brepkernel_approximateSurfaceLspia(this.__wbg_ptr, ptr0, len0, val2, val3, val4, val5, val6, val7, val8, val9);
|
|
112
127
|
if (ret[2]) {
|
|
113
128
|
throw takeFromExternrefTable0(ret[1]);
|
|
114
129
|
}
|
|
@@ -122,15 +137,25 @@ class BrepKernel {
|
|
|
122
137
|
* @param {number} parent
|
|
123
138
|
* @param {string} name
|
|
124
139
|
* @param {number} solid
|
|
125
|
-
* @param {Float64Array} matrix
|
|
140
|
+
* @param {Float64Array | number[]} matrix
|
|
126
141
|
* @returns {number}
|
|
127
142
|
*/
|
|
128
143
|
assemblyAddChild(assembly, parent, name, solid, matrix) {
|
|
129
|
-
const
|
|
130
|
-
const
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
144
|
+
const val3 = +assembly;
|
|
145
|
+
const val4 = +parent;
|
|
146
|
+
const val5 = +solid;
|
|
147
|
+
let ptr0, len0, ptr1, len1;
|
|
148
|
+
try {
|
|
149
|
+
ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
150
|
+
len0 = WASM_VECTOR_LEN;
|
|
151
|
+
ptr1 = passArrayF64ToWasm0(matrix, wasm.__wbindgen_malloc);
|
|
152
|
+
len1 = WASM_VECTOR_LEN;
|
|
153
|
+
} catch (e) {
|
|
154
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
|
|
155
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
156
|
+
throw e;
|
|
157
|
+
}
|
|
158
|
+
const ret = wasm.brepkernel_assemblyAddChild(this.__wbg_ptr, val3, val4, ptr0, len0, val5, ptr1, len1);
|
|
134
159
|
if (ret[2]) {
|
|
135
160
|
throw takeFromExternrefTable0(ret[1]);
|
|
136
161
|
}
|
|
@@ -143,15 +168,24 @@ class BrepKernel {
|
|
|
143
168
|
* @param {number} assembly
|
|
144
169
|
* @param {string} name
|
|
145
170
|
* @param {number} solid
|
|
146
|
-
* @param {Float64Array} matrix
|
|
171
|
+
* @param {Float64Array | number[]} matrix
|
|
147
172
|
* @returns {number}
|
|
148
173
|
*/
|
|
149
174
|
assemblyAddRoot(assembly, name, solid, matrix) {
|
|
150
|
-
const
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
175
|
+
const val3 = +assembly;
|
|
176
|
+
const val4 = +solid;
|
|
177
|
+
let ptr0, len0, ptr1, len1;
|
|
178
|
+
try {
|
|
179
|
+
ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
180
|
+
len0 = WASM_VECTOR_LEN;
|
|
181
|
+
ptr1 = passArrayF64ToWasm0(matrix, wasm.__wbindgen_malloc);
|
|
182
|
+
len1 = WASM_VECTOR_LEN;
|
|
183
|
+
} catch (e) {
|
|
184
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
|
|
185
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
186
|
+
throw e;
|
|
187
|
+
}
|
|
188
|
+
const ret = wasm.brepkernel_assemblyAddRoot(this.__wbg_ptr, val3, ptr0, len0, val4, ptr1, len1);
|
|
155
189
|
if (ret[2]) {
|
|
156
190
|
throw takeFromExternrefTable0(ret[1]);
|
|
157
191
|
}
|
|
@@ -218,6 +252,49 @@ class BrepKernel {
|
|
|
218
252
|
const ret = wasm.brepkernel_assemblyNew(this.__wbg_ptr, ptr0, len0);
|
|
219
253
|
return ret >>> 0;
|
|
220
254
|
}
|
|
255
|
+
/**
|
|
256
|
+
* Bridge two edge chains with a surface G1 or G2 continuous to the face
|
|
257
|
+
* beside each.
|
|
258
|
+
*
|
|
259
|
+
* Each chain lists its edges in running order, each stored either way.
|
|
260
|
+
* `options` is JSON: `{ "continuity": "g1" | "g2", "weights"?: [a, b] }`.
|
|
261
|
+
* Returns a face handle.
|
|
262
|
+
*
|
|
263
|
+
* # Errors
|
|
264
|
+
*
|
|
265
|
+
* Returns an error if a handle or the options are invalid, a weight is not
|
|
266
|
+
* positive, a chain breaks or leaves its face, or one chain is closed and
|
|
267
|
+
* the other open.
|
|
268
|
+
* @param {Uint32Array | number[]} chain_a
|
|
269
|
+
* @param {number} face_a
|
|
270
|
+
* @param {Uint32Array | number[]} chain_b
|
|
271
|
+
* @param {number} face_b
|
|
272
|
+
* @param {string} options
|
|
273
|
+
* @returns {number}
|
|
274
|
+
*/
|
|
275
|
+
blendSurface(chain_a, face_a, chain_b, face_b, options) {
|
|
276
|
+
const val4 = +face_a;
|
|
277
|
+
const val5 = +face_b;
|
|
278
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
279
|
+
try {
|
|
280
|
+
ptr0 = passArray32ToWasm0(chain_a, wasm.__wbindgen_malloc);
|
|
281
|
+
len0 = WASM_VECTOR_LEN;
|
|
282
|
+
ptr1 = passArray32ToWasm0(chain_b, wasm.__wbindgen_malloc);
|
|
283
|
+
len1 = WASM_VECTOR_LEN;
|
|
284
|
+
ptr2 = passStringToWasm0(options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
285
|
+
len2 = WASM_VECTOR_LEN;
|
|
286
|
+
} catch (e) {
|
|
287
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
288
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 4, 4); }
|
|
289
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 4, 4); }
|
|
290
|
+
throw e;
|
|
291
|
+
}
|
|
292
|
+
const ret = wasm.brepkernel_blendSurface(this.__wbg_ptr, ptr0, len0, val4, ptr1, len1, val5, ptr2, len2);
|
|
293
|
+
if (ret[2]) {
|
|
294
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
295
|
+
}
|
|
296
|
+
return ret[0] >>> 0;
|
|
297
|
+
}
|
|
221
298
|
/**
|
|
222
299
|
* Compute the axis-aligned bounding box of a solid.
|
|
223
300
|
*
|
|
@@ -265,20 +342,21 @@ class BrepKernel {
|
|
|
265
342
|
* `coords` is a flat array `[x,y, x,y, ...]`.
|
|
266
343
|
* `distance` is the chamfer distance from each corner.
|
|
267
344
|
* Returns a flat array of the chamfered polygon coordinates.
|
|
268
|
-
* @param {Float64Array} coords
|
|
345
|
+
* @param {Float64Array | number[]} coords
|
|
269
346
|
* @param {number} distance
|
|
270
347
|
* @returns {Float64Array}
|
|
271
348
|
*/
|
|
272
349
|
chamfer2d(coords, distance) {
|
|
350
|
+
const val2 = +distance;
|
|
273
351
|
const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
|
|
274
352
|
const len0 = WASM_VECTOR_LEN;
|
|
275
|
-
const ret = wasm.brepkernel_chamfer2d(this.__wbg_ptr, ptr0, len0,
|
|
353
|
+
const ret = wasm.brepkernel_chamfer2d(this.__wbg_ptr, ptr0, len0, val2);
|
|
276
354
|
if (ret[3]) {
|
|
277
355
|
throw takeFromExternrefTable0(ret[2]);
|
|
278
356
|
}
|
|
279
|
-
var
|
|
357
|
+
var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
280
358
|
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
281
|
-
return
|
|
359
|
+
return v3;
|
|
282
360
|
}
|
|
283
361
|
/**
|
|
284
362
|
* Chamfer edges with distance and angle using the v2 blend engine.
|
|
@@ -290,15 +368,18 @@ class BrepKernel {
|
|
|
290
368
|
* Returns an error if the solid or edge handles are invalid, the blend
|
|
291
369
|
* computation fails, or any edge could not be blended.
|
|
292
370
|
* @param {number} solid
|
|
293
|
-
* @param {Uint32Array} edge_handles
|
|
371
|
+
* @param {Uint32Array | number[]} edge_handles
|
|
294
372
|
* @param {number} distance
|
|
295
373
|
* @param {number} angle
|
|
296
374
|
* @returns {number}
|
|
297
375
|
*/
|
|
298
376
|
chamferDistanceAngle(solid, edge_handles, distance, angle) {
|
|
377
|
+
const val2 = +solid;
|
|
378
|
+
const val3 = +distance;
|
|
379
|
+
const val4 = +angle;
|
|
299
380
|
const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
300
381
|
const len0 = WASM_VECTOR_LEN;
|
|
301
|
-
const ret = wasm.brepkernel_chamferDistanceAngle(this.__wbg_ptr,
|
|
382
|
+
const ret = wasm.brepkernel_chamferDistanceAngle(this.__wbg_ptr, val2, ptr0, len0, val3, val4);
|
|
302
383
|
if (ret[2]) {
|
|
303
384
|
throw takeFromExternrefTable0(ret[1]);
|
|
304
385
|
}
|
|
@@ -314,15 +395,18 @@ class BrepKernel {
|
|
|
314
395
|
* Returns an error if the solid or edge handles are invalid, the blend
|
|
315
396
|
* computation fails, or any edge could not be blended.
|
|
316
397
|
* @param {number} solid
|
|
317
|
-
* @param {Uint32Array} edge_handles
|
|
398
|
+
* @param {Uint32Array | number[]} edge_handles
|
|
318
399
|
* @param {number} d1
|
|
319
400
|
* @param {number} d2
|
|
320
401
|
* @returns {number}
|
|
321
402
|
*/
|
|
322
403
|
chamferV2(solid, edge_handles, d1, d2) {
|
|
404
|
+
const val2 = +solid;
|
|
405
|
+
const val3 = +d1;
|
|
406
|
+
const val4 = +d2;
|
|
323
407
|
const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
324
408
|
const len0 = WASM_VECTOR_LEN;
|
|
325
|
-
const ret = wasm.brepkernel_chamferV2(this.__wbg_ptr,
|
|
409
|
+
const ret = wasm.brepkernel_chamferV2(this.__wbg_ptr, val2, ptr0, len0, val3, val4);
|
|
326
410
|
if (ret[2]) {
|
|
327
411
|
throw takeFromExternrefTable0(ret[1]);
|
|
328
412
|
}
|
|
@@ -337,14 +421,16 @@ class BrepKernel {
|
|
|
337
421
|
*
|
|
338
422
|
* Returns an error if distance is non-positive or edges are invalid.
|
|
339
423
|
* @param {number} solid
|
|
340
|
-
* @param {Uint32Array} edge_handles
|
|
424
|
+
* @param {Uint32Array | number[]} edge_handles
|
|
341
425
|
* @param {number} distance
|
|
342
426
|
* @returns {number}
|
|
343
427
|
*/
|
|
344
428
|
chamfer(solid, edge_handles, distance) {
|
|
429
|
+
const val2 = +solid;
|
|
430
|
+
const val3 = +distance;
|
|
345
431
|
const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
346
432
|
const len0 = WASM_VECTOR_LEN;
|
|
347
|
-
const ret = wasm.brepkernel_chamfer(this.__wbg_ptr,
|
|
433
|
+
const ret = wasm.brepkernel_chamfer(this.__wbg_ptr, val2, ptr0, len0, val3);
|
|
348
434
|
if (ret[2]) {
|
|
349
435
|
throw takeFromExternrefTable0(ret[1]);
|
|
350
436
|
}
|
|
@@ -489,15 +575,22 @@ class BrepKernel {
|
|
|
489
575
|
* Both polygons are flat arrays `[x,y, x,y, ...]`.
|
|
490
576
|
* Returns a flat array of common segment endpoints `[x1,y1, x2,y2, ...]`,
|
|
491
577
|
* or an empty array if no common segments exist.
|
|
492
|
-
* @param {Float64Array} coords_a
|
|
493
|
-
* @param {Float64Array} coords_b
|
|
578
|
+
* @param {Float64Array | number[]} coords_a
|
|
579
|
+
* @param {Float64Array | number[]} coords_b
|
|
494
580
|
* @returns {Float64Array}
|
|
495
581
|
*/
|
|
496
582
|
commonSegment2d(coords_a, coords_b) {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
583
|
+
let ptr0, len0, ptr1, len1;
|
|
584
|
+
try {
|
|
585
|
+
ptr0 = passArrayF64ToWasm0(coords_a, wasm.__wbindgen_malloc);
|
|
586
|
+
len0 = WASM_VECTOR_LEN;
|
|
587
|
+
ptr1 = passArrayF64ToWasm0(coords_b, wasm.__wbindgen_malloc);
|
|
588
|
+
len1 = WASM_VECTOR_LEN;
|
|
589
|
+
} catch (e) {
|
|
590
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
|
|
591
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
|
|
592
|
+
throw e;
|
|
593
|
+
}
|
|
501
594
|
const ret = wasm.brepkernel_commonSegment2d(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
502
595
|
if (ret[3]) {
|
|
503
596
|
throw takeFromExternrefTable0(ret[2]);
|
|
@@ -515,15 +608,22 @@ class BrepKernel {
|
|
|
515
608
|
* # Errors
|
|
516
609
|
*
|
|
517
610
|
* Returns an error if either matrix doesn't have 16 elements.
|
|
518
|
-
* @param {Float64Array} matrix_a
|
|
519
|
-
* @param {Float64Array} matrix_b
|
|
611
|
+
* @param {Float64Array | number[]} matrix_a
|
|
612
|
+
* @param {Float64Array | number[]} matrix_b
|
|
520
613
|
* @returns {Float64Array}
|
|
521
614
|
*/
|
|
522
615
|
composeTransforms(matrix_a, matrix_b) {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
616
|
+
let ptr0, len0, ptr1, len1;
|
|
617
|
+
try {
|
|
618
|
+
ptr0 = passArrayF64ToWasm0(matrix_a, wasm.__wbindgen_malloc);
|
|
619
|
+
len0 = WASM_VECTOR_LEN;
|
|
620
|
+
ptr1 = passArrayF64ToWasm0(matrix_b, wasm.__wbindgen_malloc);
|
|
621
|
+
len1 = WASM_VECTOR_LEN;
|
|
622
|
+
} catch (e) {
|
|
623
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
|
|
624
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
|
|
625
|
+
throw e;
|
|
626
|
+
}
|
|
527
627
|
const ret = wasm.brepkernel_composeTransforms(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
528
628
|
if (ret[3]) {
|
|
529
629
|
throw takeFromExternrefTable0(ret[2]);
|
|
@@ -545,13 +645,14 @@ class BrepKernel {
|
|
|
545
645
|
*
|
|
546
646
|
* Returns an error if any handle is invalid or the operation fails.
|
|
547
647
|
* @param {number} target
|
|
548
|
-
* @param {Uint32Array} tool_ids
|
|
648
|
+
* @param {Uint32Array | number[]} tool_ids
|
|
549
649
|
* @returns {number}
|
|
550
650
|
*/
|
|
551
651
|
compoundCut(target, tool_ids) {
|
|
652
|
+
const val2 = +target;
|
|
552
653
|
const ptr0 = passArray32ToWasm0(tool_ids, wasm.__wbindgen_malloc);
|
|
553
654
|
const len0 = WASM_VECTOR_LEN;
|
|
554
|
-
const ret = wasm.brepkernel_compoundCut(this.__wbg_ptr,
|
|
655
|
+
const ret = wasm.brepkernel_compoundCut(this.__wbg_ptr, val2, ptr0, len0);
|
|
555
656
|
if (ret[2]) {
|
|
556
657
|
throw takeFromExternrefTable0(ret[1]);
|
|
557
658
|
}
|
|
@@ -614,7 +715,7 @@ class BrepKernel {
|
|
|
614
715
|
* # Errors
|
|
615
716
|
*
|
|
616
717
|
* Returns an error if fewer than 4 non-coplanar points are provided.
|
|
617
|
-
* @param {Float64Array} coords
|
|
718
|
+
* @param {Float64Array | number[]} coords
|
|
618
719
|
* @returns {number}
|
|
619
720
|
*/
|
|
620
721
|
convexHull(coords) {
|
|
@@ -637,13 +738,14 @@ class BrepKernel {
|
|
|
637
738
|
* Returns an error if the solid handle is invalid, the matrix doesn't
|
|
638
739
|
* have 16 elements, or the matrix is singular.
|
|
639
740
|
* @param {number} solid
|
|
640
|
-
* @param {Float64Array} matrix
|
|
741
|
+
* @param {Float64Array | number[]} matrix
|
|
641
742
|
* @returns {number}
|
|
642
743
|
*/
|
|
643
744
|
copyAndTransformSolid(solid, matrix) {
|
|
745
|
+
const val2 = +solid;
|
|
644
746
|
const ptr0 = passArrayF64ToWasm0(matrix, wasm.__wbindgen_malloc);
|
|
645
747
|
const len0 = WASM_VECTOR_LEN;
|
|
646
|
-
const ret = wasm.brepkernel_copyAndTransformSolid(this.__wbg_ptr,
|
|
748
|
+
const ret = wasm.brepkernel_copyAndTransformSolid(this.__wbg_ptr, val2, ptr0, len0);
|
|
647
749
|
if (ret[2]) {
|
|
648
750
|
throw takeFromExternrefTable0(ret[1]);
|
|
649
751
|
}
|
|
@@ -829,13 +931,14 @@ class BrepKernel {
|
|
|
829
931
|
* `face_handles` is an array of face handles to remove.
|
|
830
932
|
* Returns a new solid handle.
|
|
831
933
|
* @param {number} solid
|
|
832
|
-
* @param {Uint32Array} face_handles
|
|
934
|
+
* @param {Uint32Array | number[]} face_handles
|
|
833
935
|
* @returns {number}
|
|
834
936
|
*/
|
|
835
937
|
defeature(solid, face_handles) {
|
|
938
|
+
const val2 = +solid;
|
|
836
939
|
const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
|
|
837
940
|
const len0 = WASM_VECTOR_LEN;
|
|
838
|
-
const ret = wasm.brepkernel_defeature(this.__wbg_ptr,
|
|
941
|
+
const ret = wasm.brepkernel_defeature(this.__wbg_ptr, val2, ptr0, len0);
|
|
839
942
|
if (ret[2]) {
|
|
840
943
|
throw takeFromExternrefTable0(ret[1]);
|
|
841
944
|
}
|
|
@@ -847,7 +950,7 @@ class BrepKernel {
|
|
|
847
950
|
* # Errors
|
|
848
951
|
*
|
|
849
952
|
* Returns an error if the buffer is malformed or reconstruction fails.
|
|
850
|
-
* @param {Uint8Array} data
|
|
953
|
+
* @param {Uint8Array | number[]} data
|
|
851
954
|
* @returns {number}
|
|
852
955
|
*/
|
|
853
956
|
deserializeSolid(data) {
|
|
@@ -941,7 +1044,7 @@ class BrepKernel {
|
|
|
941
1044
|
*
|
|
942
1045
|
* Returns an error if angle is zero or faces are invalid.
|
|
943
1046
|
* @param {number} solid
|
|
944
|
-
* @param {Uint32Array} face_handles
|
|
1047
|
+
* @param {Uint32Array | number[]} face_handles
|
|
945
1048
|
* @param {number} pull_x
|
|
946
1049
|
* @param {number} pull_y
|
|
947
1050
|
* @param {number} pull_z
|
|
@@ -952,9 +1055,17 @@ class BrepKernel {
|
|
|
952
1055
|
* @returns {number}
|
|
953
1056
|
*/
|
|
954
1057
|
draft(solid, face_handles, pull_x, pull_y, pull_z, neutral_x, neutral_y, neutral_z, angle_degrees) {
|
|
1058
|
+
const val2 = +solid;
|
|
1059
|
+
const val3 = +pull_x;
|
|
1060
|
+
const val4 = +pull_y;
|
|
1061
|
+
const val5 = +pull_z;
|
|
1062
|
+
const val6 = +neutral_x;
|
|
1063
|
+
const val7 = +neutral_y;
|
|
1064
|
+
const val8 = +neutral_z;
|
|
1065
|
+
const val9 = +angle_degrees;
|
|
955
1066
|
const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
|
|
956
1067
|
const len0 = WASM_VECTOR_LEN;
|
|
957
|
-
const ret = wasm.brepkernel_draft(this.__wbg_ptr,
|
|
1068
|
+
const ret = wasm.brepkernel_draft(this.__wbg_ptr, val2, ptr0, len0, val3, val4, val5, val6, val7, val8, val9);
|
|
958
1069
|
if (ret[2]) {
|
|
959
1070
|
throw takeFromExternrefTable0(ret[1]);
|
|
960
1071
|
}
|
|
@@ -1164,7 +1275,7 @@ class BrepKernel {
|
|
|
1164
1275
|
* # Errors
|
|
1165
1276
|
*
|
|
1166
1277
|
* Returns an error if a solid handle is invalid or export fails.
|
|
1167
|
-
* @param {Uint32Array} solids
|
|
1278
|
+
* @param {Uint32Array | number[]} solids
|
|
1168
1279
|
* @returns {Uint8Array}
|
|
1169
1280
|
*/
|
|
1170
1281
|
exportIgesSolids(solids) {
|
|
@@ -1393,21 +1504,48 @@ class BrepKernel {
|
|
|
1393
1504
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1394
1505
|
return v1;
|
|
1395
1506
|
}
|
|
1507
|
+
/**
|
|
1508
|
+
* Smooth a surface, staying within `tolerance` of it, with its boundary
|
|
1509
|
+
* held. A surface with no bumps to remove comes back unchanged.
|
|
1510
|
+
*
|
|
1511
|
+
* Returns a new face handle.
|
|
1512
|
+
*
|
|
1513
|
+
* # Errors
|
|
1514
|
+
*
|
|
1515
|
+
* Returns an error if the handle is invalid or `tolerance` is not positive.
|
|
1516
|
+
* @param {number} face
|
|
1517
|
+
* @param {number} tolerance
|
|
1518
|
+
* @returns {number}
|
|
1519
|
+
*/
|
|
1520
|
+
fairSurface(face, tolerance) {
|
|
1521
|
+
const ret = wasm.brepkernel_fairSurface(this.__wbg_ptr, face, tolerance);
|
|
1522
|
+
if (ret[2]) {
|
|
1523
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1524
|
+
}
|
|
1525
|
+
return ret[0] >>> 0;
|
|
1526
|
+
}
|
|
1396
1527
|
/**
|
|
1397
1528
|
* Fill a 4-sided boundary with a Coons patch surface.
|
|
1398
1529
|
*
|
|
1399
1530
|
* `boundary_coords` is flat `[x,y,z, ...]` for all 4 curves concatenated.
|
|
1400
1531
|
* `curve_lengths` is `[n0, n1, n2, n3]` — number of points per curve.
|
|
1401
1532
|
* Returns a face handle.
|
|
1402
|
-
* @param {Float64Array} boundary_coords
|
|
1403
|
-
* @param {Uint32Array} curve_lengths
|
|
1533
|
+
* @param {Float64Array | number[]} boundary_coords
|
|
1534
|
+
* @param {Uint32Array | number[]} curve_lengths
|
|
1404
1535
|
* @returns {number}
|
|
1405
1536
|
*/
|
|
1406
1537
|
fillCoonsPatch(boundary_coords, curve_lengths) {
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1538
|
+
let ptr0, len0, ptr1, len1;
|
|
1539
|
+
try {
|
|
1540
|
+
ptr0 = passArrayF64ToWasm0(boundary_coords, wasm.__wbindgen_malloc);
|
|
1541
|
+
len0 = WASM_VECTOR_LEN;
|
|
1542
|
+
ptr1 = passArray32ToWasm0(curve_lengths, wasm.__wbindgen_malloc);
|
|
1543
|
+
len1 = WASM_VECTOR_LEN;
|
|
1544
|
+
} catch (e) {
|
|
1545
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 4, 4); }
|
|
1546
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
|
|
1547
|
+
throw e;
|
|
1548
|
+
}
|
|
1411
1549
|
const ret = wasm.brepkernel_fillCoonsPatch(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1412
1550
|
if (ret[2]) {
|
|
1413
1551
|
throw takeFromExternrefTable0(ret[1]);
|
|
@@ -1420,20 +1558,60 @@ class BrepKernel {
|
|
|
1420
1558
|
* `coords` is a flat array `[x,y, x,y, ...]`.
|
|
1421
1559
|
* `radius` is the fillet radius.
|
|
1422
1560
|
* Returns a flat array of the filleted polygon coordinates.
|
|
1423
|
-
* @param {Float64Array} coords
|
|
1561
|
+
* @param {Float64Array | number[]} coords
|
|
1424
1562
|
* @param {number} radius
|
|
1425
1563
|
* @returns {Float64Array}
|
|
1426
1564
|
*/
|
|
1427
1565
|
fillet2d(coords, radius) {
|
|
1566
|
+
const val2 = +radius;
|
|
1428
1567
|
const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
|
|
1429
1568
|
const len0 = WASM_VECTOR_LEN;
|
|
1430
|
-
const ret = wasm.brepkernel_fillet2d(this.__wbg_ptr, ptr0, len0,
|
|
1569
|
+
const ret = wasm.brepkernel_fillet2d(this.__wbg_ptr, ptr0, len0, val2);
|
|
1431
1570
|
if (ret[3]) {
|
|
1432
1571
|
throw takeFromExternrefTable0(ret[2]);
|
|
1433
1572
|
}
|
|
1434
|
-
var
|
|
1573
|
+
var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
1435
1574
|
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
1436
|
-
return
|
|
1575
|
+
return v3;
|
|
1576
|
+
}
|
|
1577
|
+
/**
|
|
1578
|
+
* Fillet edges with options at corners where three of them meet: how far
|
|
1579
|
+
* back along each edge its round stops, and what closes the hole that
|
|
1580
|
+
* leaves. `corners_json` is an array of
|
|
1581
|
+
* `{"vertex": h, "setbacks": [{"edge": h, "distance": d}, ...], "corner": "rolling" | "g2"}`,
|
|
1582
|
+
* with `setbacks` and `corner` optional: no set-backs and `"g2"` stops each
|
|
1583
|
+
* round one radius past where a ball would.
|
|
1584
|
+
*
|
|
1585
|
+
* # Errors
|
|
1586
|
+
*
|
|
1587
|
+
* Returns an error if a handle is invalid, the JSON is malformed, the blend
|
|
1588
|
+
* computation fails, or a corner is not three straight rounds between flat
|
|
1589
|
+
* faces with set-backs past the ball and short of each edge's far end.
|
|
1590
|
+
* @param {number} solid
|
|
1591
|
+
* @param {Uint32Array | number[]} edge_handles
|
|
1592
|
+
* @param {number} radius
|
|
1593
|
+
* @param {string} corners_json
|
|
1594
|
+
* @returns {number}
|
|
1595
|
+
*/
|
|
1596
|
+
filletV2Corners(solid, edge_handles, radius, corners_json) {
|
|
1597
|
+
const val3 = +solid;
|
|
1598
|
+
const val4 = +radius;
|
|
1599
|
+
let ptr0, len0, ptr1, len1;
|
|
1600
|
+
try {
|
|
1601
|
+
ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
1602
|
+
len0 = WASM_VECTOR_LEN;
|
|
1603
|
+
ptr1 = passStringToWasm0(corners_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1604
|
+
len1 = WASM_VECTOR_LEN;
|
|
1605
|
+
} catch (e) {
|
|
1606
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
1607
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 4, 4); }
|
|
1608
|
+
throw e;
|
|
1609
|
+
}
|
|
1610
|
+
const ret = wasm.brepkernel_filletV2Corners(this.__wbg_ptr, val3, ptr0, len0, val4, ptr1, len1);
|
|
1611
|
+
if (ret[2]) {
|
|
1612
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1613
|
+
}
|
|
1614
|
+
return ret[0] >>> 0;
|
|
1437
1615
|
}
|
|
1438
1616
|
/**
|
|
1439
1617
|
* Fillet edges using the v2 walking-based blend engine.
|
|
@@ -1445,14 +1623,16 @@ class BrepKernel {
|
|
|
1445
1623
|
* Returns an error if the solid or edge handles are invalid, the blend
|
|
1446
1624
|
* computation fails, or any edge could not be blended.
|
|
1447
1625
|
* @param {number} solid
|
|
1448
|
-
* @param {Uint32Array} edge_handles
|
|
1626
|
+
* @param {Uint32Array | number[]} edge_handles
|
|
1449
1627
|
* @param {number} radius
|
|
1450
1628
|
* @returns {number}
|
|
1451
1629
|
*/
|
|
1452
1630
|
filletV2(solid, edge_handles, radius) {
|
|
1631
|
+
const val2 = +solid;
|
|
1632
|
+
const val3 = +radius;
|
|
1453
1633
|
const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
1454
1634
|
const len0 = WASM_VECTOR_LEN;
|
|
1455
|
-
const ret = wasm.brepkernel_filletV2(this.__wbg_ptr,
|
|
1635
|
+
const ret = wasm.brepkernel_filletV2(this.__wbg_ptr, val2, ptr0, len0, val3);
|
|
1456
1636
|
if (ret[2]) {
|
|
1457
1637
|
throw takeFromExternrefTable0(ret[1]);
|
|
1458
1638
|
}
|
|
@@ -1472,9 +1652,10 @@ class BrepKernel {
|
|
|
1472
1652
|
* @returns {number}
|
|
1473
1653
|
*/
|
|
1474
1654
|
filletVariable(solid, json) {
|
|
1655
|
+
const val2 = +solid;
|
|
1475
1656
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1476
1657
|
const len0 = WASM_VECTOR_LEN;
|
|
1477
|
-
const ret = wasm.brepkernel_filletVariable(this.__wbg_ptr,
|
|
1658
|
+
const ret = wasm.brepkernel_filletVariable(this.__wbg_ptr, val2, ptr0, len0);
|
|
1478
1659
|
if (ret[2]) {
|
|
1479
1660
|
throw takeFromExternrefTable0(ret[1]);
|
|
1480
1661
|
}
|
|
@@ -1494,14 +1675,16 @@ class BrepKernel {
|
|
|
1494
1675
|
* Returns an error if a handle is invalid, the radius is non-positive, or
|
|
1495
1676
|
* the fillet fails.
|
|
1496
1677
|
* @param {number} solid
|
|
1497
|
-
* @param {Uint32Array} edge_handles
|
|
1678
|
+
* @param {Uint32Array | number[]} edge_handles
|
|
1498
1679
|
* @param {number} radius
|
|
1499
1680
|
* @returns {any}
|
|
1500
1681
|
*/
|
|
1501
1682
|
filletWithEvolution(solid, edge_handles, radius) {
|
|
1683
|
+
const val2 = +solid;
|
|
1684
|
+
const val3 = +radius;
|
|
1502
1685
|
const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
1503
1686
|
const len0 = WASM_VECTOR_LEN;
|
|
1504
|
-
const ret = wasm.brepkernel_filletWithEvolution(this.__wbg_ptr,
|
|
1687
|
+
const ret = wasm.brepkernel_filletWithEvolution(this.__wbg_ptr, val2, ptr0, len0, val3);
|
|
1505
1688
|
if (ret[2]) {
|
|
1506
1689
|
throw takeFromExternrefTable0(ret[1]);
|
|
1507
1690
|
}
|
|
@@ -1517,14 +1700,16 @@ class BrepKernel {
|
|
|
1517
1700
|
* Returns an error if radius is non-positive, edges are invalid, or no
|
|
1518
1701
|
* fillet engine can produce a valid changed solid.
|
|
1519
1702
|
* @param {number} solid
|
|
1520
|
-
* @param {Uint32Array} edge_handles
|
|
1703
|
+
* @param {Uint32Array | number[]} edge_handles
|
|
1521
1704
|
* @param {number} radius
|
|
1522
1705
|
* @returns {number}
|
|
1523
1706
|
*/
|
|
1524
1707
|
fillet(solid, edge_handles, radius) {
|
|
1708
|
+
const val2 = +solid;
|
|
1709
|
+
const val3 = +radius;
|
|
1525
1710
|
const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
1526
1711
|
const len0 = WASM_VECTOR_LEN;
|
|
1527
|
-
const ret = wasm.brepkernel_fillet(this.__wbg_ptr,
|
|
1712
|
+
const ret = wasm.brepkernel_fillet(this.__wbg_ptr, val2, ptr0, len0, val3);
|
|
1528
1713
|
if (ret[2]) {
|
|
1529
1714
|
throw takeFromExternrefTable0(ret[1]);
|
|
1530
1715
|
}
|
|
@@ -1582,7 +1767,7 @@ class BrepKernel {
|
|
|
1582
1767
|
*
|
|
1583
1768
|
* Returns an error if any solid handle is invalid, the list is empty,
|
|
1584
1769
|
* or a boolean operation produces an empty or non-manifold result.
|
|
1585
|
-
* @param {Uint32Array} solid_handles
|
|
1770
|
+
* @param {Uint32Array | number[]} solid_handles
|
|
1586
1771
|
* @returns {number}
|
|
1587
1772
|
*/
|
|
1588
1773
|
fuseAll(solid_handles) {
|
|
@@ -2263,29 +2448,43 @@ class BrepKernel {
|
|
|
2263
2448
|
* profile, or a degenerate path.
|
|
2264
2449
|
* @param {number} face
|
|
2265
2450
|
* @param {number} spine_degree
|
|
2266
|
-
* @param {Float64Array} spine_knots
|
|
2267
|
-
* @param {Float64Array} spine_control_points
|
|
2268
|
-
* @param {Float64Array} spine_weights
|
|
2451
|
+
* @param {Float64Array | number[]} spine_knots
|
|
2452
|
+
* @param {Float64Array | number[]} spine_control_points
|
|
2453
|
+
* @param {Float64Array | number[]} spine_weights
|
|
2269
2454
|
* @param {number} aux_degree
|
|
2270
|
-
* @param {Float64Array} aux_knots
|
|
2271
|
-
* @param {Float64Array} aux_control_points
|
|
2272
|
-
* @param {Float64Array} aux_weights
|
|
2455
|
+
* @param {Float64Array | number[]} aux_knots
|
|
2456
|
+
* @param {Float64Array | number[]} aux_control_points
|
|
2457
|
+
* @param {Float64Array | number[]} aux_weights
|
|
2273
2458
|
* @returns {number}
|
|
2274
2459
|
*/
|
|
2275
2460
|
guidedSweep(face, spine_degree, spine_knots, spine_control_points, spine_weights, aux_degree, aux_knots, aux_control_points, aux_weights) {
|
|
2276
|
-
const
|
|
2277
|
-
const
|
|
2278
|
-
const
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2461
|
+
const val7 = +face;
|
|
2462
|
+
const val8 = +spine_degree;
|
|
2463
|
+
const val9 = +aux_degree;
|
|
2464
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5;
|
|
2465
|
+
try {
|
|
2466
|
+
ptr0 = passArrayF64ToWasm0(spine_knots, wasm.__wbindgen_malloc);
|
|
2467
|
+
len0 = WASM_VECTOR_LEN;
|
|
2468
|
+
ptr1 = passArrayF64ToWasm0(spine_control_points, wasm.__wbindgen_malloc);
|
|
2469
|
+
len1 = WASM_VECTOR_LEN;
|
|
2470
|
+
ptr2 = passArrayF64ToWasm0(spine_weights, wasm.__wbindgen_malloc);
|
|
2471
|
+
len2 = WASM_VECTOR_LEN;
|
|
2472
|
+
ptr3 = passArrayF64ToWasm0(aux_knots, wasm.__wbindgen_malloc);
|
|
2473
|
+
len3 = WASM_VECTOR_LEN;
|
|
2474
|
+
ptr4 = passArrayF64ToWasm0(aux_control_points, wasm.__wbindgen_malloc);
|
|
2475
|
+
len4 = WASM_VECTOR_LEN;
|
|
2476
|
+
ptr5 = passArrayF64ToWasm0(aux_weights, wasm.__wbindgen_malloc);
|
|
2477
|
+
len5 = WASM_VECTOR_LEN;
|
|
2478
|
+
} catch (e) {
|
|
2479
|
+
if (ptr5) { wasm.__wbindgen_free(ptr5, len5 * 8, 8); }
|
|
2480
|
+
if (ptr4) { wasm.__wbindgen_free(ptr4, len4 * 8, 8); }
|
|
2481
|
+
if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 8, 8); }
|
|
2482
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 8, 8); }
|
|
2483
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
|
|
2484
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
|
|
2485
|
+
throw e;
|
|
2486
|
+
}
|
|
2487
|
+
const ret = wasm.brepkernel_guidedSweep(this.__wbg_ptr, val7, val8, ptr0, len0, ptr1, len1, ptr2, len2, val9, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
2289
2488
|
if (ret[2]) {
|
|
2290
2489
|
throw takeFromExternrefTable0(ret[1]);
|
|
2291
2490
|
}
|
|
@@ -2341,7 +2540,7 @@ class BrepKernel {
|
|
|
2341
2540
|
* # Errors
|
|
2342
2541
|
*
|
|
2343
2542
|
* Returns an error if the 3MF data is malformed.
|
|
2344
|
-
* @param {Uint8Array} data
|
|
2543
|
+
* @param {Uint8Array | number[]} data
|
|
2345
2544
|
* @returns {Uint32Array}
|
|
2346
2545
|
*/
|
|
2347
2546
|
import3mf(data) {
|
|
@@ -2361,7 +2560,7 @@ class BrepKernel {
|
|
|
2361
2560
|
* # Errors
|
|
2362
2561
|
*
|
|
2363
2562
|
* Returns an error if the file is malformed or mesh import fails.
|
|
2364
|
-
* @param {Uint8Array} data
|
|
2563
|
+
* @param {Uint8Array | number[]} data
|
|
2365
2564
|
* @returns {number}
|
|
2366
2565
|
*/
|
|
2367
2566
|
importGlb(data) {
|
|
@@ -2379,7 +2578,7 @@ class BrepKernel {
|
|
|
2379
2578
|
* # Errors
|
|
2380
2579
|
*
|
|
2381
2580
|
* Returns an error if the IGES data is malformed.
|
|
2382
|
-
* @param {Uint8Array} data
|
|
2581
|
+
* @param {Uint8Array | number[]} data
|
|
2383
2582
|
* @returns {Uint32Array}
|
|
2384
2583
|
*/
|
|
2385
2584
|
importIges(data) {
|
|
@@ -2403,15 +2602,22 @@ class BrepKernel {
|
|
|
2403
2602
|
* # Errors
|
|
2404
2603
|
*
|
|
2405
2604
|
* Returns an error if the arrays are malformed or mesh import fails.
|
|
2406
|
-
* @param {Float64Array} positions
|
|
2407
|
-
* @param {Uint32Array} indices
|
|
2605
|
+
* @param {Float64Array | number[]} positions
|
|
2606
|
+
* @param {Uint32Array | number[]} indices
|
|
2408
2607
|
* @returns {number}
|
|
2409
2608
|
*/
|
|
2410
2609
|
importIndexedMesh(positions, indices) {
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2610
|
+
let ptr0, len0, ptr1, len1;
|
|
2611
|
+
try {
|
|
2612
|
+
ptr0 = passArrayF64ToWasm0(positions, wasm.__wbindgen_malloc);
|
|
2613
|
+
len0 = WASM_VECTOR_LEN;
|
|
2614
|
+
ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
2615
|
+
len1 = WASM_VECTOR_LEN;
|
|
2616
|
+
} catch (e) {
|
|
2617
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 4, 4); }
|
|
2618
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
|
|
2619
|
+
throw e;
|
|
2620
|
+
}
|
|
2415
2621
|
const ret = wasm.brepkernel_importIndexedMesh(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
2416
2622
|
if (ret[2]) {
|
|
2417
2623
|
throw takeFromExternrefTable0(ret[1]);
|
|
@@ -2424,7 +2630,7 @@ class BrepKernel {
|
|
|
2424
2630
|
* # Errors
|
|
2425
2631
|
*
|
|
2426
2632
|
* Returns an error if the file is malformed or mesh import fails.
|
|
2427
|
-
* @param {Uint8Array} data
|
|
2633
|
+
* @param {Uint8Array | number[]} data
|
|
2428
2634
|
* @returns {number}
|
|
2429
2635
|
*/
|
|
2430
2636
|
importObj(data) {
|
|
@@ -2444,7 +2650,7 @@ class BrepKernel {
|
|
|
2444
2650
|
* # Errors
|
|
2445
2651
|
*
|
|
2446
2652
|
* Returns an error if the STEP data is malformed.
|
|
2447
|
-
* @param {Uint8Array} data
|
|
2653
|
+
* @param {Uint8Array | number[]} data
|
|
2448
2654
|
* @returns {Uint32Array}
|
|
2449
2655
|
*/
|
|
2450
2656
|
importStep(data) {
|
|
@@ -2467,7 +2673,7 @@ class BrepKernel {
|
|
|
2467
2673
|
* # Errors
|
|
2468
2674
|
*
|
|
2469
2675
|
* Returns an error if the STL data is malformed or empty.
|
|
2470
|
-
* @param {Uint8Array} data
|
|
2676
|
+
* @param {Uint8Array | number[]} data
|
|
2471
2677
|
* @returns {number}
|
|
2472
2678
|
*/
|
|
2473
2679
|
importStl(data) {
|
|
@@ -2491,16 +2697,24 @@ class BrepKernel {
|
|
|
2491
2697
|
* along its marks, or the result would not be a valid solid of the same
|
|
2492
2698
|
* volume.
|
|
2493
2699
|
* @param {number} solid
|
|
2494
|
-
* @param {Uint32Array} face_handles
|
|
2495
|
-
* @param {Uint32Array} edge_handles
|
|
2700
|
+
* @param {Uint32Array | number[]} face_handles
|
|
2701
|
+
* @param {Uint32Array | number[]} edge_handles
|
|
2496
2702
|
* @returns {number}
|
|
2497
2703
|
*/
|
|
2498
2704
|
imprintFaces(solid, face_handles, edge_handles) {
|
|
2499
|
-
const
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2705
|
+
const val3 = +solid;
|
|
2706
|
+
let ptr0, len0, ptr1, len1;
|
|
2707
|
+
try {
|
|
2708
|
+
ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
|
|
2709
|
+
len0 = WASM_VECTOR_LEN;
|
|
2710
|
+
ptr1 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
2711
|
+
len1 = WASM_VECTOR_LEN;
|
|
2712
|
+
} catch (e) {
|
|
2713
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 4, 4); }
|
|
2714
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 4, 4); }
|
|
2715
|
+
throw e;
|
|
2716
|
+
}
|
|
2717
|
+
const ret = wasm.brepkernel_imprintFaces(this.__wbg_ptr, val3, ptr0, len0, ptr1, len1);
|
|
2504
2718
|
if (ret[2]) {
|
|
2505
2719
|
throw takeFromExternrefTable0(ret[1]);
|
|
2506
2720
|
}
|
|
@@ -2511,14 +2725,15 @@ class BrepKernel {
|
|
|
2511
2725
|
*
|
|
2512
2726
|
* Uses chord-length parameterization with the given degree.
|
|
2513
2727
|
* Returns an edge handle (`u32`).
|
|
2514
|
-
* @param {Float64Array} coords
|
|
2728
|
+
* @param {Float64Array | number[]} coords
|
|
2515
2729
|
* @param {number} degree
|
|
2516
2730
|
* @returns {number}
|
|
2517
2731
|
*/
|
|
2518
2732
|
interpolatePoints(coords, degree) {
|
|
2733
|
+
const val2 = +degree;
|
|
2519
2734
|
const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
|
|
2520
2735
|
const len0 = WASM_VECTOR_LEN;
|
|
2521
|
-
const ret = wasm.brepkernel_interpolatePoints(this.__wbg_ptr, ptr0, len0,
|
|
2736
|
+
const ret = wasm.brepkernel_interpolatePoints(this.__wbg_ptr, ptr0, len0, val2);
|
|
2522
2737
|
if (ret[2]) {
|
|
2523
2738
|
throw takeFromExternrefTable0(ret[1]);
|
|
2524
2739
|
}
|
|
@@ -2529,7 +2744,7 @@ class BrepKernel {
|
|
|
2529
2744
|
*
|
|
2530
2745
|
* `coords` is a flat array `[x,y,z, ...]` of `rows * cols` points.
|
|
2531
2746
|
* Returns a face handle.
|
|
2532
|
-
* @param {Float64Array} coords
|
|
2747
|
+
* @param {Float64Array | number[]} coords
|
|
2533
2748
|
* @param {number} rows
|
|
2534
2749
|
* @param {number} cols
|
|
2535
2750
|
* @param {number} degree_u
|
|
@@ -2537,9 +2752,13 @@ class BrepKernel {
|
|
|
2537
2752
|
* @returns {number}
|
|
2538
2753
|
*/
|
|
2539
2754
|
interpolateSurface(coords, rows, cols, degree_u, degree_v) {
|
|
2755
|
+
const val2 = +rows;
|
|
2756
|
+
const val3 = +cols;
|
|
2757
|
+
const val4 = +degree_u;
|
|
2758
|
+
const val5 = +degree_v;
|
|
2540
2759
|
const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
|
|
2541
2760
|
const len0 = WASM_VECTOR_LEN;
|
|
2542
|
-
const ret = wasm.brepkernel_interpolateSurface(this.__wbg_ptr, ptr0, len0,
|
|
2761
|
+
const ret = wasm.brepkernel_interpolateSurface(this.__wbg_ptr, ptr0, len0, val2, val3, val4, val5);
|
|
2543
2762
|
if (ret[2]) {
|
|
2544
2763
|
throw takeFromExternrefTable0(ret[1]);
|
|
2545
2764
|
}
|
|
@@ -2553,15 +2772,22 @@ class BrepKernel {
|
|
|
2553
2772
|
* or an empty array if they don't intersect.
|
|
2554
2773
|
*
|
|
2555
2774
|
* Uses the Sutherland-Hodgman algorithm (convex clipper).
|
|
2556
|
-
* @param {Float64Array} coords_a
|
|
2557
|
-
* @param {Float64Array} coords_b
|
|
2775
|
+
* @param {Float64Array | number[]} coords_a
|
|
2776
|
+
* @param {Float64Array | number[]} coords_b
|
|
2558
2777
|
* @returns {Float64Array}
|
|
2559
2778
|
*/
|
|
2560
2779
|
intersectPolygons2d(coords_a, coords_b) {
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2780
|
+
let ptr0, len0, ptr1, len1;
|
|
2781
|
+
try {
|
|
2782
|
+
ptr0 = passArrayF64ToWasm0(coords_a, wasm.__wbindgen_malloc);
|
|
2783
|
+
len0 = WASM_VECTOR_LEN;
|
|
2784
|
+
ptr1 = passArrayF64ToWasm0(coords_b, wasm.__wbindgen_malloc);
|
|
2785
|
+
len1 = WASM_VECTOR_LEN;
|
|
2786
|
+
} catch (e) {
|
|
2787
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
|
|
2788
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
|
|
2789
|
+
throw e;
|
|
2790
|
+
}
|
|
2565
2791
|
const ret = wasm.brepkernel_intersectPolygons2d(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
2566
2792
|
if (ret[3]) {
|
|
2567
2793
|
throw takeFromExternrefTable0(ret[2]);
|
|
@@ -2666,7 +2892,7 @@ class BrepKernel {
|
|
|
2666
2892
|
*
|
|
2667
2893
|
* Returns an edge handle (`u32`).
|
|
2668
2894
|
* @param {number} curve_type
|
|
2669
|
-
* @param {Float64Array} curve_params
|
|
2895
|
+
* @param {Float64Array | number[]} curve_params
|
|
2670
2896
|
* @param {number} origin_x
|
|
2671
2897
|
* @param {number} origin_y
|
|
2672
2898
|
* @param {number} origin_z
|
|
@@ -2681,9 +2907,21 @@ class BrepKernel {
|
|
|
2681
2907
|
* @returns {number}
|
|
2682
2908
|
*/
|
|
2683
2909
|
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) {
|
|
2910
|
+
const val2 = +curve_type;
|
|
2911
|
+
const val3 = +origin_x;
|
|
2912
|
+
const val4 = +origin_y;
|
|
2913
|
+
const val5 = +origin_z;
|
|
2914
|
+
const val6 = +x_axis_x;
|
|
2915
|
+
const val7 = +x_axis_y;
|
|
2916
|
+
const val8 = +x_axis_z;
|
|
2917
|
+
const val9 = +normal_x;
|
|
2918
|
+
const val10 = +normal_y;
|
|
2919
|
+
const val11 = +normal_z;
|
|
2920
|
+
const val12 = +t_start;
|
|
2921
|
+
const val13 = +t_end;
|
|
2684
2922
|
const ptr0 = passArrayF64ToWasm0(curve_params, wasm.__wbindgen_malloc);
|
|
2685
2923
|
const len0 = WASM_VECTOR_LEN;
|
|
2686
|
-
const ret = wasm.brepkernel_liftCurve2dToPlane(this.__wbg_ptr,
|
|
2924
|
+
const ret = wasm.brepkernel_liftCurve2dToPlane(this.__wbg_ptr, val2, ptr0, len0, val3, val4, val5, val6, val7, val8, val9, val10, val11, val12, val13);
|
|
2687
2925
|
if (ret[2]) {
|
|
2688
2926
|
throw takeFromExternrefTable0(ret[1]);
|
|
2689
2927
|
}
|
|
@@ -2725,7 +2963,7 @@ class BrepKernel {
|
|
|
2725
2963
|
*
|
|
2726
2964
|
* Returns an error if fewer than 2 profiles are given, profiles have
|
|
2727
2965
|
* different vertex counts, or surface fitting fails.
|
|
2728
|
-
* @param {Uint32Array} faces
|
|
2966
|
+
* @param {Uint32Array | number[]} faces
|
|
2729
2967
|
* @returns {number}
|
|
2730
2968
|
*/
|
|
2731
2969
|
loftSmooth(faces) {
|
|
@@ -2747,7 +2985,7 @@ class BrepKernel {
|
|
|
2747
2985
|
* Returns an error if a handle is invalid, fewer than two wires are given,
|
|
2748
2986
|
* their edge counts differ, a wire is closed, meets itself or breaks, two
|
|
2749
2987
|
* wires touch where they would be joined, or two lines cross or fold over.
|
|
2750
|
-
* @param {Uint32Array} wires
|
|
2988
|
+
* @param {Uint32Array | number[]} wires
|
|
2751
2989
|
* @returns {number}
|
|
2752
2990
|
*/
|
|
2753
2991
|
loftWires(wires) {
|
|
@@ -2769,15 +3007,22 @@ class BrepKernel {
|
|
|
2769
3007
|
* - `solid: bool` — true (default) returns a solid handle; false returns
|
|
2770
3008
|
* a shell handle holding the loft's faces without the caps on its end
|
|
2771
3009
|
* profiles
|
|
2772
|
-
* @param {Uint32Array} faces
|
|
3010
|
+
* @param {Uint32Array | number[]} faces
|
|
2773
3011
|
* @param {string} options
|
|
2774
3012
|
* @returns {number}
|
|
2775
3013
|
*/
|
|
2776
3014
|
loftWithOptions(faces, options) {
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
3015
|
+
let ptr0, len0, ptr1, len1;
|
|
3016
|
+
try {
|
|
3017
|
+
ptr0 = passArray32ToWasm0(faces, wasm.__wbindgen_malloc);
|
|
3018
|
+
len0 = WASM_VECTOR_LEN;
|
|
3019
|
+
ptr1 = passStringToWasm0(options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3020
|
+
len1 = WASM_VECTOR_LEN;
|
|
3021
|
+
} catch (e) {
|
|
3022
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
3023
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 4, 4); }
|
|
3024
|
+
throw e;
|
|
3025
|
+
}
|
|
2781
3026
|
const ret = wasm.brepkernel_loftWithOptions(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
2782
3027
|
if (ret[2]) {
|
|
2783
3028
|
throw takeFromExternrefTable0(ret[1]);
|
|
@@ -2793,7 +3038,7 @@ class BrepKernel {
|
|
|
2793
3038
|
*
|
|
2794
3039
|
* Returns an error if fewer than 2 faces or profiles have
|
|
2795
3040
|
* different vertex counts.
|
|
2796
|
-
* @param {Uint32Array} faces
|
|
3041
|
+
* @param {Uint32Array | number[]} faces
|
|
2797
3042
|
* @returns {number}
|
|
2798
3043
|
*/
|
|
2799
3044
|
loft(faces) {
|
|
@@ -2963,7 +3208,7 @@ class BrepKernel {
|
|
|
2963
3208
|
* Create a compound from multiple solid handles.
|
|
2964
3209
|
*
|
|
2965
3210
|
* Returns a compound handle (stored as `u32`).
|
|
2966
|
-
* @param {Uint32Array} solid_handles
|
|
3211
|
+
* @param {Uint32Array | number[]} solid_handles
|
|
2967
3212
|
* @returns {number}
|
|
2968
3213
|
*/
|
|
2969
3214
|
makeCompound(solid_handles) {
|
|
@@ -3199,19 +3444,34 @@ class BrepKernel {
|
|
|
3199
3444
|
* @param {number} end_y
|
|
3200
3445
|
* @param {number} end_z
|
|
3201
3446
|
* @param {number} degree
|
|
3202
|
-
* @param {Float64Array} knots
|
|
3203
|
-
* @param {Float64Array} control_points
|
|
3204
|
-
* @param {Float64Array} weights
|
|
3447
|
+
* @param {Float64Array | number[]} knots
|
|
3448
|
+
* @param {Float64Array | number[]} control_points
|
|
3449
|
+
* @param {Float64Array | number[]} weights
|
|
3205
3450
|
* @returns {number}
|
|
3206
3451
|
*/
|
|
3207
3452
|
makeNurbsEdge(start_x, start_y, start_z, end_x, end_y, end_z, degree, knots, control_points, weights) {
|
|
3208
|
-
const
|
|
3209
|
-
const
|
|
3210
|
-
const
|
|
3211
|
-
const
|
|
3212
|
-
const
|
|
3213
|
-
const
|
|
3214
|
-
const
|
|
3453
|
+
const val4 = +start_x;
|
|
3454
|
+
const val5 = +start_y;
|
|
3455
|
+
const val6 = +start_z;
|
|
3456
|
+
const val7 = +end_x;
|
|
3457
|
+
const val8 = +end_y;
|
|
3458
|
+
const val9 = +end_z;
|
|
3459
|
+
const val10 = +degree;
|
|
3460
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
3461
|
+
try {
|
|
3462
|
+
ptr0 = passArrayF64ToWasm0(knots, wasm.__wbindgen_malloc);
|
|
3463
|
+
len0 = WASM_VECTOR_LEN;
|
|
3464
|
+
ptr1 = passArrayF64ToWasm0(control_points, wasm.__wbindgen_malloc);
|
|
3465
|
+
len1 = WASM_VECTOR_LEN;
|
|
3466
|
+
ptr2 = passArrayF64ToWasm0(weights, wasm.__wbindgen_malloc);
|
|
3467
|
+
len2 = WASM_VECTOR_LEN;
|
|
3468
|
+
} catch (e) {
|
|
3469
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 8, 8); }
|
|
3470
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
|
|
3471
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
|
|
3472
|
+
throw e;
|
|
3473
|
+
}
|
|
3474
|
+
const ret = wasm.brepkernel_makeNurbsEdge(this.__wbg_ptr, val4, val5, val6, val7, val8, val9, val10, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
3215
3475
|
if (ret[2]) {
|
|
3216
3476
|
throw takeFromExternrefTable0(ret[1]);
|
|
3217
3477
|
}
|
|
@@ -3239,7 +3499,7 @@ class BrepKernel {
|
|
|
3239
3499
|
* Create a closed polygon wire from flat coordinates.
|
|
3240
3500
|
*
|
|
3241
3501
|
* Returns a wire handle.
|
|
3242
|
-
* @param {Float64Array} coords
|
|
3502
|
+
* @param {Float64Array | number[]} coords
|
|
3243
3503
|
* @returns {number}
|
|
3244
3504
|
*/
|
|
3245
3505
|
makePolygonWire(coords) {
|
|
@@ -3261,7 +3521,7 @@ class BrepKernel {
|
|
|
3261
3521
|
*
|
|
3262
3522
|
* Returns an error if `coords` length is not a multiple of 3,
|
|
3263
3523
|
* fewer than 3 points are provided, or the face normal is degenerate.
|
|
3264
|
-
* @param {Float64Array} coords
|
|
3524
|
+
* @param {Float64Array | number[]} coords
|
|
3265
3525
|
* @returns {number}
|
|
3266
3526
|
*/
|
|
3267
3527
|
makePolygon(coords) {
|
|
@@ -3313,7 +3573,7 @@ class BrepKernel {
|
|
|
3313
3573
|
*
|
|
3314
3574
|
* Alias for `sewFaces` with a default tolerance. This is the equivalent
|
|
3315
3575
|
* of sewing faces into a closed shell and building a solid.
|
|
3316
|
-
* @param {Uint32Array} face_handles
|
|
3576
|
+
* @param {Uint32Array | number[]} face_handles
|
|
3317
3577
|
* @returns {number}
|
|
3318
3578
|
*/
|
|
3319
3579
|
makeSolid(face_handles) {
|
|
@@ -3410,14 +3670,46 @@ class BrepKernel {
|
|
|
3410
3670
|
* Create a closed wire from an ordered array of edge handles.
|
|
3411
3671
|
*
|
|
3412
3672
|
* Returns a wire handle (`u32`).
|
|
3413
|
-
* @param {Uint32Array} edge_handles
|
|
3673
|
+
* @param {Uint32Array | number[]} edge_handles
|
|
3414
3674
|
* @param {boolean} closed
|
|
3415
3675
|
* @returns {number}
|
|
3416
3676
|
*/
|
|
3417
3677
|
makeWire(edge_handles, closed) {
|
|
3678
|
+
const val2 = +closed;
|
|
3418
3679
|
const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
3419
3680
|
const len0 = WASM_VECTOR_LEN;
|
|
3420
|
-
const ret = wasm.brepkernel_makeWire(this.__wbg_ptr, ptr0, len0,
|
|
3681
|
+
const ret = wasm.brepkernel_makeWire(this.__wbg_ptr, ptr0, len0, val2);
|
|
3682
|
+
if (ret[2]) {
|
|
3683
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3684
|
+
}
|
|
3685
|
+
return ret[0] >>> 0;
|
|
3686
|
+
}
|
|
3687
|
+
/**
|
|
3688
|
+
* Move one surface's edge on to another's at G0, G1 or G2, keeping the
|
|
3689
|
+
* rest of the surface as close as the move allows.
|
|
3690
|
+
*
|
|
3691
|
+
* `options` is JSON: `{ "continuity": "g0" | "g1" | "g2", "targetFace"?: face }`.
|
|
3692
|
+
* `targetFace` names the face a solid's edge is matched to, since it
|
|
3693
|
+
* bounds two. Returns a new face handle.
|
|
3694
|
+
*
|
|
3695
|
+
* # Errors
|
|
3696
|
+
*
|
|
3697
|
+
* Returns an error if a handle or the options are invalid, `edge` is not on
|
|
3698
|
+
* the face's outer boundary, or the target bounds no face or several when
|
|
3699
|
+
* a surface is needed and none is named.
|
|
3700
|
+
* @param {number} face
|
|
3701
|
+
* @param {number} edge
|
|
3702
|
+
* @param {number} target_edge
|
|
3703
|
+
* @param {string} options
|
|
3704
|
+
* @returns {number}
|
|
3705
|
+
*/
|
|
3706
|
+
matchSurface(face, edge, target_edge, options) {
|
|
3707
|
+
const val2 = +face;
|
|
3708
|
+
const val3 = +edge;
|
|
3709
|
+
const val4 = +target_edge;
|
|
3710
|
+
const ptr0 = passStringToWasm0(options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3711
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3712
|
+
const ret = wasm.brepkernel_matchSurface(this.__wbg_ptr, val2, val3, val4, ptr0, len0);
|
|
3421
3713
|
if (ret[2]) {
|
|
3422
3714
|
throw takeFromExternrefTable0(ret[1]);
|
|
3423
3715
|
}
|
|
@@ -3479,26 +3771,37 @@ class BrepKernel {
|
|
|
3479
3771
|
* Perform a mesh boolean on raw triangle data.
|
|
3480
3772
|
*
|
|
3481
3773
|
* Returns a `JsMesh` with the result.
|
|
3482
|
-
* @param {Float64Array} positions_a
|
|
3483
|
-
* @param {Uint32Array} indices_a
|
|
3484
|
-
* @param {Float64Array} positions_b
|
|
3485
|
-
* @param {Uint32Array} indices_b
|
|
3774
|
+
* @param {Float64Array | number[]} positions_a
|
|
3775
|
+
* @param {Uint32Array | number[]} indices_a
|
|
3776
|
+
* @param {Float64Array | number[]} positions_b
|
|
3777
|
+
* @param {Uint32Array | number[]} indices_b
|
|
3486
3778
|
* @param {string} op
|
|
3487
3779
|
* @param {number} tolerance
|
|
3488
3780
|
* @returns {JsMesh}
|
|
3489
3781
|
*/
|
|
3490
3782
|
meshBoolean(positions_a, indices_a, positions_b, indices_b, op, tolerance) {
|
|
3491
|
-
const
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3783
|
+
const val6 = +tolerance;
|
|
3784
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4;
|
|
3785
|
+
try {
|
|
3786
|
+
ptr0 = passArrayF64ToWasm0(positions_a, wasm.__wbindgen_malloc);
|
|
3787
|
+
len0 = WASM_VECTOR_LEN;
|
|
3788
|
+
ptr1 = passArray32ToWasm0(indices_a, wasm.__wbindgen_malloc);
|
|
3789
|
+
len1 = WASM_VECTOR_LEN;
|
|
3790
|
+
ptr2 = passArrayF64ToWasm0(positions_b, wasm.__wbindgen_malloc);
|
|
3791
|
+
len2 = WASM_VECTOR_LEN;
|
|
3792
|
+
ptr3 = passArray32ToWasm0(indices_b, wasm.__wbindgen_malloc);
|
|
3793
|
+
len3 = WASM_VECTOR_LEN;
|
|
3794
|
+
ptr4 = passStringToWasm0(op, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3795
|
+
len4 = WASM_VECTOR_LEN;
|
|
3796
|
+
} catch (e) {
|
|
3797
|
+
if (ptr4) { wasm.__wbindgen_free(ptr4, len4 * 1, 1); }
|
|
3798
|
+
if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 4, 4); }
|
|
3799
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 8, 8); }
|
|
3800
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 4, 4); }
|
|
3801
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
|
|
3802
|
+
throw e;
|
|
3803
|
+
}
|
|
3804
|
+
const ret = wasm.brepkernel_meshBoolean(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, val6);
|
|
3502
3805
|
if (ret[2]) {
|
|
3503
3806
|
throw takeFromExternrefTable0(ret[1]);
|
|
3504
3807
|
}
|
|
@@ -3619,27 +3922,39 @@ class BrepKernel {
|
|
|
3619
3922
|
*
|
|
3620
3923
|
* Returns an error for fewer than two sections, mismatched array lengths, a
|
|
3621
3924
|
* non-finite or out-of-range value, a non-planar profile, or loft failure.
|
|
3622
|
-
* @param {Uint32Array} face_handles
|
|
3623
|
-
* @param {Float64Array} params
|
|
3925
|
+
* @param {Uint32Array | number[]} face_handles
|
|
3926
|
+
* @param {Float64Array | number[]} params
|
|
3624
3927
|
* @param {number} spine_degree
|
|
3625
|
-
* @param {Float64Array} spine_knots
|
|
3626
|
-
* @param {Float64Array} spine_control_points
|
|
3627
|
-
* @param {Float64Array} spine_weights
|
|
3928
|
+
* @param {Float64Array | number[]} spine_knots
|
|
3929
|
+
* @param {Float64Array | number[]} spine_control_points
|
|
3930
|
+
* @param {Float64Array | number[]} spine_weights
|
|
3628
3931
|
* @param {boolean} ruled
|
|
3629
3932
|
* @returns {number}
|
|
3630
3933
|
*/
|
|
3631
3934
|
multiSectionSweep(face_handles, params, spine_degree, spine_knots, spine_control_points, spine_weights, ruled) {
|
|
3632
|
-
const
|
|
3633
|
-
const
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3935
|
+
const val6 = +spine_degree;
|
|
3936
|
+
const val7 = +ruled;
|
|
3937
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4;
|
|
3938
|
+
try {
|
|
3939
|
+
ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
|
|
3940
|
+
len0 = WASM_VECTOR_LEN;
|
|
3941
|
+
ptr1 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
|
|
3942
|
+
len1 = WASM_VECTOR_LEN;
|
|
3943
|
+
ptr2 = passArrayF64ToWasm0(spine_knots, wasm.__wbindgen_malloc);
|
|
3944
|
+
len2 = WASM_VECTOR_LEN;
|
|
3945
|
+
ptr3 = passArrayF64ToWasm0(spine_control_points, wasm.__wbindgen_malloc);
|
|
3946
|
+
len3 = WASM_VECTOR_LEN;
|
|
3947
|
+
ptr4 = passArrayF64ToWasm0(spine_weights, wasm.__wbindgen_malloc);
|
|
3948
|
+
len4 = WASM_VECTOR_LEN;
|
|
3949
|
+
} catch (e) {
|
|
3950
|
+
if (ptr4) { wasm.__wbindgen_free(ptr4, len4 * 8, 8); }
|
|
3951
|
+
if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 8, 8); }
|
|
3952
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 8, 8); }
|
|
3953
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
|
|
3954
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 4, 4); }
|
|
3955
|
+
throw e;
|
|
3956
|
+
}
|
|
3957
|
+
const ret = wasm.brepkernel_multiSectionSweep(this.__wbg_ptr, ptr0, len0, ptr1, len1, val6, ptr2, len2, ptr3, len3, ptr4, len4, val7);
|
|
3643
3958
|
if (ret[2]) {
|
|
3644
3959
|
throw takeFromExternrefTable0(ret[1]);
|
|
3645
3960
|
}
|
|
@@ -3679,21 +3994,23 @@ class BrepKernel {
|
|
|
3679
3994
|
*
|
|
3680
3995
|
* `coords` is a flat array `[x,y, x,y, ...]` of 2D points.
|
|
3681
3996
|
* Returns a flat array of offset polygon coordinates.
|
|
3682
|
-
* @param {Float64Array} coords
|
|
3997
|
+
* @param {Float64Array | number[]} coords
|
|
3683
3998
|
* @param {number} distance
|
|
3684
3999
|
* @param {number} tolerance
|
|
3685
4000
|
* @returns {Float64Array}
|
|
3686
4001
|
*/
|
|
3687
4002
|
offsetPolygon2d(coords, distance, tolerance) {
|
|
4003
|
+
const val2 = +distance;
|
|
4004
|
+
const val3 = +tolerance;
|
|
3688
4005
|
const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
|
|
3689
4006
|
const len0 = WASM_VECTOR_LEN;
|
|
3690
|
-
const ret = wasm.brepkernel_offsetPolygon2d(this.__wbg_ptr, ptr0, len0,
|
|
4007
|
+
const ret = wasm.brepkernel_offsetPolygon2d(this.__wbg_ptr, ptr0, len0, val2, val3);
|
|
3691
4008
|
if (ret[3]) {
|
|
3692
4009
|
throw takeFromExternrefTable0(ret[2]);
|
|
3693
4010
|
}
|
|
3694
|
-
var
|
|
4011
|
+
var v4 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
3695
4012
|
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
3696
|
-
return
|
|
4013
|
+
return v4;
|
|
3697
4014
|
}
|
|
3698
4015
|
/**
|
|
3699
4016
|
* Offset all faces of a solid outward or inward (V2 pipeline).
|
|
@@ -3757,9 +4074,11 @@ class BrepKernel {
|
|
|
3757
4074
|
* @returns {number}
|
|
3758
4075
|
*/
|
|
3759
4076
|
offsetWire2DWithJoin(wire, distance, join_type) {
|
|
4077
|
+
const val2 = +wire;
|
|
4078
|
+
const val3 = +distance;
|
|
3760
4079
|
const ptr0 = passStringToWasm0(join_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3761
4080
|
const len0 = WASM_VECTOR_LEN;
|
|
3762
|
-
const ret = wasm.brepkernel_offsetWire2DWithJoin(this.__wbg_ptr,
|
|
4081
|
+
const ret = wasm.brepkernel_offsetWire2DWithJoin(this.__wbg_ptr, val2, val3, ptr0, len0);
|
|
3763
4082
|
if (ret[2]) {
|
|
3764
4083
|
throw takeFromExternrefTable0(ret[1]);
|
|
3765
4084
|
}
|
|
@@ -3781,9 +4100,11 @@ class BrepKernel {
|
|
|
3781
4100
|
* @returns {number}
|
|
3782
4101
|
*/
|
|
3783
4102
|
offsetWireWithJoinType(face, distance, join_type) {
|
|
4103
|
+
const val2 = +face;
|
|
4104
|
+
const val3 = +distance;
|
|
3784
4105
|
const ptr0 = passStringToWasm0(join_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3785
4106
|
const len0 = WASM_VECTOR_LEN;
|
|
3786
|
-
const ret = wasm.brepkernel_offsetWireWithJoinType(this.__wbg_ptr,
|
|
4107
|
+
const ret = wasm.brepkernel_offsetWireWithJoinType(this.__wbg_ptr, val2, val3, ptr0, len0);
|
|
3787
4108
|
if (ret[2]) {
|
|
3788
4109
|
throw takeFromExternrefTable0(ret[1]);
|
|
3789
4110
|
}
|
|
@@ -3814,19 +4135,29 @@ class BrepKernel {
|
|
|
3814
4135
|
* Returns an error if the face or path is invalid.
|
|
3815
4136
|
* @param {number} face
|
|
3816
4137
|
* @param {number} path_degree
|
|
3817
|
-
* @param {Float64Array} path_knots
|
|
3818
|
-
* @param {Float64Array} path_control_points
|
|
3819
|
-
* @param {Float64Array} path_weights
|
|
4138
|
+
* @param {Float64Array | number[]} path_knots
|
|
4139
|
+
* @param {Float64Array | number[]} path_control_points
|
|
4140
|
+
* @param {Float64Array | number[]} path_weights
|
|
3820
4141
|
* @returns {number}
|
|
3821
4142
|
*/
|
|
3822
4143
|
pipe(face, path_degree, path_knots, path_control_points, path_weights) {
|
|
3823
|
-
const
|
|
3824
|
-
const
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
4144
|
+
const val4 = +face;
|
|
4145
|
+
const val5 = +path_degree;
|
|
4146
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
4147
|
+
try {
|
|
4148
|
+
ptr0 = passArrayF64ToWasm0(path_knots, wasm.__wbindgen_malloc);
|
|
4149
|
+
len0 = WASM_VECTOR_LEN;
|
|
4150
|
+
ptr1 = passArrayF64ToWasm0(path_control_points, wasm.__wbindgen_malloc);
|
|
4151
|
+
len1 = WASM_VECTOR_LEN;
|
|
4152
|
+
ptr2 = passArrayF64ToWasm0(path_weights, wasm.__wbindgen_malloc);
|
|
4153
|
+
len2 = WASM_VECTOR_LEN;
|
|
4154
|
+
} catch (e) {
|
|
4155
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 8, 8); }
|
|
4156
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
|
|
4157
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
|
|
4158
|
+
throw e;
|
|
4159
|
+
}
|
|
4160
|
+
const ret = wasm.brepkernel_pipe(this.__wbg_ptr, val4, val5, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
3830
4161
|
if (ret[2]) {
|
|
3831
4162
|
throw takeFromExternrefTable0(ret[1]);
|
|
3832
4163
|
}
|
|
@@ -3837,15 +4168,17 @@ class BrepKernel {
|
|
|
3837
4168
|
*
|
|
3838
4169
|
* `polygon_coords` is a flat array `[x,y, x,y, ...]`.
|
|
3839
4170
|
* Returns `true` if the point is inside the polygon (winding number test).
|
|
3840
|
-
* @param {Float64Array} polygon_coords
|
|
4171
|
+
* @param {Float64Array | number[]} polygon_coords
|
|
3841
4172
|
* @param {number} px
|
|
3842
4173
|
* @param {number} py
|
|
3843
4174
|
* @returns {boolean}
|
|
3844
4175
|
*/
|
|
3845
4176
|
pointInPolygon2d(polygon_coords, px, py) {
|
|
4177
|
+
const val2 = +px;
|
|
4178
|
+
const val3 = +py;
|
|
3846
4179
|
const ptr0 = passArrayF64ToWasm0(polygon_coords, wasm.__wbindgen_malloc);
|
|
3847
4180
|
const len0 = WASM_VECTOR_LEN;
|
|
3848
|
-
const ret = wasm.brepkernel_pointInPolygon2d(this.__wbg_ptr, ptr0, len0,
|
|
4181
|
+
const ret = wasm.brepkernel_pointInPolygon2d(this.__wbg_ptr, ptr0, len0, val2, val3);
|
|
3849
4182
|
if (ret[2]) {
|
|
3850
4183
|
throw takeFromExternrefTable0(ret[1]);
|
|
3851
4184
|
}
|
|
@@ -3926,15 +4259,22 @@ class BrepKernel {
|
|
|
3926
4259
|
* Both polygons are flat arrays `[x,y, x,y, ...]`.
|
|
3927
4260
|
* Returns `true` if any vertex of one polygon is inside the other
|
|
3928
4261
|
* or if any edges cross.
|
|
3929
|
-
* @param {Float64Array} coords_a
|
|
3930
|
-
* @param {Float64Array} coords_b
|
|
4262
|
+
* @param {Float64Array | number[]} coords_a
|
|
4263
|
+
* @param {Float64Array | number[]} coords_b
|
|
3931
4264
|
* @returns {boolean}
|
|
3932
4265
|
*/
|
|
3933
4266
|
polygonsIntersect2d(coords_a, coords_b) {
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
4267
|
+
let ptr0, len0, ptr1, len1;
|
|
4268
|
+
try {
|
|
4269
|
+
ptr0 = passArrayF64ToWasm0(coords_a, wasm.__wbindgen_malloc);
|
|
4270
|
+
len0 = WASM_VECTOR_LEN;
|
|
4271
|
+
ptr1 = passArrayF64ToWasm0(coords_b, wasm.__wbindgen_malloc);
|
|
4272
|
+
len1 = WASM_VECTOR_LEN;
|
|
4273
|
+
} catch (e) {
|
|
4274
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
|
|
4275
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
|
|
4276
|
+
throw e;
|
|
4277
|
+
}
|
|
3938
4278
|
const ret = wasm.brepkernel_polygonsIntersect2d(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
3939
4279
|
if (ret[2]) {
|
|
3940
4280
|
throw takeFromExternrefTable0(ret[1]);
|
|
@@ -4002,7 +4342,7 @@ class BrepKernel {
|
|
|
4002
4342
|
*
|
|
4003
4343
|
* Returns an error for an empty list, an invalid handle, a non-positive
|
|
4004
4344
|
* `deflection`, or a degenerate `dir`/`x_axis`.
|
|
4005
|
-
* @param {Uint32Array} solids
|
|
4345
|
+
* @param {Uint32Array | number[]} solids
|
|
4006
4346
|
* @param {number} origin_x
|
|
4007
4347
|
* @param {number} origin_y
|
|
4008
4348
|
* @param {number} origin_z
|
|
@@ -4017,9 +4357,20 @@ class BrepKernel {
|
|
|
4017
4357
|
* @returns {any}
|
|
4018
4358
|
*/
|
|
4019
4359
|
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) {
|
|
4360
|
+
const val2 = +origin_x;
|
|
4361
|
+
const val3 = +origin_y;
|
|
4362
|
+
const val4 = +origin_z;
|
|
4363
|
+
const val5 = +dir_x;
|
|
4364
|
+
const val6 = +dir_y;
|
|
4365
|
+
const val7 = +dir_z;
|
|
4366
|
+
const val8 = +x_axis_x;
|
|
4367
|
+
const val9 = +x_axis_y;
|
|
4368
|
+
const val10 = +x_axis_z;
|
|
4369
|
+
const val11 = +hidden_lines;
|
|
4370
|
+
const val12 = +deflection;
|
|
4020
4371
|
const ptr0 = passArray32ToWasm0(solids, wasm.__wbindgen_malloc);
|
|
4021
4372
|
const len0 = WASM_VECTOR_LEN;
|
|
4022
|
-
const ret = wasm.brepkernel_projectSolidsEdges(this.__wbg_ptr, ptr0, len0,
|
|
4373
|
+
const ret = wasm.brepkernel_projectSolidsEdges(this.__wbg_ptr, ptr0, len0, val2, val3, val4, val5, val6, val7, val8, val9, val10, val11, val12);
|
|
4023
4374
|
if (ret[2]) {
|
|
4024
4375
|
throw takeFromExternrefTable0(ret[1]);
|
|
4025
4376
|
}
|
|
@@ -4256,14 +4607,15 @@ class BrepKernel {
|
|
|
4256
4607
|
* # Errors
|
|
4257
4608
|
*
|
|
4258
4609
|
* Returns an error if fewer than 2 faces or sewing fails.
|
|
4259
|
-
* @param {Uint32Array} face_handles
|
|
4610
|
+
* @param {Uint32Array | number[]} face_handles
|
|
4260
4611
|
* @param {number} tolerance
|
|
4261
4612
|
* @returns {number}
|
|
4262
4613
|
*/
|
|
4263
4614
|
sewFaces(face_handles, tolerance) {
|
|
4615
|
+
const val2 = +tolerance;
|
|
4264
4616
|
const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
|
|
4265
4617
|
const len0 = WASM_VECTOR_LEN;
|
|
4266
|
-
const ret = wasm.brepkernel_sewFaces(this.__wbg_ptr, ptr0, len0,
|
|
4618
|
+
const ret = wasm.brepkernel_sewFaces(this.__wbg_ptr, ptr0, len0, val2);
|
|
4267
4619
|
if (ret[2]) {
|
|
4268
4620
|
throw takeFromExternrefTable0(ret[1]);
|
|
4269
4621
|
}
|
|
@@ -4297,13 +4649,15 @@ class BrepKernel {
|
|
|
4297
4649
|
* Returns an error if thickness is non-positive or the solid is invalid.
|
|
4298
4650
|
* @param {number} solid
|
|
4299
4651
|
* @param {number} thickness
|
|
4300
|
-
* @param {Uint32Array} open_faces
|
|
4652
|
+
* @param {Uint32Array | number[]} open_faces
|
|
4301
4653
|
* @returns {number}
|
|
4302
4654
|
*/
|
|
4303
4655
|
shell(solid, thickness, open_faces) {
|
|
4656
|
+
const val2 = +solid;
|
|
4657
|
+
const val3 = +thickness;
|
|
4304
4658
|
const ptr0 = passArray32ToWasm0(open_faces, wasm.__wbindgen_malloc);
|
|
4305
4659
|
const len0 = WASM_VECTOR_LEN;
|
|
4306
|
-
const ret = wasm.brepkernel_shell(this.__wbg_ptr,
|
|
4660
|
+
const ret = wasm.brepkernel_shell(this.__wbg_ptr, val2, val3, ptr0, len0);
|
|
4307
4661
|
if (ret[2]) {
|
|
4308
4662
|
throw takeFromExternrefTable0(ret[1]);
|
|
4309
4663
|
}
|
|
@@ -4352,9 +4706,10 @@ class BrepKernel {
|
|
|
4352
4706
|
* @param {string} json
|
|
4353
4707
|
*/
|
|
4354
4708
|
sketchAddConstraint(sketch, json) {
|
|
4709
|
+
const val2 = +sketch;
|
|
4355
4710
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4356
4711
|
const len0 = WASM_VECTOR_LEN;
|
|
4357
|
-
const ret = wasm.brepkernel_sketchAddConstraint(this.__wbg_ptr,
|
|
4712
|
+
const ret = wasm.brepkernel_sketchAddConstraint(this.__wbg_ptr, val2, ptr0, len0);
|
|
4358
4713
|
if (ret[1]) {
|
|
4359
4714
|
throw takeFromExternrefTable0(ret[0]);
|
|
4360
4715
|
}
|
|
@@ -4488,19 +4843,20 @@ class BrepKernel {
|
|
|
4488
4843
|
* along its marks, or the pieces would not be valid solids summing to the
|
|
4489
4844
|
* solid's volume.
|
|
4490
4845
|
* @param {number} solid
|
|
4491
|
-
* @param {Uint32Array} face_handles
|
|
4846
|
+
* @param {Uint32Array | number[]} face_handles
|
|
4492
4847
|
* @returns {Uint32Array}
|
|
4493
4848
|
*/
|
|
4494
4849
|
splitByFaces(solid, face_handles) {
|
|
4850
|
+
const val2 = +solid;
|
|
4495
4851
|
const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
|
|
4496
4852
|
const len0 = WASM_VECTOR_LEN;
|
|
4497
|
-
const ret = wasm.brepkernel_splitByFaces(this.__wbg_ptr,
|
|
4853
|
+
const ret = wasm.brepkernel_splitByFaces(this.__wbg_ptr, val2, ptr0, len0);
|
|
4498
4854
|
if (ret[3]) {
|
|
4499
4855
|
throw takeFromExternrefTable0(ret[2]);
|
|
4500
4856
|
}
|
|
4501
|
-
var
|
|
4857
|
+
var v3 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
4502
4858
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
4503
|
-
return
|
|
4859
|
+
return v3;
|
|
4504
4860
|
}
|
|
4505
4861
|
/**
|
|
4506
4862
|
* Split a solid into two halves along a plane.
|
|
@@ -4559,13 +4915,14 @@ class BrepKernel {
|
|
|
4559
4915
|
*
|
|
4560
4916
|
* Returns an error if fewer than 2 edges or the fit fails.
|
|
4561
4917
|
* @param {number} face
|
|
4562
|
-
* @param {Uint32Array} edge_handles
|
|
4918
|
+
* @param {Uint32Array | number[]} edge_handles
|
|
4563
4919
|
* @returns {number}
|
|
4564
4920
|
*/
|
|
4565
4921
|
sweepAlongEdges(face, edge_handles) {
|
|
4922
|
+
const val2 = +face;
|
|
4566
4923
|
const ptr0 = passArray32ToWasm0(edge_handles, wasm.__wbindgen_malloc);
|
|
4567
4924
|
const len0 = WASM_VECTOR_LEN;
|
|
4568
|
-
const ret = wasm.brepkernel_sweepAlongEdges(this.__wbg_ptr,
|
|
4925
|
+
const ret = wasm.brepkernel_sweepAlongEdges(this.__wbg_ptr, val2, ptr0, len0);
|
|
4569
4926
|
if (ret[2]) {
|
|
4570
4927
|
throw takeFromExternrefTable0(ret[1]);
|
|
4571
4928
|
}
|
|
@@ -4585,19 +4942,29 @@ class BrepKernel {
|
|
|
4585
4942
|
* Returns an error if the face or path is invalid, or surface fitting fails.
|
|
4586
4943
|
* @param {number} face
|
|
4587
4944
|
* @param {number} path_degree
|
|
4588
|
-
* @param {Float64Array} path_knots
|
|
4589
|
-
* @param {Float64Array} path_control_points
|
|
4590
|
-
* @param {Float64Array} path_weights
|
|
4945
|
+
* @param {Float64Array | number[]} path_knots
|
|
4946
|
+
* @param {Float64Array | number[]} path_control_points
|
|
4947
|
+
* @param {Float64Array | number[]} path_weights
|
|
4591
4948
|
* @returns {number}
|
|
4592
4949
|
*/
|
|
4593
4950
|
sweepSmooth(face, path_degree, path_knots, path_control_points, path_weights) {
|
|
4594
|
-
const
|
|
4595
|
-
const
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4951
|
+
const val4 = +face;
|
|
4952
|
+
const val5 = +path_degree;
|
|
4953
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
4954
|
+
try {
|
|
4955
|
+
ptr0 = passArrayF64ToWasm0(path_knots, wasm.__wbindgen_malloc);
|
|
4956
|
+
len0 = WASM_VECTOR_LEN;
|
|
4957
|
+
ptr1 = passArrayF64ToWasm0(path_control_points, wasm.__wbindgen_malloc);
|
|
4958
|
+
len1 = WASM_VECTOR_LEN;
|
|
4959
|
+
ptr2 = passArrayF64ToWasm0(path_weights, wasm.__wbindgen_malloc);
|
|
4960
|
+
len2 = WASM_VECTOR_LEN;
|
|
4961
|
+
} catch (e) {
|
|
4962
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 8, 8); }
|
|
4963
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
|
|
4964
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
|
|
4965
|
+
throw e;
|
|
4966
|
+
}
|
|
4967
|
+
const ret = wasm.brepkernel_sweepSmooth(this.__wbg_ptr, val4, val5, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
4601
4968
|
if (ret[2]) {
|
|
4602
4969
|
throw takeFromExternrefTable0(ret[1]);
|
|
4603
4970
|
}
|
|
@@ -4616,13 +4983,14 @@ class BrepKernel {
|
|
|
4616
4983
|
* Returns an error if a handle is invalid, the chain has no edges, breaks,
|
|
4617
4984
|
* closes or has a kink, or the wire is closed.
|
|
4618
4985
|
* @param {number} wire
|
|
4619
|
-
* @param {Uint32Array} path_edges
|
|
4986
|
+
* @param {Uint32Array | number[]} path_edges
|
|
4620
4987
|
* @returns {number}
|
|
4621
4988
|
*/
|
|
4622
4989
|
sweepWire(wire, path_edges) {
|
|
4990
|
+
const val2 = +wire;
|
|
4623
4991
|
const ptr0 = passArray32ToWasm0(path_edges, wasm.__wbindgen_malloc);
|
|
4624
4992
|
const len0 = WASM_VECTOR_LEN;
|
|
4625
|
-
const ret = wasm.brepkernel_sweepWire(this.__wbg_ptr,
|
|
4993
|
+
const ret = wasm.brepkernel_sweepWire(this.__wbg_ptr, val2, ptr0, len0);
|
|
4626
4994
|
if (ret[2]) {
|
|
4627
4995
|
throw takeFromExternrefTable0(ret[1]);
|
|
4628
4996
|
}
|
|
@@ -4638,19 +5006,30 @@ class BrepKernel {
|
|
|
4638
5006
|
* @param {number} profile
|
|
4639
5007
|
* @param {number} path_edge
|
|
4640
5008
|
* @param {string} contact_mode
|
|
4641
|
-
* @param {Float64Array} scale_values
|
|
5009
|
+
* @param {Float64Array | number[]} scale_values
|
|
4642
5010
|
* @param {number} segments
|
|
4643
5011
|
* @param {string} corner_mode
|
|
4644
5012
|
* @returns {number}
|
|
4645
5013
|
*/
|
|
4646
5014
|
sweepWithOptions(profile, path_edge, contact_mode, scale_values, segments, corner_mode) {
|
|
4647
|
-
const
|
|
4648
|
-
const
|
|
4649
|
-
const
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
5015
|
+
const val4 = +profile;
|
|
5016
|
+
const val5 = +path_edge;
|
|
5017
|
+
const val6 = +segments;
|
|
5018
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
5019
|
+
try {
|
|
5020
|
+
ptr0 = passStringToWasm0(contact_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5021
|
+
len0 = WASM_VECTOR_LEN;
|
|
5022
|
+
ptr1 = passArrayF64ToWasm0(scale_values, wasm.__wbindgen_malloc);
|
|
5023
|
+
len1 = WASM_VECTOR_LEN;
|
|
5024
|
+
ptr2 = passStringToWasm0(corner_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5025
|
+
len2 = WASM_VECTOR_LEN;
|
|
5026
|
+
} catch (e) {
|
|
5027
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
5028
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
|
|
5029
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
5030
|
+
throw e;
|
|
5031
|
+
}
|
|
5032
|
+
const ret = wasm.brepkernel_sweepWithOptions(this.__wbg_ptr, val4, val5, ptr0, len0, ptr1, len1, val6, ptr2, len2);
|
|
4654
5033
|
if (ret[2]) {
|
|
4655
5034
|
throw takeFromExternrefTable0(ret[1]);
|
|
4656
5035
|
}
|
|
@@ -4673,19 +5052,29 @@ class BrepKernel {
|
|
|
4673
5052
|
* inconsistent lengths, or the sweep operation fails.
|
|
4674
5053
|
* @param {number} face
|
|
4675
5054
|
* @param {number} path_degree
|
|
4676
|
-
* @param {Float64Array} path_knots
|
|
4677
|
-
* @param {Float64Array} path_control_points
|
|
4678
|
-
* @param {Float64Array} path_weights
|
|
5055
|
+
* @param {Float64Array | number[]} path_knots
|
|
5056
|
+
* @param {Float64Array | number[]} path_control_points
|
|
5057
|
+
* @param {Float64Array | number[]} path_weights
|
|
4679
5058
|
* @returns {number}
|
|
4680
5059
|
*/
|
|
4681
5060
|
sweep(face, path_degree, path_knots, path_control_points, path_weights) {
|
|
4682
|
-
const
|
|
4683
|
-
const
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
5061
|
+
const val4 = +face;
|
|
5062
|
+
const val5 = +path_degree;
|
|
5063
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
5064
|
+
try {
|
|
5065
|
+
ptr0 = passArrayF64ToWasm0(path_knots, wasm.__wbindgen_malloc);
|
|
5066
|
+
len0 = WASM_VECTOR_LEN;
|
|
5067
|
+
ptr1 = passArrayF64ToWasm0(path_control_points, wasm.__wbindgen_malloc);
|
|
5068
|
+
len1 = WASM_VECTOR_LEN;
|
|
5069
|
+
ptr2 = passArrayF64ToWasm0(path_weights, wasm.__wbindgen_malloc);
|
|
5070
|
+
len2 = WASM_VECTOR_LEN;
|
|
5071
|
+
} catch (e) {
|
|
5072
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 8, 8); }
|
|
5073
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 8, 8); }
|
|
5074
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 8, 8); }
|
|
5075
|
+
throw e;
|
|
5076
|
+
}
|
|
5077
|
+
const ret = wasm.brepkernel_sweep(this.__wbg_ptr, val4, val5, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
4689
5078
|
if (ret[2]) {
|
|
4690
5079
|
throw takeFromExternrefTable0(ret[1]);
|
|
4691
5080
|
}
|
|
@@ -4886,12 +5275,13 @@ class BrepKernel {
|
|
|
4886
5275
|
* Returns an error if the face handle is invalid, the matrix doesn't
|
|
4887
5276
|
* have 16 elements, or the matrix is singular.
|
|
4888
5277
|
* @param {number} face
|
|
4889
|
-
* @param {Float64Array} matrix
|
|
5278
|
+
* @param {Float64Array | number[]} matrix
|
|
4890
5279
|
*/
|
|
4891
5280
|
transformFace(face, matrix) {
|
|
5281
|
+
const val2 = +face;
|
|
4892
5282
|
const ptr0 = passArrayF64ToWasm0(matrix, wasm.__wbindgen_malloc);
|
|
4893
5283
|
const len0 = WASM_VECTOR_LEN;
|
|
4894
|
-
const ret = wasm.brepkernel_transformFace(this.__wbg_ptr,
|
|
5284
|
+
const ret = wasm.brepkernel_transformFace(this.__wbg_ptr, val2, ptr0, len0);
|
|
4895
5285
|
if (ret[1]) {
|
|
4896
5286
|
throw takeFromExternrefTable0(ret[0]);
|
|
4897
5287
|
}
|
|
@@ -4906,12 +5296,13 @@ class BrepKernel {
|
|
|
4906
5296
|
* Returns an error if the solid handle is invalid, the matrix doesn't
|
|
4907
5297
|
* have 16 elements, or the matrix is singular.
|
|
4908
5298
|
* @param {number} solid
|
|
4909
|
-
* @param {Float64Array} matrix
|
|
5299
|
+
* @param {Float64Array | number[]} matrix
|
|
4910
5300
|
*/
|
|
4911
5301
|
transformSolid(solid, matrix) {
|
|
5302
|
+
const val2 = +solid;
|
|
4912
5303
|
const ptr0 = passArrayF64ToWasm0(matrix, wasm.__wbindgen_malloc);
|
|
4913
5304
|
const len0 = WASM_VECTOR_LEN;
|
|
4914
|
-
const ret = wasm.brepkernel_transformSolid(this.__wbg_ptr,
|
|
5305
|
+
const ret = wasm.brepkernel_transformSolid(this.__wbg_ptr, val2, ptr0, len0);
|
|
4915
5306
|
if (ret[1]) {
|
|
4916
5307
|
throw takeFromExternrefTable0(ret[0]);
|
|
4917
5308
|
}
|
|
@@ -4926,12 +5317,13 @@ class BrepKernel {
|
|
|
4926
5317
|
* Returns an error if the wire handle is invalid, the matrix doesn't
|
|
4927
5318
|
* have 16 elements, or the matrix is singular.
|
|
4928
5319
|
* @param {number} wire
|
|
4929
|
-
* @param {Float64Array} matrix
|
|
5320
|
+
* @param {Float64Array | number[]} matrix
|
|
4930
5321
|
*/
|
|
4931
5322
|
transformWire(wire, matrix) {
|
|
5323
|
+
const val2 = +wire;
|
|
4932
5324
|
const ptr0 = passArrayF64ToWasm0(matrix, wasm.__wbindgen_malloc);
|
|
4933
5325
|
const len0 = WASM_VECTOR_LEN;
|
|
4934
|
-
const ret = wasm.brepkernel_transformWire(this.__wbg_ptr,
|
|
5326
|
+
const ret = wasm.brepkernel_transformWire(this.__wbg_ptr, val2, ptr0, len0);
|
|
4935
5327
|
if (ret[1]) {
|
|
4936
5328
|
throw takeFromExternrefTable0(ret[0]);
|
|
4937
5329
|
}
|
|
@@ -5055,14 +5447,15 @@ class BrepKernel {
|
|
|
5055
5447
|
*
|
|
5056
5448
|
* Accepts an array of face handles from potentially different shells.
|
|
5057
5449
|
* Sews all faces together into a single solid.
|
|
5058
|
-
* @param {Uint32Array} face_handles
|
|
5450
|
+
* @param {Uint32Array | number[]} face_handles
|
|
5059
5451
|
* @param {number} tolerance
|
|
5060
5452
|
* @returns {number}
|
|
5061
5453
|
*/
|
|
5062
5454
|
weldShellsAndFaces(face_handles, tolerance) {
|
|
5455
|
+
const val2 = +tolerance;
|
|
5063
5456
|
const ptr0 = passArray32ToWasm0(face_handles, wasm.__wbindgen_malloc);
|
|
5064
5457
|
const len0 = WASM_VECTOR_LEN;
|
|
5065
|
-
const ret = wasm.brepkernel_weldShellsAndFaces(this.__wbg_ptr, ptr0, len0,
|
|
5458
|
+
const ret = wasm.brepkernel_weldShellsAndFaces(this.__wbg_ptr, ptr0, len0, val2);
|
|
5066
5459
|
if (ret[2]) {
|
|
5067
5460
|
throw takeFromExternrefTable0(ret[1]);
|
|
5068
5461
|
}
|
|
@@ -5532,30 +5925,30 @@ exports.setLogLevel = setLogLevel;
|
|
|
5532
5925
|
function __wbg_get_imports() {
|
|
5533
5926
|
const import0 = {
|
|
5534
5927
|
__proto__: null,
|
|
5535
|
-
|
|
5928
|
+
__wbg_Error_208446807d0d1e30: function(arg0, arg1) {
|
|
5536
5929
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
5537
5930
|
return ret;
|
|
5538
5931
|
},
|
|
5539
|
-
|
|
5932
|
+
__wbg___wbindgen_debug_string_f249a2a76caa9a55: function(arg0, arg1) {
|
|
5540
5933
|
const ret = debugString(arg1);
|
|
5541
5934
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5542
5935
|
const len1 = WASM_VECTOR_LEN;
|
|
5543
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
5544
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
5936
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
5937
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
5545
5938
|
},
|
|
5546
|
-
|
|
5939
|
+
__wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
|
|
5547
5940
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
5548
5941
|
},
|
|
5549
|
-
|
|
5942
|
+
__wbg_error_b693e3f4fbf3e888: function(arg0, arg1) {
|
|
5550
5943
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
5551
5944
|
},
|
|
5552
|
-
|
|
5945
|
+
__wbg_getRandomValues_8b6f1f663e6f188d: function() { return handleError(function (arg0, arg1) {
|
|
5553
5946
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
5554
5947
|
}, arguments); },
|
|
5555
|
-
|
|
5948
|
+
__wbg_log_85d5c5732049ef45: function(arg0, arg1) {
|
|
5556
5949
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
5557
5950
|
},
|
|
5558
|
-
|
|
5951
|
+
__wbg_warn_bc26df775fd739d9: function(arg0, arg1) {
|
|
5559
5952
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
5560
5953
|
},
|
|
5561
5954
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
@@ -5565,12 +5958,11 @@ function __wbg_get_imports() {
|
|
|
5565
5958
|
},
|
|
5566
5959
|
__wbindgen_init_externref_table: function() {
|
|
5567
5960
|
const table = wasm.__wbindgen_externrefs;
|
|
5568
|
-
const offset = table.grow(4);
|
|
5569
5961
|
table.set(0, undefined);
|
|
5570
|
-
table.set(
|
|
5571
|
-
table.set(
|
|
5572
|
-
table.set(
|
|
5573
|
-
table.set(
|
|
5962
|
+
table.set(1024, undefined);
|
|
5963
|
+
table.set(1025, null);
|
|
5964
|
+
table.set(1026, true);
|
|
5965
|
+
table.set(1027, false);
|
|
5574
5966
|
},
|
|
5575
5967
|
};
|
|
5576
5968
|
return {
|
|
@@ -5605,68 +5997,61 @@ function addToExternrefTable0(obj) {
|
|
|
5605
5997
|
}
|
|
5606
5998
|
|
|
5607
5999
|
function debugString(val) {
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
5660
|
-
} catch (_) {
|
|
5661
|
-
return 'Object';
|
|
6000
|
+
switch (typeof val) {
|
|
6001
|
+
// primitive types
|
|
6002
|
+
case 'number':
|
|
6003
|
+
case 'boolean':
|
|
6004
|
+
case 'undefined':
|
|
6005
|
+
return `${val}`;
|
|
6006
|
+
case 'string':
|
|
6007
|
+
return JSON.stringify(val);
|
|
6008
|
+
case 'bigint':
|
|
6009
|
+
return `${val}n`;
|
|
6010
|
+
case 'symbol':
|
|
6011
|
+
return val.description !== undefined
|
|
6012
|
+
? `Symbol(${val.description})`
|
|
6013
|
+
: 'Symbol';
|
|
6014
|
+
case 'function':
|
|
6015
|
+
return typeof val.name === 'string' && val.name !== ''
|
|
6016
|
+
? `Function(${val.name})`
|
|
6017
|
+
: 'Function';
|
|
6018
|
+
case 'object': {
|
|
6019
|
+
if (val === null) {
|
|
6020
|
+
return 'null';
|
|
6021
|
+
}
|
|
6022
|
+
// objects
|
|
6023
|
+
if (Array.isArray(val)) {
|
|
6024
|
+
return '[' + Array.from(val, debugString).join(', ') + ']';
|
|
6025
|
+
}
|
|
6026
|
+
// errors
|
|
6027
|
+
if (val instanceof Error) {
|
|
6028
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
6029
|
+
}
|
|
6030
|
+
|
|
6031
|
+
const toStringOutput = toString.call(val);
|
|
6032
|
+
// Test for built-in
|
|
6033
|
+
const className = /\[object ([^\]]+)\]/.exec(toStringOutput)?.[1];
|
|
6034
|
+
|
|
6035
|
+
// Failed to match the standard '[object ClassName]'
|
|
6036
|
+
if (className === undefined) {
|
|
6037
|
+
return toStringOutput;
|
|
6038
|
+
}
|
|
6039
|
+
if (className === 'Object') {
|
|
6040
|
+
// we're a user defined class or Object
|
|
6041
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
6042
|
+
// easier than looping through ownProperties of `val`.
|
|
6043
|
+
try {
|
|
6044
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
6045
|
+
} catch (_) {
|
|
6046
|
+
return 'Object';
|
|
6047
|
+
}
|
|
6048
|
+
}
|
|
6049
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
6050
|
+
return className;
|
|
5662
6051
|
}
|
|
6052
|
+
// Per MDN: 'This list of values is exhaustive.'
|
|
6053
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description
|
|
5663
6054
|
}
|
|
5664
|
-
// errors
|
|
5665
|
-
if (val instanceof Error) {
|
|
5666
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
5667
|
-
}
|
|
5668
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
5669
|
-
return className;
|
|
5670
6055
|
}
|
|
5671
6056
|
|
|
5672
6057
|
function getArrayF32FromWasm0(ptr, len) {
|
|
@@ -5714,7 +6099,8 @@ function getFloat64ArrayMemory0() {
|
|
|
5714
6099
|
}
|
|
5715
6100
|
|
|
5716
6101
|
function getStringFromWasm0(ptr, len) {
|
|
5717
|
-
|
|
6102
|
+
ptr = ptr >>> 0;
|
|
6103
|
+
return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
5718
6104
|
}
|
|
5719
6105
|
|
|
5720
6106
|
let cachedUint32ArrayMemory0 = null;
|
|
@@ -5810,10 +6196,10 @@ function takeFromExternrefTable0(idx) {
|
|
|
5810
6196
|
return value;
|
|
5811
6197
|
}
|
|
5812
6198
|
|
|
5813
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
6199
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
5814
6200
|
cachedTextDecoder.decode();
|
|
5815
|
-
function decodeText(
|
|
5816
|
-
return cachedTextDecoder.decode(
|
|
6201
|
+
function decodeText(bytes) {
|
|
6202
|
+
return cachedTextDecoder.decode(bytes);
|
|
5817
6203
|
}
|
|
5818
6204
|
|
|
5819
6205
|
const cachedTextEncoder = new TextEncoder();
|