opengeometry 2.0.10 → 2.0.13
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/index.d.ts +1 -1
- package/index.js +991 -68
- package/index.js.map +1 -1
- package/opengeometry/pkg/opengeometry.d.ts +354 -207
- package/opengeometry/pkg/opengeometry.js +614 -36
- package/opengeometry/pkg/opengeometry_bg.wasm +0 -0
- package/opengeometry/pkg/opengeometry_bg.wasm.d.ts +243 -206
- package/opengeometry_bg.wasm +0 -0
- package/opengeometry_bg.wasm.d.ts +243 -206
- package/package.json +1 -1
- package/src/editor/types.d.ts +1 -1
- package/src/examples/index.d.ts +1 -0
- package/src/examples/offset-ring-variable.d.ts +13 -0
- package/src/operations/index.d.ts +1 -0
- package/src/operations/offset-regions.d.ts +77 -0
- package/src/primitives/elliptical_arc.d.ts +66 -0
- package/src/primitives/index.d.ts +1 -0
- package/src/operations/chamfer.d.ts +0 -10
- package/src/operations/draft.d.ts +0 -14
- package/src/operations/fillet.d.ts +0 -13
- package/src/operations/loft.d.ts +0 -16
- package/src/operations/mirror.d.ts +0 -21
- package/src/operations/pattern-circular.d.ts +0 -19
- package/src/operations/pattern-linear.d.ts +0 -15
- package/src/operations/pipe.d.ts +0 -17
- package/src/operations/revolve.d.ts +0 -29
- package/src/operations/sweep.d.ts +0 -13
- package/src/primitives/helix.d.ts +0 -31
- package/src/shapes/cone.d.ts +0 -64
- package/src/shapes/ellipsoid.d.ts +0 -86
- package/src/shapes/extrusion.d.ts +0 -64
- package/src/shapes/frustum.d.ts +0 -44
- package/src/shapes/torus.d.ts +0 -44
|
@@ -204,9 +204,242 @@ function passArrayJsValueToWasm0(array, malloc) {
|
|
|
204
204
|
return ptr;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
function passArrayF64ToWasm0(arg, malloc) {
|
|
208
|
+
const ptr = malloc(arg.length * 8, 8) >>> 0;
|
|
209
|
+
getFloat64ArrayMemory0().set(arg, ptr / 8);
|
|
210
|
+
WASM_VECTOR_LEN = arg.length;
|
|
211
|
+
return ptr;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
215
|
+
ptr = ptr >>> 0;
|
|
216
|
+
const mem = getDataViewMemory0();
|
|
217
|
+
const result = [];
|
|
218
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
219
|
+
result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
|
|
220
|
+
}
|
|
221
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
222
|
+
return result;
|
|
223
|
+
}
|
|
224
|
+
|
|
207
225
|
function isLikeNone(x) {
|
|
208
226
|
return x === undefined || x === null;
|
|
209
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* Wasm entry point: analyze a flat `[x0,y0,z0,…]` loop, returning the report as
|
|
230
|
+
* JSON (the corrected points are not returned here; use the kernel API).
|
|
231
|
+
* @param {Float64Array} flat_points
|
|
232
|
+
* @returns {string}
|
|
233
|
+
*/
|
|
234
|
+
export function analyzeProfile(flat_points) {
|
|
235
|
+
let deferred3_0;
|
|
236
|
+
let deferred3_1;
|
|
237
|
+
try {
|
|
238
|
+
const ptr0 = passArrayF64ToWasm0(flat_points, wasm.__wbindgen_malloc);
|
|
239
|
+
const len0 = WASM_VECTOR_LEN;
|
|
240
|
+
const ret = wasm.analyzeProfile(ptr0, len0);
|
|
241
|
+
var ptr2 = ret[0];
|
|
242
|
+
var len2 = ret[1];
|
|
243
|
+
if (ret[3]) {
|
|
244
|
+
ptr2 = 0; len2 = 0;
|
|
245
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
246
|
+
}
|
|
247
|
+
deferred3_0 = ptr2;
|
|
248
|
+
deferred3_1 = len2;
|
|
249
|
+
return getStringFromWasm0(ptr2, len2);
|
|
250
|
+
} finally {
|
|
251
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Wasm entry point: check a serialized B-rep's geometric validity, returning
|
|
257
|
+
* the [`ValidityReport`] as JSON.
|
|
258
|
+
* @param {string} brep_json
|
|
259
|
+
* @returns {string}
|
|
260
|
+
*/
|
|
261
|
+
export function checkBrepValidity(brep_json) {
|
|
262
|
+
let deferred3_0;
|
|
263
|
+
let deferred3_1;
|
|
264
|
+
try {
|
|
265
|
+
const ptr0 = passStringToWasm0(brep_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
266
|
+
const len0 = WASM_VECTOR_LEN;
|
|
267
|
+
const ret = wasm.checkBrepValidity(ptr0, len0);
|
|
268
|
+
var ptr2 = ret[0];
|
|
269
|
+
var len2 = ret[1];
|
|
270
|
+
if (ret[3]) {
|
|
271
|
+
ptr2 = 0; len2 = 0;
|
|
272
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
273
|
+
}
|
|
274
|
+
deferred3_0 = ptr2;
|
|
275
|
+
deferred3_1 = len2;
|
|
276
|
+
return getStringFromWasm0(ptr2, len2);
|
|
277
|
+
} finally {
|
|
278
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Wasm entry point: heal a serialized B-rep, returning JSON
|
|
284
|
+
* `{ "brep": <healed brep>, "report": <heal report> }`.
|
|
285
|
+
* @param {string} brep_json
|
|
286
|
+
* @param {number} tolerance
|
|
287
|
+
* @returns {string}
|
|
288
|
+
*/
|
|
289
|
+
export function healBrep(brep_json, tolerance) {
|
|
290
|
+
let deferred3_0;
|
|
291
|
+
let deferred3_1;
|
|
292
|
+
try {
|
|
293
|
+
const ptr0 = passStringToWasm0(brep_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
294
|
+
const len0 = WASM_VECTOR_LEN;
|
|
295
|
+
const ret = wasm.healBrep(ptr0, len0, tolerance);
|
|
296
|
+
var ptr2 = ret[0];
|
|
297
|
+
var len2 = ret[1];
|
|
298
|
+
if (ret[3]) {
|
|
299
|
+
ptr2 = 0; len2 = 0;
|
|
300
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
301
|
+
}
|
|
302
|
+
deferred3_0 = ptr2;
|
|
303
|
+
deferred3_1 = len2;
|
|
304
|
+
return getStringFromWasm0(ptr2, len2);
|
|
305
|
+
} finally {
|
|
306
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Wasm entry point: offset a centreline by `width` into stroked regions via the
|
|
312
|
+
* deterministic analytic offset. `centreline_flat` is `[x0,y0,z0, …]`. Returns
|
|
313
|
+
* CW-outer / CCW-hole regions, canonicalised; empty (does NOT throw) when degenerate.
|
|
314
|
+
* @param {Float64Array} centreline_flat
|
|
315
|
+
* @param {number} width
|
|
316
|
+
* @param {boolean} closed
|
|
317
|
+
* @param {number} miter_limit
|
|
318
|
+
* @returns {OGOffsetRegionsResult}
|
|
319
|
+
*/
|
|
320
|
+
export function offsetPolylineRegions(centreline_flat, width, closed, miter_limit) {
|
|
321
|
+
const ptr0 = passArrayF64ToWasm0(centreline_flat, wasm.__wbindgen_malloc);
|
|
322
|
+
const len0 = WASM_VECTOR_LEN;
|
|
323
|
+
const ret = wasm.offsetPolylineRegions(ptr0, len0, width, closed, miter_limit);
|
|
324
|
+
if (ret[2]) {
|
|
325
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
326
|
+
}
|
|
327
|
+
return OGOffsetRegionsResult.__wrap(ret[0]);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Wasm entry point: merge a GROUP of separate polylines (a crossing T / X / L
|
|
332
|
+
* overlap) into one clean stroked region by nonzero-winding union of their mitered
|
|
333
|
+
* bands. `polylines_json` is `[{centreline:[x,y,z,…], width, closed}, …]`. Returns
|
|
334
|
+
* CW-outer / CCW-hole regions (one or more); empty when nothing is buildable.
|
|
335
|
+
* @param {string} polylines_json
|
|
336
|
+
* @returns {OGOffsetRegionsResult}
|
|
337
|
+
*/
|
|
338
|
+
export function offsetPolylineGroupRegions(polylines_json) {
|
|
339
|
+
const ptr0 = passStringToWasm0(polylines_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
340
|
+
const len0 = WASM_VECTOR_LEN;
|
|
341
|
+
const ret = wasm.offsetPolylineGroupRegions(ptr0, len0);
|
|
342
|
+
if (ret[2]) {
|
|
343
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
344
|
+
}
|
|
345
|
+
return OGOffsetRegionsResult.__wrap(ret[0]);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Wasm entry point: inset a CLOSED ring inward with one distance per edge
|
|
350
|
+
* (edge i = ring[i] → ring[i+1]). `ring_flat` is `[x0,y0,z0, …]`;
|
|
351
|
+
* `holes_json` is `[{ring:[x,y,z,…], distances:[…]}, …]` (`"[]"` = none) —
|
|
352
|
+
* excluded interior rings, each grown outward by its own per-edge distances.
|
|
353
|
+
* Returns CW-outer / CCW-hole regions, canonicalised; possibly several when a
|
|
354
|
+
* deep inset (or a hole) splits the ring, and empty (does NOT throw) when the
|
|
355
|
+
* inset collapses or the outer ring is degenerate. THROWS on malformed
|
|
356
|
+
* arguments: a distance count that does not match an edge count, a negative /
|
|
357
|
+
* non-finite distance, a degenerate hole, or unparsable `holes_json`. Corners
|
|
358
|
+
* where distances differ are circumscribed clearance arcs (conservative), so
|
|
359
|
+
* no output point is ever closer to an edge than that edge's distance —
|
|
360
|
+
* there is no miter-limit knob because there are no miters.
|
|
361
|
+
* @param {Float64Array} ring_flat
|
|
362
|
+
* @param {Float64Array} distances
|
|
363
|
+
* @param {string} holes_json
|
|
364
|
+
* @returns {OGOffsetRegionsResult}
|
|
365
|
+
*/
|
|
366
|
+
export function offsetRingVariable(ring_flat, distances, holes_json) {
|
|
367
|
+
const ptr0 = passArrayF64ToWasm0(ring_flat, wasm.__wbindgen_malloc);
|
|
368
|
+
const len0 = WASM_VECTOR_LEN;
|
|
369
|
+
const ptr1 = passArrayF64ToWasm0(distances, wasm.__wbindgen_malloc);
|
|
370
|
+
const len1 = WASM_VECTOR_LEN;
|
|
371
|
+
const ptr2 = passStringToWasm0(holes_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
372
|
+
const len2 = WASM_VECTOR_LEN;
|
|
373
|
+
const ret = wasm.offsetRingVariable(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
374
|
+
if (ret[2]) {
|
|
375
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
376
|
+
}
|
|
377
|
+
return OGOffsetRegionsResult.__wrap(ret[0]);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* @param {string} local_brep_serialized
|
|
382
|
+
* @param {number} height
|
|
383
|
+
* @returns {string}
|
|
384
|
+
*/
|
|
385
|
+
export function extrudeBrepFace(local_brep_serialized, height) {
|
|
386
|
+
let deferred3_0;
|
|
387
|
+
let deferred3_1;
|
|
388
|
+
try {
|
|
389
|
+
const ptr0 = passStringToWasm0(local_brep_serialized, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
390
|
+
const len0 = WASM_VECTOR_LEN;
|
|
391
|
+
const ret = wasm.extrudeBrepFace(ptr0, len0, height);
|
|
392
|
+
var ptr2 = ret[0];
|
|
393
|
+
var len2 = ret[1];
|
|
394
|
+
if (ret[3]) {
|
|
395
|
+
ptr2 = 0; len2 = 0;
|
|
396
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
397
|
+
}
|
|
398
|
+
deferred3_0 = ptr2;
|
|
399
|
+
deferred3_1 = len2;
|
|
400
|
+
return getStringFromWasm0(ptr2, len2);
|
|
401
|
+
} finally {
|
|
402
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Wasm entry point for general extrude. `direction` is `[x,y,z]`; `extent_kind`
|
|
408
|
+
* is `"one_sided" | "symmetric" | "two_sided"`; `d_plus`/`d_minus` are the
|
|
409
|
+
* extent distances (`d_minus` ignored unless two-sided, `d_plus` is the
|
|
410
|
+
* distance for one-sided/symmetric).
|
|
411
|
+
* @param {string} local_brep_serialized
|
|
412
|
+
* @param {Float64Array} direction
|
|
413
|
+
* @param {string} extent_kind
|
|
414
|
+
* @param {number} d_plus
|
|
415
|
+
* @param {number} d_minus
|
|
416
|
+
* @returns {string}
|
|
417
|
+
*/
|
|
418
|
+
export function extrudeBrepFaceDirectional(local_brep_serialized, direction, extent_kind, d_plus, d_minus) {
|
|
419
|
+
let deferred5_0;
|
|
420
|
+
let deferred5_1;
|
|
421
|
+
try {
|
|
422
|
+
const ptr0 = passStringToWasm0(local_brep_serialized, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
423
|
+
const len0 = WASM_VECTOR_LEN;
|
|
424
|
+
const ptr1 = passArrayF64ToWasm0(direction, wasm.__wbindgen_malloc);
|
|
425
|
+
const len1 = WASM_VECTOR_LEN;
|
|
426
|
+
const ptr2 = passStringToWasm0(extent_kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
427
|
+
const len2 = WASM_VECTOR_LEN;
|
|
428
|
+
const ret = wasm.extrudeBrepFaceDirectional(ptr0, len0, ptr1, len1, ptr2, len2, d_plus, d_minus);
|
|
429
|
+
var ptr4 = ret[0];
|
|
430
|
+
var len4 = ret[1];
|
|
431
|
+
if (ret[3]) {
|
|
432
|
+
ptr4 = 0; len4 = 0;
|
|
433
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
434
|
+
}
|
|
435
|
+
deferred5_0 = ptr4;
|
|
436
|
+
deferred5_1 = len4;
|
|
437
|
+
return getStringFromWasm0(ptr4, len4);
|
|
438
|
+
} finally {
|
|
439
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
210
443
|
/**
|
|
211
444
|
* Wasm entry point for union.
|
|
212
445
|
* @param {string} lhs_brep_serialized
|
|
@@ -292,40 +525,22 @@ export function booleanSubtractionMany(lhs_brep_serialized, cutters_brep_seriali
|
|
|
292
525
|
}
|
|
293
526
|
|
|
294
527
|
/**
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
* @
|
|
528
|
+
* Wasm entry point for array-backed batched union. Accepts a JSON array of
|
|
529
|
+
* serialized BReps and folds them with `batch_union` in one boundary crossing.
|
|
530
|
+
* @param {string} operands_brep_serialized
|
|
531
|
+
* @param {string | null} [options_json]
|
|
532
|
+
* @returns {OGBooleanResult}
|
|
298
533
|
*/
|
|
299
|
-
export function
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
var len2 = ret[1];
|
|
308
|
-
if (ret[3]) {
|
|
309
|
-
ptr2 = 0; len2 = 0;
|
|
310
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
311
|
-
}
|
|
312
|
-
deferred3_0 = ptr2;
|
|
313
|
-
deferred3_1 = len2;
|
|
314
|
-
return getStringFromWasm0(ptr2, len2);
|
|
315
|
-
} finally {
|
|
316
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
function getArrayJsValueFromWasm0(ptr, len) {
|
|
321
|
-
ptr = ptr >>> 0;
|
|
322
|
-
const mem = getDataViewMemory0();
|
|
323
|
-
const result = [];
|
|
324
|
-
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
325
|
-
result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
|
|
534
|
+
export function batchUnion(operands_brep_serialized, options_json) {
|
|
535
|
+
const ptr0 = passStringToWasm0(operands_brep_serialized, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
536
|
+
const len0 = WASM_VECTOR_LEN;
|
|
537
|
+
var ptr1 = isLikeNone(options_json) ? 0 : passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
538
|
+
var len1 = WASM_VECTOR_LEN;
|
|
539
|
+
const ret = wasm.batchUnion(ptr0, len0, ptr1, len1);
|
|
540
|
+
if (ret[2]) {
|
|
541
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
326
542
|
}
|
|
327
|
-
|
|
328
|
-
return result;
|
|
543
|
+
return OGBooleanResult.__wrap(ret[0]);
|
|
329
544
|
}
|
|
330
545
|
|
|
331
546
|
const Matrix3Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -1719,6 +1934,224 @@ export class OGCylinder {
|
|
|
1719
1934
|
}
|
|
1720
1935
|
}
|
|
1721
1936
|
|
|
1937
|
+
const OGEllipticalArcFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1938
|
+
? { register: () => {}, unregister: () => {} }
|
|
1939
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ogellipticalarc_free(ptr >>> 0, 1));
|
|
1940
|
+
|
|
1941
|
+
export class OGEllipticalArc {
|
|
1942
|
+
|
|
1943
|
+
__destroy_into_raw() {
|
|
1944
|
+
const ptr = this.__wbg_ptr;
|
|
1945
|
+
this.__wbg_ptr = 0;
|
|
1946
|
+
OGEllipticalArcFinalization.unregister(this);
|
|
1947
|
+
return ptr;
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
free() {
|
|
1951
|
+
const ptr = this.__destroy_into_raw();
|
|
1952
|
+
wasm.__wbg_ogellipticalarc_free(ptr, 0);
|
|
1953
|
+
}
|
|
1954
|
+
/**
|
|
1955
|
+
* @param {string} id
|
|
1956
|
+
*/
|
|
1957
|
+
set id(id) {
|
|
1958
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1959
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1960
|
+
wasm.ogellipticalarc_set_id(this.__wbg_ptr, ptr0, len0);
|
|
1961
|
+
}
|
|
1962
|
+
/**
|
|
1963
|
+
* @returns {string}
|
|
1964
|
+
*/
|
|
1965
|
+
get id() {
|
|
1966
|
+
let deferred1_0;
|
|
1967
|
+
let deferred1_1;
|
|
1968
|
+
try {
|
|
1969
|
+
const ret = wasm.ogellipticalarc_id(this.__wbg_ptr);
|
|
1970
|
+
deferred1_0 = ret[0];
|
|
1971
|
+
deferred1_1 = ret[1];
|
|
1972
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1973
|
+
} finally {
|
|
1974
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
/**
|
|
1978
|
+
* @param {string} id
|
|
1979
|
+
*/
|
|
1980
|
+
constructor(id) {
|
|
1981
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1982
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1983
|
+
const ret = wasm.ogellipticalarc_new(ptr0, len0);
|
|
1984
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1985
|
+
OGEllipticalArcFinalization.register(this, this.__wbg_ptr, this);
|
|
1986
|
+
return this;
|
|
1987
|
+
}
|
|
1988
|
+
/**
|
|
1989
|
+
* @param {Vector3} center
|
|
1990
|
+
* @param {number} radius_x
|
|
1991
|
+
* @param {number} radius_z
|
|
1992
|
+
* @param {number} start_angle
|
|
1993
|
+
* @param {number} end_angle
|
|
1994
|
+
* @param {number} segments
|
|
1995
|
+
*/
|
|
1996
|
+
set_config(center, radius_x, radius_z, start_angle, end_angle, segments) {
|
|
1997
|
+
_assertClass(center, Vector3);
|
|
1998
|
+
var ptr0 = center.__destroy_into_raw();
|
|
1999
|
+
const ret = wasm.ogellipticalarc_set_config(this.__wbg_ptr, ptr0, radius_x, radius_z, start_angle, end_angle, segments);
|
|
2000
|
+
if (ret[1]) {
|
|
2001
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
/**
|
|
2005
|
+
* @param {Vector3} center
|
|
2006
|
+
*/
|
|
2007
|
+
set_center(center) {
|
|
2008
|
+
_assertClass(center, Vector3);
|
|
2009
|
+
var ptr0 = center.__destroy_into_raw();
|
|
2010
|
+
wasm.ogellipticalarc_set_center(this.__wbg_ptr, ptr0);
|
|
2011
|
+
}
|
|
2012
|
+
/**
|
|
2013
|
+
* @param {Vector3} position
|
|
2014
|
+
* @param {Vector3} rotation
|
|
2015
|
+
* @param {Vector3} scale
|
|
2016
|
+
*/
|
|
2017
|
+
set_transform(position, rotation, scale) {
|
|
2018
|
+
_assertClass(position, Vector3);
|
|
2019
|
+
var ptr0 = position.__destroy_into_raw();
|
|
2020
|
+
_assertClass(rotation, Vector3);
|
|
2021
|
+
var ptr1 = rotation.__destroy_into_raw();
|
|
2022
|
+
_assertClass(scale, Vector3);
|
|
2023
|
+
var ptr2 = scale.__destroy_into_raw();
|
|
2024
|
+
const ret = wasm.ogellipticalarc_set_transform(this.__wbg_ptr, ptr0, ptr1, ptr2);
|
|
2025
|
+
if (ret[1]) {
|
|
2026
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
/**
|
|
2030
|
+
* @param {Vector3} translation
|
|
2031
|
+
*/
|
|
2032
|
+
set_translation(translation) {
|
|
2033
|
+
_assertClass(translation, Vector3);
|
|
2034
|
+
var ptr0 = translation.__destroy_into_raw();
|
|
2035
|
+
wasm.ogellipticalarc_set_translation(this.__wbg_ptr, ptr0);
|
|
2036
|
+
}
|
|
2037
|
+
/**
|
|
2038
|
+
* @param {Vector3} rotation
|
|
2039
|
+
*/
|
|
2040
|
+
set_rotation(rotation) {
|
|
2041
|
+
_assertClass(rotation, Vector3);
|
|
2042
|
+
var ptr0 = rotation.__destroy_into_raw();
|
|
2043
|
+
wasm.ogellipticalarc_set_rotation(this.__wbg_ptr, ptr0);
|
|
2044
|
+
}
|
|
2045
|
+
/**
|
|
2046
|
+
* @param {Vector3} scale
|
|
2047
|
+
*/
|
|
2048
|
+
set_scale(scale) {
|
|
2049
|
+
_assertClass(scale, Vector3);
|
|
2050
|
+
var ptr0 = scale.__destroy_into_raw();
|
|
2051
|
+
const ret = wasm.ogellipticalarc_set_scale(this.__wbg_ptr, ptr0);
|
|
2052
|
+
if (ret[1]) {
|
|
2053
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
generate_geometry() {
|
|
2057
|
+
const ret = wasm.ogellipticalarc_generate_geometry(this.__wbg_ptr);
|
|
2058
|
+
if (ret[1]) {
|
|
2059
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
dispose_points() {
|
|
2063
|
+
wasm.ogellipticalarc_dispose_points(this.__wbg_ptr);
|
|
2064
|
+
}
|
|
2065
|
+
destroy() {
|
|
2066
|
+
wasm.ogellipticalarc_destroy(this.__wbg_ptr);
|
|
2067
|
+
}
|
|
2068
|
+
/**
|
|
2069
|
+
* @returns {string}
|
|
2070
|
+
*/
|
|
2071
|
+
get_brep_serialized() {
|
|
2072
|
+
let deferred1_0;
|
|
2073
|
+
let deferred1_1;
|
|
2074
|
+
try {
|
|
2075
|
+
const ret = wasm.ogellipticalarc_get_brep_serialized(this.__wbg_ptr);
|
|
2076
|
+
deferred1_0 = ret[0];
|
|
2077
|
+
deferred1_1 = ret[1];
|
|
2078
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2079
|
+
} finally {
|
|
2080
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
/**
|
|
2084
|
+
* @returns {string}
|
|
2085
|
+
*/
|
|
2086
|
+
get_local_brep_serialized() {
|
|
2087
|
+
let deferred1_0;
|
|
2088
|
+
let deferred1_1;
|
|
2089
|
+
try {
|
|
2090
|
+
const ret = wasm.ogellipticalarc_get_local_brep_serialized(this.__wbg_ptr);
|
|
2091
|
+
deferred1_0 = ret[0];
|
|
2092
|
+
deferred1_1 = ret[1];
|
|
2093
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2094
|
+
} finally {
|
|
2095
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
/**
|
|
2099
|
+
* @returns {string}
|
|
2100
|
+
*/
|
|
2101
|
+
get_geometry_serialized() {
|
|
2102
|
+
let deferred1_0;
|
|
2103
|
+
let deferred1_1;
|
|
2104
|
+
try {
|
|
2105
|
+
const ret = wasm.ogellipticalarc_get_geometry_serialized(this.__wbg_ptr);
|
|
2106
|
+
deferred1_0 = ret[0];
|
|
2107
|
+
deferred1_1 = ret[1];
|
|
2108
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2109
|
+
} finally {
|
|
2110
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
/**
|
|
2114
|
+
* @returns {string}
|
|
2115
|
+
*/
|
|
2116
|
+
get_local_geometry_serialized() {
|
|
2117
|
+
let deferred1_0;
|
|
2118
|
+
let deferred1_1;
|
|
2119
|
+
try {
|
|
2120
|
+
const ret = wasm.ogellipticalarc_get_local_geometry_serialized(this.__wbg_ptr);
|
|
2121
|
+
deferred1_0 = ret[0];
|
|
2122
|
+
deferred1_1 = ret[1];
|
|
2123
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2124
|
+
} finally {
|
|
2125
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
/**
|
|
2129
|
+
* @returns {Float64Array}
|
|
2130
|
+
*/
|
|
2131
|
+
get_geometry_buffer() {
|
|
2132
|
+
const ret = wasm.ogellipticalarc_get_geometry_buffer(this.__wbg_ptr);
|
|
2133
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
2134
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
2135
|
+
return v1;
|
|
2136
|
+
}
|
|
2137
|
+
/**
|
|
2138
|
+
* @returns {Float64Array}
|
|
2139
|
+
*/
|
|
2140
|
+
get_local_geometry_buffer() {
|
|
2141
|
+
const ret = wasm.ogellipticalarc_get_local_geometry_buffer(this.__wbg_ptr);
|
|
2142
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
2143
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
2144
|
+
return v1;
|
|
2145
|
+
}
|
|
2146
|
+
/**
|
|
2147
|
+
* @returns {Vector3}
|
|
2148
|
+
*/
|
|
2149
|
+
get_anchor() {
|
|
2150
|
+
const ret = wasm.ogellipticalarc_get_anchor(this.__wbg_ptr);
|
|
2151
|
+
return Vector3.__wrap(ret);
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
|
|
1722
2155
|
const OGEntityRegistryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1723
2156
|
? { register: () => {}, unregister: () => {} }
|
|
1724
2157
|
: new FinalizationRegistry(ptr => wasm.__wbg_ogentityregistry_free(ptr >>> 0, 1));
|
|
@@ -2801,7 +3234,7 @@ export class OGLine {
|
|
|
2801
3234
|
* @returns {Vector3}
|
|
2802
3235
|
*/
|
|
2803
3236
|
get_anchor() {
|
|
2804
|
-
const ret = wasm.
|
|
3237
|
+
const ret = wasm.ogline_get_anchor(this.__wbg_ptr);
|
|
2805
3238
|
return Vector3.__wrap(ret);
|
|
2806
3239
|
}
|
|
2807
3240
|
/**
|
|
@@ -2856,6 +3289,53 @@ export class OGLine {
|
|
|
2856
3289
|
}
|
|
2857
3290
|
}
|
|
2858
3291
|
|
|
3292
|
+
const OGOffsetRegionsResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3293
|
+
? { register: () => {}, unregister: () => {} }
|
|
3294
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ogoffsetregionsresult_free(ptr >>> 0, 1));
|
|
3295
|
+
/**
|
|
3296
|
+
* Result payload for a polyline offset: a list of regions (each an outer ring +
|
|
3297
|
+
* inner-void holes). Normally one region; a self-crossing closed centreline (e.g.
|
|
3298
|
+
* a figure-8) yields one per simple sub-loop. The deterministic analytic offset —
|
|
3299
|
+
* no extrude/solid. Used to build the plan polygons + extruded base solids in JS.
|
|
3300
|
+
*/
|
|
3301
|
+
export class OGOffsetRegionsResult {
|
|
3302
|
+
|
|
3303
|
+
static __wrap(ptr) {
|
|
3304
|
+
ptr = ptr >>> 0;
|
|
3305
|
+
const obj = Object.create(OGOffsetRegionsResult.prototype);
|
|
3306
|
+
obj.__wbg_ptr = ptr;
|
|
3307
|
+
OGOffsetRegionsResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3308
|
+
return obj;
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3311
|
+
__destroy_into_raw() {
|
|
3312
|
+
const ptr = this.__wbg_ptr;
|
|
3313
|
+
this.__wbg_ptr = 0;
|
|
3314
|
+
OGOffsetRegionsResultFinalization.unregister(this);
|
|
3315
|
+
return ptr;
|
|
3316
|
+
}
|
|
3317
|
+
|
|
3318
|
+
free() {
|
|
3319
|
+
const ptr = this.__destroy_into_raw();
|
|
3320
|
+
wasm.__wbg_ogoffsetregionsresult_free(ptr, 0);
|
|
3321
|
+
}
|
|
3322
|
+
/**
|
|
3323
|
+
* @returns {string}
|
|
3324
|
+
*/
|
|
3325
|
+
get regionsSerialized() {
|
|
3326
|
+
let deferred1_0;
|
|
3327
|
+
let deferred1_1;
|
|
3328
|
+
try {
|
|
3329
|
+
const ret = wasm.ogoffsetregionsresult_regionsSerialized(this.__wbg_ptr);
|
|
3330
|
+
deferred1_0 = ret[0];
|
|
3331
|
+
deferred1_1 = ret[1];
|
|
3332
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
3333
|
+
} finally {
|
|
3334
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
}
|
|
3338
|
+
|
|
2859
3339
|
const OGPolygonFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2860
3340
|
? { register: () => {}, unregister: () => {} }
|
|
2861
3341
|
: new FinalizationRegistry(ptr => wasm.__wbg_ogpolygon_free(ptr >>> 0, 1));
|
|
@@ -3434,7 +3914,7 @@ export class OGPolyline {
|
|
|
3434
3914
|
* @returns {Vector3}
|
|
3435
3915
|
*/
|
|
3436
3916
|
get_anchor() {
|
|
3437
|
-
const ret = wasm.
|
|
3917
|
+
const ret = wasm.ogline_get_anchor(this.__wbg_ptr);
|
|
3438
3918
|
return Vector3.__wrap(ret);
|
|
3439
3919
|
}
|
|
3440
3920
|
/**
|
|
@@ -4763,7 +5243,7 @@ export class OGSphere {
|
|
|
4763
5243
|
* @returns {Vector3}
|
|
4764
5244
|
*/
|
|
4765
5245
|
get_anchor() {
|
|
4766
|
-
const ret = wasm.
|
|
5246
|
+
const ret = wasm.ogline_get_anchor(this.__wbg_ptr);
|
|
4767
5247
|
return Vector3.__wrap(ret);
|
|
4768
5248
|
}
|
|
4769
5249
|
}
|
|
@@ -5156,7 +5636,7 @@ export class OGSweep {
|
|
|
5156
5636
|
* @returns {Vector3}
|
|
5157
5637
|
*/
|
|
5158
5638
|
get_anchor() {
|
|
5159
|
-
const ret = wasm.
|
|
5639
|
+
const ret = wasm.ogellipticalarc_get_anchor(this.__wbg_ptr);
|
|
5160
5640
|
return Vector3.__wrap(ret);
|
|
5161
5641
|
}
|
|
5162
5642
|
/**
|
|
@@ -5739,6 +6219,104 @@ export class Vector3 {
|
|
|
5739
6219
|
}
|
|
5740
6220
|
}
|
|
5741
6221
|
|
|
6222
|
+
const WorkPlaneFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6223
|
+
? { register: () => {}, unregister: () => {} }
|
|
6224
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_workplane_free(ptr >>> 0, 1));
|
|
6225
|
+
|
|
6226
|
+
export class WorkPlane {
|
|
6227
|
+
|
|
6228
|
+
static __wrap(ptr) {
|
|
6229
|
+
ptr = ptr >>> 0;
|
|
6230
|
+
const obj = Object.create(WorkPlane.prototype);
|
|
6231
|
+
obj.__wbg_ptr = ptr;
|
|
6232
|
+
WorkPlaneFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
6233
|
+
return obj;
|
|
6234
|
+
}
|
|
6235
|
+
|
|
6236
|
+
__destroy_into_raw() {
|
|
6237
|
+
const ptr = this.__wbg_ptr;
|
|
6238
|
+
this.__wbg_ptr = 0;
|
|
6239
|
+
WorkPlaneFinalization.unregister(this);
|
|
6240
|
+
return ptr;
|
|
6241
|
+
}
|
|
6242
|
+
|
|
6243
|
+
free() {
|
|
6244
|
+
const ptr = this.__destroy_into_raw();
|
|
6245
|
+
wasm.__wbg_workplane_free(ptr, 0);
|
|
6246
|
+
}
|
|
6247
|
+
/**
|
|
6248
|
+
* Builds a work plane from an origin and normal, choosing a stable in-plane
|
|
6249
|
+
* `u` axis automatically (`v = normal × u`).
|
|
6250
|
+
* @param {Vector3} origin
|
|
6251
|
+
* @param {Vector3} normal
|
|
6252
|
+
* @returns {WorkPlane}
|
|
6253
|
+
*/
|
|
6254
|
+
static fromOriginNormal(origin, normal) {
|
|
6255
|
+
_assertClass(origin, Vector3);
|
|
6256
|
+
var ptr0 = origin.__destroy_into_raw();
|
|
6257
|
+
_assertClass(normal, Vector3);
|
|
6258
|
+
var ptr1 = normal.__destroy_into_raw();
|
|
6259
|
+
const ret = wasm.workplane_fromOriginNormal(ptr0, ptr1);
|
|
6260
|
+
return WorkPlane.__wrap(ret);
|
|
6261
|
+
}
|
|
6262
|
+
/**
|
|
6263
|
+
* Builds a work plane from an origin, normal, and a preferred `u` axis. The
|
|
6264
|
+
* `u` axis is projected onto the plane and orthonormalized; `v = normal × u`.
|
|
6265
|
+
* @param {Vector3} origin
|
|
6266
|
+
* @param {Vector3} normal
|
|
6267
|
+
* @param {Vector3} u_hint
|
|
6268
|
+
*/
|
|
6269
|
+
constructor(origin, normal, u_hint) {
|
|
6270
|
+
_assertClass(origin, Vector3);
|
|
6271
|
+
var ptr0 = origin.__destroy_into_raw();
|
|
6272
|
+
_assertClass(normal, Vector3);
|
|
6273
|
+
var ptr1 = normal.__destroy_into_raw();
|
|
6274
|
+
_assertClass(u_hint, Vector3);
|
|
6275
|
+
var ptr2 = u_hint.__destroy_into_raw();
|
|
6276
|
+
const ret = wasm.workplane_new(ptr0, ptr1, ptr2);
|
|
6277
|
+
this.__wbg_ptr = ret >>> 0;
|
|
6278
|
+
WorkPlaneFinalization.register(this, this.__wbg_ptr, this);
|
|
6279
|
+
return this;
|
|
6280
|
+
}
|
|
6281
|
+
/**
|
|
6282
|
+
* Lifts a single 2D in-plane coordinate to 3D world space.
|
|
6283
|
+
* @param {number} u
|
|
6284
|
+
* @param {number} v
|
|
6285
|
+
* @returns {Vector3}
|
|
6286
|
+
*/
|
|
6287
|
+
liftPoint(u, v) {
|
|
6288
|
+
const ret = wasm.workplane_liftPoint(this.__wbg_ptr, u, v);
|
|
6289
|
+
return Vector3.__wrap(ret);
|
|
6290
|
+
}
|
|
6291
|
+
/**
|
|
6292
|
+
* Lifts a flat `[u0,v0,u1,v1,…]` buffer to a flat `[x0,y0,z0,…]` world buffer.
|
|
6293
|
+
* @param {Float64Array} uv
|
|
6294
|
+
* @returns {Float64Array}
|
|
6295
|
+
*/
|
|
6296
|
+
liftPoints(uv) {
|
|
6297
|
+
const ptr0 = passArrayF64ToWasm0(uv, wasm.__wbindgen_malloc);
|
|
6298
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6299
|
+
const ret = wasm.workplane_liftPoints(this.__wbg_ptr, ptr0, len0);
|
|
6300
|
+
var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
6301
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
6302
|
+
return v2;
|
|
6303
|
+
}
|
|
6304
|
+
/**
|
|
6305
|
+
* @returns {Vector3}
|
|
6306
|
+
*/
|
|
6307
|
+
get origin() {
|
|
6308
|
+
const ret = wasm.workplane_origin(this.__wbg_ptr);
|
|
6309
|
+
return Vector3.__wrap(ret);
|
|
6310
|
+
}
|
|
6311
|
+
/**
|
|
6312
|
+
* @returns {Vector3}
|
|
6313
|
+
*/
|
|
6314
|
+
get normal() {
|
|
6315
|
+
const ret = wasm.workplane_normal(this.__wbg_ptr);
|
|
6316
|
+
return Vector3.__wrap(ret);
|
|
6317
|
+
}
|
|
6318
|
+
}
|
|
6319
|
+
|
|
5742
6320
|
async function __wbg_load(module, imports) {
|
|
5743
6321
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
5744
6322
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|