opengeometry 2.0.13 → 2.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +4 -4
  2. package/analytic-worker.js +90 -0
  3. package/index.d.ts +16 -1
  4. package/index.js +3096 -3551
  5. package/index.js.map +1 -1
  6. package/opengeometry/pkg/opengeometry.d.ts +383 -347
  7. package/opengeometry/pkg/opengeometry.js +793 -506
  8. package/opengeometry/pkg/opengeometry_bg.wasm +0 -0
  9. package/opengeometry/pkg/opengeometry_bg.wasm.d.ts +300 -276
  10. package/opengeometry_bg.wasm +0 -0
  11. package/opengeometry_bg.wasm.d.ts +300 -276
  12. package/package.json +3 -4
  13. package/src/examples/booleans.d.ts +3 -2
  14. package/src/examples/editor-modes.d.ts +4 -8
  15. package/src/examples/index.d.ts +1 -1
  16. package/src/examples/ribbon-from-offsets.d.ts +33 -0
  17. package/src/examples/shapes.d.ts +1 -1
  18. package/src/export/analytic-ifc.d.ts +61 -0
  19. package/src/freeform/geometry.d.ts +2 -0
  20. package/src/freeform/index.d.ts +1 -1
  21. package/src/operations/analytic-errors.d.ts +8 -0
  22. package/src/operations/boolean-regions.d.ts +20 -0
  23. package/src/operations/boolean.d.ts +9 -141
  24. package/src/operations/index.d.ts +3 -1
  25. package/src/operations/loft.d.ts +13 -0
  26. package/src/operations/offset-regions.d.ts +11 -12
  27. package/src/primitives/analytic-curve.d.ts +42 -0
  28. package/src/primitives/arc.d.ts +26 -55
  29. package/src/primitives/elliptical_arc.d.ts +29 -57
  30. package/src/rendering/analytic-lod.d.ts +32 -0
  31. package/src/rendering/analytic-tessellation.d.ts +32 -0
  32. package/src/shapes/analytic-pattern.d.ts +36 -0
  33. package/src/shapes/analytic-solid.d.ts +304 -0
  34. package/src/shapes/cuboid.d.ts +40 -54
  35. package/src/shapes/cylinder.d.ts +26 -70
  36. package/src/shapes/opening.d.ts +19 -82
  37. package/src/shapes/polygon.d.ts +4 -5
  38. package/src/shapes/solid.d.ts +0 -8
  39. package/src/shapes/sphere.d.ts +18 -73
  40. package/src/shapes/sweep.d.ts +0 -5
  41. package/src/shapes/wedge.d.ts +0 -5
  42. package/src/examples/wall-from-offsets.d.ts +0 -40
  43. package/src/operations/boolean-errors.d.ts +0 -90
  44. package/src/shapes/boolean-subtract.d.ts +0 -21
@@ -29,69 +29,13 @@ function handleError(f, args) {
29
29
  }
30
30
  }
31
31
 
32
- function debugString(val) {
33
- // primitive types
34
- const type = typeof val;
35
- if (type == 'number' || type == 'boolean' || val == null) {
36
- return `${val}`;
37
- }
38
- if (type == 'string') {
39
- return `"${val}"`;
40
- }
41
- if (type == 'symbol') {
42
- const description = val.description;
43
- if (description == null) {
44
- return 'Symbol';
45
- } else {
46
- return `Symbol(${description})`;
47
- }
48
- }
49
- if (type == 'function') {
50
- const name = val.name;
51
- if (typeof name == 'string' && name.length > 0) {
52
- return `Function(${name})`;
53
- } else {
54
- return 'Function';
55
- }
56
- }
57
- // objects
58
- if (Array.isArray(val)) {
59
- const length = val.length;
60
- let debug = '[';
61
- if (length > 0) {
62
- debug += debugString(val[0]);
63
- }
64
- for(let i = 1; i < length; i++) {
65
- debug += ', ' + debugString(val[i]);
66
- }
67
- debug += ']';
68
- return debug;
69
- }
70
- // Test for built-in
71
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
72
- let className;
73
- if (builtInMatches && builtInMatches.length > 1) {
74
- className = builtInMatches[1];
75
- } else {
76
- // Failed to match the standard '[object ClassName]'
77
- return toString.call(val);
78
- }
79
- if (className == 'Object') {
80
- // we're a user defined class or Object
81
- // JSON.stringify avoids problems with cycles, and is generally much
82
- // easier than looping through ownProperties of `val`.
83
- try {
84
- return 'Object(' + JSON.stringify(val) + ')';
85
- } catch (_) {
86
- return 'Object';
87
- }
88
- }
89
- // errors
90
- if (val instanceof Error) {
91
- return `${val.name}: ${val.message}\n${val.stack}`;
92
- }
93
- // TODO we could test for more things here, like `Set`s and `Map`s.
94
- return className;
32
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
33
+
34
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
35
+
36
+ function getStringFromWasm0(ptr, len) {
37
+ ptr = ptr >>> 0;
38
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
95
39
  }
96
40
 
97
41
  let WASM_VECTOR_LEN = 0;
@@ -150,24 +94,6 @@ function passStringToWasm0(arg, malloc, realloc) {
150
94
  return ptr;
151
95
  }
152
96
 
153
- let cachedDataViewMemory0 = null;
154
-
155
- function getDataViewMemory0() {
156
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
157
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
158
- }
159
- return cachedDataViewMemory0;
160
- }
161
-
162
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
163
-
164
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
165
-
166
- function getStringFromWasm0(ptr, len) {
167
- ptr = ptr >>> 0;
168
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
169
- }
170
-
171
97
  function _assertClass(instance, klass) {
172
98
  if (!(instance instanceof klass)) {
173
99
  throw new Error(`expected instance of ${klass.name}`);
@@ -194,6 +120,15 @@ function getArrayF64FromWasm0(ptr, len) {
194
120
  return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
195
121
  }
196
122
 
123
+ let cachedDataViewMemory0 = null;
124
+
125
+ function getDataViewMemory0() {
126
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
127
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
128
+ }
129
+ return cachedDataViewMemory0;
130
+ }
131
+
197
132
  function passArrayJsValueToWasm0(array, malloc) {
198
133
  const ptr = malloc(array.length * 4, 4) >>> 0;
199
134
  for (let i = 0; i < array.length; i++) {
@@ -204,109 +139,69 @@ function passArrayJsValueToWasm0(array, malloc) {
204
139
  return ptr;
205
140
  }
206
141
 
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
-
225
142
  function isLikeNone(x) {
226
143
  return x === undefined || x === null;
227
144
  }
228
145
  /**
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}
146
+ * @param {string} a_json
147
+ * @param {string} b_json
148
+ * @param {string} operation
149
+ * @returns {OGOffsetRegionsResult}
233
150
  */
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);
151
+ export function booleanRegions2D(a_json, b_json, operation) {
152
+ const ptr0 = passStringToWasm0(a_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
153
+ const len0 = WASM_VECTOR_LEN;
154
+ const ptr1 = passStringToWasm0(b_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
155
+ const len1 = WASM_VECTOR_LEN;
156
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
157
+ const len2 = WASM_VECTOR_LEN;
158
+ const ret = wasm.booleanRegions2D(ptr0, len0, ptr1, len1, ptr2, len2);
159
+ if (ret[2]) {
160
+ throw takeFromExternrefTable0(ret[1]);
252
161
  }
162
+ return OGOffsetRegionsResult.__wrap(ret[0]);
253
163
  }
254
164
 
255
165
  /**
256
- * Wasm entry point: check a serialized B-rep's geometric validity, returning
257
- * the [`ValidityReport`] as JSON.
258
- * @param {string} brep_json
166
+ * Exact line/arc region Boolean. The JSON rings contain analytic edges rather
167
+ * than vertices, and the result keeps arcs as arcs. As with booleanRegions2D,
168
+ * outer rings are CW in XZ and holes are CCW.
169
+ * @param {string} a_json
170
+ * @param {string} b_json
171
+ * @param {string} operation
259
172
  * @returns {string}
260
173
  */
261
- export function checkBrepValidity(brep_json) {
262
- let deferred3_0;
263
- let deferred3_1;
174
+ export function booleanCurvedRegions2D(a_json, b_json, operation) {
175
+ let deferred5_0;
176
+ let deferred5_1;
264
177
  try {
265
- const ptr0 = passStringToWasm0(brep_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
178
+ const ptr0 = passStringToWasm0(a_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
266
179
  const len0 = WASM_VECTOR_LEN;
267
- const ret = wasm.checkBrepValidity(ptr0, len0);
268
- var ptr2 = ret[0];
269
- var len2 = ret[1];
180
+ const ptr1 = passStringToWasm0(b_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
181
+ const len1 = WASM_VECTOR_LEN;
182
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
183
+ const len2 = WASM_VECTOR_LEN;
184
+ const ret = wasm.booleanCurvedRegions2D(ptr0, len0, ptr1, len1, ptr2, len2);
185
+ var ptr4 = ret[0];
186
+ var len4 = ret[1];
270
187
  if (ret[3]) {
271
- ptr2 = 0; len2 = 0;
188
+ ptr4 = 0; len4 = 0;
272
189
  throw takeFromExternrefTable0(ret[2]);
273
190
  }
274
- deferred3_0 = ptr2;
275
- deferred3_1 = len2;
276
- return getStringFromWasm0(ptr2, len2);
191
+ deferred5_0 = ptr4;
192
+ deferred5_1 = len4;
193
+ return getStringFromWasm0(ptr4, len4);
277
194
  } finally {
278
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
195
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
279
196
  }
280
197
  }
281
198
 
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
- }
199
+ function passArrayF64ToWasm0(arg, malloc) {
200
+ const ptr = malloc(arg.length * 8, 8) >>> 0;
201
+ getFloat64ArrayMemory0().set(arg, ptr / 8);
202
+ WASM_VECTOR_LEN = arg.length;
203
+ return ptr;
308
204
  }
309
-
310
205
  /**
311
206
  * Wasm entry point: offset a centreline by `width` into stroked regions via the
312
207
  * deterministic analytic offset. `centreline_flat` is `[x0,y0,z0, …]`. Returns
@@ -331,7 +226,7 @@ export function offsetPolylineRegions(centreline_flat, width, closed, miter_limi
331
226
  * Wasm entry point: merge a GROUP of separate polylines (a crossing T / X / L
332
227
  * overlap) into one clean stroked region by nonzero-winding union of their mitered
333
228
  * 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.
229
+ * CW-outer / CCW-hole regions (one or more); empty when no region remains.
335
230
  * @param {string} polylines_json
336
231
  * @returns {OGOffsetRegionsResult}
337
232
  */
@@ -441,106 +336,166 @@ export function extrudeBrepFaceDirectional(local_brep_serialized, direction, ext
441
336
  }
442
337
 
443
338
  /**
444
- * Wasm entry point for union.
445
- * @param {string} lhs_brep_serialized
446
- * @param {string} rhs_brep_serialized
447
- * @param {string | null} [options_json]
448
- * @returns {OGBooleanResult}
339
+ * Wasm entry point: analyze a flat `[x0,y0,z0,…]` loop, returning the report as
340
+ * JSON (the corrected points are not returned here; use the kernel API).
341
+ * @param {Float64Array} flat_points
342
+ * @returns {string}
449
343
  */
450
- export function booleanUnion(lhs_brep_serialized, rhs_brep_serialized, options_json) {
451
- const ptr0 = passStringToWasm0(lhs_brep_serialized, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
452
- const len0 = WASM_VECTOR_LEN;
453
- const ptr1 = passStringToWasm0(rhs_brep_serialized, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
454
- const len1 = WASM_VECTOR_LEN;
455
- var ptr2 = isLikeNone(options_json) ? 0 : passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
456
- var len2 = WASM_VECTOR_LEN;
457
- const ret = wasm.booleanUnion(ptr0, len0, ptr1, len1, ptr2, len2);
458
- if (ret[2]) {
459
- throw takeFromExternrefTable0(ret[1]);
344
+ export function analyzeProfile(flat_points) {
345
+ let deferred3_0;
346
+ let deferred3_1;
347
+ try {
348
+ const ptr0 = passArrayF64ToWasm0(flat_points, wasm.__wbindgen_malloc);
349
+ const len0 = WASM_VECTOR_LEN;
350
+ const ret = wasm.analyzeProfile(ptr0, len0);
351
+ var ptr2 = ret[0];
352
+ var len2 = ret[1];
353
+ if (ret[3]) {
354
+ ptr2 = 0; len2 = 0;
355
+ throw takeFromExternrefTable0(ret[2]);
356
+ }
357
+ deferred3_0 = ptr2;
358
+ deferred3_1 = len2;
359
+ return getStringFromWasm0(ptr2, len2);
360
+ } finally {
361
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
460
362
  }
461
- return OGBooleanResult.__wrap(ret[0]);
462
363
  }
463
364
 
464
- /**
465
- * Wasm entry point for intersection.
466
- * @param {string} lhs_brep_serialized
467
- * @param {string} rhs_brep_serialized
468
- * @param {string | null} [options_json]
469
- * @returns {OGBooleanResult}
470
- */
471
- export function booleanIntersection(lhs_brep_serialized, rhs_brep_serialized, options_json) {
472
- const ptr0 = passStringToWasm0(lhs_brep_serialized, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
473
- const len0 = WASM_VECTOR_LEN;
474
- const ptr1 = passStringToWasm0(rhs_brep_serialized, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
475
- const len1 = WASM_VECTOR_LEN;
476
- var ptr2 = isLikeNone(options_json) ? 0 : passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
477
- var len2 = WASM_VECTOR_LEN;
478
- const ret = wasm.booleanIntersection(ptr0, len0, ptr1, len1, ptr2, len2);
479
- if (ret[2]) {
480
- throw takeFromExternrefTable0(ret[1]);
365
+ function getArrayJsValueFromWasm0(ptr, len) {
366
+ ptr = ptr >>> 0;
367
+ const mem = getDataViewMemory0();
368
+ const result = [];
369
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
370
+ result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
481
371
  }
482
- return OGBooleanResult.__wrap(ret[0]);
372
+ wasm.__externref_drop_slice(ptr, len);
373
+ return result;
483
374
  }
484
-
485
375
  /**
486
- * Wasm entry point for subtraction.
487
- * @param {string} lhs_brep_serialized
488
- * @param {string} rhs_brep_serialized
489
- * @param {string | null} [options_json]
490
- * @returns {OGBooleanResult}
376
+ * Wasm entry point: check a serialized B-rep's geometric validity, returning
377
+ * the [`ValidityReport`] as JSON.
378
+ * @param {string} brep_json
379
+ * @returns {string}
491
380
  */
492
- export function booleanSubtraction(lhs_brep_serialized, rhs_brep_serialized, options_json) {
493
- const ptr0 = passStringToWasm0(lhs_brep_serialized, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
494
- const len0 = WASM_VECTOR_LEN;
495
- const ptr1 = passStringToWasm0(rhs_brep_serialized, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
496
- const len1 = WASM_VECTOR_LEN;
497
- var ptr2 = isLikeNone(options_json) ? 0 : passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
498
- var len2 = WASM_VECTOR_LEN;
499
- const ret = wasm.booleanSubtraction(ptr0, len0, ptr1, len1, ptr2, len2);
500
- if (ret[2]) {
501
- throw takeFromExternrefTable0(ret[1]);
381
+ export function checkBrepValidity(brep_json) {
382
+ let deferred3_0;
383
+ let deferred3_1;
384
+ try {
385
+ const ptr0 = passStringToWasm0(brep_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
386
+ const len0 = WASM_VECTOR_LEN;
387
+ const ret = wasm.checkBrepValidity(ptr0, len0);
388
+ var ptr2 = ret[0];
389
+ var len2 = ret[1];
390
+ if (ret[3]) {
391
+ ptr2 = 0; len2 = 0;
392
+ throw takeFromExternrefTable0(ret[2]);
393
+ }
394
+ deferred3_0 = ptr2;
395
+ deferred3_1 = len2;
396
+ return getStringFromWasm0(ptr2, len2);
397
+ } finally {
398
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
502
399
  }
503
- return OGBooleanResult.__wrap(ret[0]);
504
400
  }
505
401
 
506
402
  /**
507
- * Wasm entry point for array-backed repeated subtraction.
508
- * @param {string} lhs_brep_serialized
509
- * @param {string} cutters_brep_serialized
510
- * @param {string | null} [options_json]
511
- * @returns {OGBooleanResult}
403
+ * Wasm entry point: heal a serialized B-rep, returning JSON
404
+ * `{ "brep": <healed brep>, "report": <heal report> }`.
405
+ * @param {string} brep_json
406
+ * @param {number} tolerance
407
+ * @returns {string}
512
408
  */
513
- export function booleanSubtractionMany(lhs_brep_serialized, cutters_brep_serialized, options_json) {
514
- const ptr0 = passStringToWasm0(lhs_brep_serialized, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
515
- const len0 = WASM_VECTOR_LEN;
516
- const ptr1 = passStringToWasm0(cutters_brep_serialized, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
517
- const len1 = WASM_VECTOR_LEN;
518
- var ptr2 = isLikeNone(options_json) ? 0 : passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
519
- var len2 = WASM_VECTOR_LEN;
520
- const ret = wasm.booleanSubtractionMany(ptr0, len0, ptr1, len1, ptr2, len2);
521
- if (ret[2]) {
522
- throw takeFromExternrefTable0(ret[1]);
409
+ export function healBrep(brep_json, tolerance) {
410
+ let deferred3_0;
411
+ let deferred3_1;
412
+ try {
413
+ const ptr0 = passStringToWasm0(brep_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
414
+ const len0 = WASM_VECTOR_LEN;
415
+ const ret = wasm.healBrep(ptr0, len0, tolerance);
416
+ var ptr2 = ret[0];
417
+ var len2 = ret[1];
418
+ if (ret[3]) {
419
+ ptr2 = 0; len2 = 0;
420
+ throw takeFromExternrefTable0(ret[2]);
421
+ }
422
+ deferred3_0 = ptr2;
423
+ deferred3_1 = len2;
424
+ return getStringFromWasm0(ptr2, len2);
425
+ } finally {
426
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
523
427
  }
524
- return OGBooleanResult.__wrap(ret[0]);
525
428
  }
526
429
 
527
430
  /**
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}
431
+ * @param {string} serialized
432
+ * @returns {string}
533
433
  */
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);
434
+ export function validateAnalyticBrep(serialized) {
435
+ let deferred3_0;
436
+ let deferred3_1;
437
+ try {
438
+ const ptr0 = passStringToWasm0(serialized, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
439
+ const len0 = WASM_VECTOR_LEN;
440
+ const ret = wasm.validateAnalyticBrep(ptr0, len0);
441
+ var ptr2 = ret[0];
442
+ var len2 = ret[1];
443
+ if (ret[3]) {
444
+ ptr2 = 0; len2 = 0;
445
+ throw takeFromExternrefTable0(ret[2]);
446
+ }
447
+ deferred3_0 = ptr2;
448
+ deferred3_1 = len2;
449
+ return getStringFromWasm0(ptr2, len2);
450
+ } finally {
451
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
452
+ }
453
+ }
454
+
455
+ /**
456
+ * @param {string} serialized
457
+ * @param {number} deflection
458
+ * @param {string | null} [options_json]
459
+ * @returns {OGAnalyticTessellation}
460
+ */
461
+ export function tessellate_brep(serialized, deflection, options_json) {
462
+ const ptr0 = passStringToWasm0(serialized, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
463
+ const len0 = WASM_VECTOR_LEN;
464
+ var ptr1 = isLikeNone(options_json) ? 0 : passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
538
465
  var len1 = WASM_VECTOR_LEN;
539
- const ret = wasm.batchUnion(ptr0, len0, ptr1, len1);
466
+ const ret = wasm.tessellate_brep(ptr0, len0, deflection, ptr1, len1);
540
467
  if (ret[2]) {
541
468
  throw takeFromExternrefTable0(ret[1]);
542
469
  }
543
- return OGBooleanResult.__wrap(ret[0]);
470
+ return OGAnalyticTessellation.__wrap(ret[0]);
471
+ }
472
+
473
+ let cachedFloat32ArrayMemory0 = null;
474
+
475
+ function getFloat32ArrayMemory0() {
476
+ if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
477
+ cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
478
+ }
479
+ return cachedFloat32ArrayMemory0;
480
+ }
481
+
482
+ function getArrayF32FromWasm0(ptr, len) {
483
+ ptr = ptr >>> 0;
484
+ return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
485
+ }
486
+
487
+ let cachedUint32ArrayMemory0 = null;
488
+
489
+ function getUint32ArrayMemory0() {
490
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
491
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
492
+ }
493
+ return cachedUint32ArrayMemory0;
494
+ }
495
+
496
+ function getArrayU32FromWasm0(ptr, len) {
497
+ ptr = ptr >>> 0;
498
+ return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
544
499
  }
545
500
 
546
501
  const Matrix3Finalization = (typeof FinalizationRegistry === 'undefined')
@@ -649,219 +604,645 @@ export class Matrix3 {
649
604
 
650
605
  const Matrix4Finalization = (typeof FinalizationRegistry === 'undefined')
651
606
  ? { register: () => {}, unregister: () => {} }
652
- : new FinalizationRegistry(ptr => wasm.__wbg_matrix4_free(ptr >>> 0, 1));
653
- /**
654
- *
655
- * * Matrix4 Module
656
- * * 2D Representation of a 4x4 Matrix
657
- * * It's a row-major matrix.
658
- *
659
- */
660
- export class Matrix4 {
607
+ : new FinalizationRegistry(ptr => wasm.__wbg_matrix4_free(ptr >>> 0, 1));
608
+ /**
609
+ *
610
+ * * Matrix4 Module
611
+ * * 2D Representation of a 4x4 Matrix
612
+ * * It's a row-major matrix.
613
+ *
614
+ */
615
+ export class Matrix4 {
616
+
617
+ static __wrap(ptr) {
618
+ ptr = ptr >>> 0;
619
+ const obj = Object.create(Matrix4.prototype);
620
+ obj.__wbg_ptr = ptr;
621
+ Matrix4Finalization.register(obj, obj.__wbg_ptr, obj);
622
+ return obj;
623
+ }
624
+
625
+ __destroy_into_raw() {
626
+ const ptr = this.__wbg_ptr;
627
+ this.__wbg_ptr = 0;
628
+ Matrix4Finalization.unregister(this);
629
+ return ptr;
630
+ }
631
+
632
+ free() {
633
+ const ptr = this.__destroy_into_raw();
634
+ wasm.__wbg_matrix4_free(ptr, 0);
635
+ }
636
+ /**
637
+ * @returns {Float64Array}
638
+ */
639
+ get elements() {
640
+ const ret = wasm.matrix4_elements(this.__wbg_ptr);
641
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
642
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
643
+ return v1;
644
+ }
645
+ /**
646
+ *
647
+ * * Create a new Matrix4 with identity elements.
648
+ *
649
+ */
650
+ constructor() {
651
+ const ret = wasm.matrix4_new();
652
+ this.__wbg_ptr = ret >>> 0;
653
+ Matrix4Finalization.register(this, this.__wbg_ptr, this);
654
+ return this;
655
+ }
656
+ /**
657
+ * @param {number} m0
658
+ * @param {number} m1
659
+ * @param {number} m2
660
+ * @param {number} m3
661
+ * @param {number} m4
662
+ * @param {number} m5
663
+ * @param {number} m6
664
+ * @param {number} m7
665
+ * @param {number} m8
666
+ * @param {number} m9
667
+ * @param {number} m10
668
+ * @param {number} m11
669
+ * @param {number} m12
670
+ * @param {number} m13
671
+ * @param {number} m14
672
+ * @param {number} m15
673
+ * @returns {Matrix4}
674
+ */
675
+ static set(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15) {
676
+ const ret = wasm.matrix4_set(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15);
677
+ return Matrix4.__wrap(ret);
678
+ }
679
+ /**
680
+ *
681
+ * * Clone the Matrix4 instance and return a new one.
682
+ *
683
+ * @returns {Matrix4}
684
+ */
685
+ clone() {
686
+ const ret = wasm.matrix4_clone(this.__wbg_ptr);
687
+ return Matrix4.__wrap(ret);
688
+ }
689
+ /**
690
+ *
691
+ * * Sets the matrix element to create an identity matrix.
692
+ *
693
+ */
694
+ identity() {
695
+ wasm.matrix4_identity(this.__wbg_ptr);
696
+ }
697
+ /**
698
+ *
699
+ * * Determinant for a 4x4 matrix.
700
+ * * https://en.wikipedia.org/wiki/Determinant
701
+ *
702
+ * @returns {number}
703
+ */
704
+ determinant() {
705
+ const ret = wasm.matrix4_determinant(this.__wbg_ptr);
706
+ return ret;
707
+ }
708
+ /**
709
+ * @returns {Matrix4}
710
+ */
711
+ adjucate() {
712
+ const ret = wasm.matrix4_adjucate(this.__wbg_ptr);
713
+ return Matrix4.__wrap(ret);
714
+ }
715
+ /**
716
+ *
717
+ * * Inverse of a matrix
718
+ * * Returns a new Matrix4 instance.
719
+ * * If the determinant is zero, it returns a zero matrix.
720
+ * * It can be checked with is_zero() method.
721
+ *
722
+ * @returns {Matrix4}
723
+ */
724
+ inverse() {
725
+ const ret = wasm.matrix4_inverse(this.__wbg_ptr);
726
+ return Matrix4.__wrap(ret);
727
+ }
728
+ /**
729
+ *
730
+ * * Multiply this matrix with another Matrix4
731
+ * * Returns a new Matrix4 instance
732
+ *
733
+ * @param {Matrix4} other
734
+ * @returns {Matrix4}
735
+ */
736
+ multiply(other) {
737
+ _assertClass(other, Matrix4);
738
+ const ret = wasm.matrix4_multiply(this.__wbg_ptr, other.__wbg_ptr);
739
+ return Matrix4.__wrap(ret);
740
+ }
741
+ /**
742
+ *
743
+ * * Add another Matrix4 to this one.
744
+ * * Returns a new Matrix4 instance with the result.
745
+ *
746
+ * @param {Matrix4} incoming
747
+ * @returns {Matrix4}
748
+ */
749
+ add(incoming) {
750
+ _assertClass(incoming, Matrix4);
751
+ const ret = wasm.matrix4_add(this.__wbg_ptr, incoming.__wbg_ptr);
752
+ return Matrix4.__wrap(ret);
753
+ }
754
+ /**
755
+ *
756
+ * * Subtract another Matrix4 from this one.
757
+ * * Returns a new Matrix4 instance with the result.
758
+ *
759
+ * @param {Matrix4} incoming
760
+ * @returns {Matrix4}
761
+ */
762
+ subtract(incoming) {
763
+ _assertClass(incoming, Matrix4);
764
+ const ret = wasm.matrix4_subtract(this.__wbg_ptr, incoming.__wbg_ptr);
765
+ return Matrix4.__wrap(ret);
766
+ }
767
+ /**
768
+ *
769
+ * * Flatten the matrix into a vector of f64.
770
+ *
771
+ * @returns {Float64Array}
772
+ */
773
+ flatten() {
774
+ const ret = wasm.matrix4_flatten(this.__wbg_ptr);
775
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
776
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
777
+ return v1;
778
+ }
779
+ /**
780
+ *
781
+ * * Get the element at a specific index in the flattened matrix.
782
+ *
783
+ * @param {number} index
784
+ * @returns {number | undefined}
785
+ */
786
+ get_element_at(index) {
787
+ const ret = wasm.matrix4_get_element_at(this.__wbg_ptr, index);
788
+ return ret[0] === 0 ? undefined : ret[1];
789
+ }
790
+ /**
791
+ *
792
+ * * Check if the matrix is a zero matrix.
793
+ *
794
+ * @returns {boolean}
795
+ */
796
+ is_zero() {
797
+ const ret = wasm.matrix4_is_zero(this.__wbg_ptr);
798
+ return ret !== 0;
799
+ }
800
+ /**
801
+ *
802
+ * * Check if the matrix is an identity matrix.
803
+ *
804
+ * @returns {boolean}
805
+ */
806
+ is_identity() {
807
+ const ret = wasm.matrix4_is_identity(this.__wbg_ptr);
808
+ return ret !== 0;
809
+ }
810
+ /**
811
+ *
812
+ * * Create a Transpose of the matrix.
813
+ * * Returns a new Matrix4 instance.
814
+ *
815
+ * @returns {Matrix4}
816
+ */
817
+ transpose() {
818
+ const ret = wasm.matrix4_transpose(this.__wbg_ptr);
819
+ return Matrix4.__wrap(ret);
820
+ }
821
+ }
822
+
823
+ const OGAnalyticBrepFinalization = (typeof FinalizationRegistry === 'undefined')
824
+ ? { register: () => {}, unregister: () => {} }
825
+ : new FinalizationRegistry(ptr => wasm.__wbg_oganalyticbrep_free(ptr >>> 0, 1));
826
+
827
+ export class OGAnalyticBrep {
828
+
829
+ static __wrap(ptr) {
830
+ ptr = ptr >>> 0;
831
+ const obj = Object.create(OGAnalyticBrep.prototype);
832
+ obj.__wbg_ptr = ptr;
833
+ OGAnalyticBrepFinalization.register(obj, obj.__wbg_ptr, obj);
834
+ return obj;
835
+ }
836
+
837
+ __destroy_into_raw() {
838
+ const ptr = this.__wbg_ptr;
839
+ this.__wbg_ptr = 0;
840
+ OGAnalyticBrepFinalization.unregister(this);
841
+ return ptr;
842
+ }
843
+
844
+ free() {
845
+ const ptr = this.__destroy_into_raw();
846
+ wasm.__wbg_oganalyticbrep_free(ptr, 0);
847
+ }
848
+ /**
849
+ * @param {string} serialized
850
+ */
851
+ constructor(serialized) {
852
+ const ptr0 = passStringToWasm0(serialized, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
853
+ const len0 = WASM_VECTOR_LEN;
854
+ const ret = wasm.oganalyticbrep_new(ptr0, len0);
855
+ if (ret[2]) {
856
+ throw takeFromExternrefTable0(ret[1]);
857
+ }
858
+ this.__wbg_ptr = ret[0] >>> 0;
859
+ OGAnalyticBrepFinalization.register(this, this.__wbg_ptr, this);
860
+ return this;
861
+ }
862
+ /**
863
+ * @param {string} config_json
864
+ * @returns {OGAnalyticBrep}
865
+ */
866
+ static from_primitive(config_json) {
867
+ const ptr0 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
868
+ const len0 = WASM_VECTOR_LEN;
869
+ const ret = wasm.oganalyticbrep_from_primitive(ptr0, len0);
870
+ if (ret[2]) {
871
+ throw takeFromExternrefTable0(ret[1]);
872
+ }
873
+ return OGAnalyticBrep.__wrap(ret[0]);
874
+ }
875
+ /**
876
+ * @returns {string}
877
+ */
878
+ get_brep_serialized() {
879
+ let deferred2_0;
880
+ let deferred2_1;
881
+ try {
882
+ const ret = wasm.oganalyticbrep_get_brep_serialized(this.__wbg_ptr);
883
+ var ptr1 = ret[0];
884
+ var len1 = ret[1];
885
+ if (ret[3]) {
886
+ ptr1 = 0; len1 = 0;
887
+ throw takeFromExternrefTable0(ret[2]);
888
+ }
889
+ deferred2_0 = ptr1;
890
+ deferred2_1 = len1;
891
+ return getStringFromWasm0(ptr1, len1);
892
+ } finally {
893
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
894
+ }
895
+ }
896
+ /**
897
+ * @param {string} length_unit
898
+ * @returns {string}
899
+ */
900
+ export_step(length_unit) {
901
+ let deferred3_0;
902
+ let deferred3_1;
903
+ try {
904
+ const ptr0 = passStringToWasm0(length_unit, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
905
+ const len0 = WASM_VECTOR_LEN;
906
+ const ret = wasm.oganalyticbrep_export_step(this.__wbg_ptr, ptr0, len0);
907
+ var ptr2 = ret[0];
908
+ var len2 = ret[1];
909
+ if (ret[3]) {
910
+ ptr2 = 0; len2 = 0;
911
+ throw takeFromExternrefTable0(ret[2]);
912
+ }
913
+ deferred3_0 = ptr2;
914
+ deferred3_1 = len2;
915
+ return getStringFromWasm0(ptr2, len2);
916
+ } finally {
917
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
918
+ }
919
+ }
920
+ /**
921
+ * @param {string} frame_json
922
+ * @param {number} scale
923
+ * @returns {OGAnalyticBrep}
924
+ */
925
+ placed(frame_json, scale) {
926
+ const ptr0 = passStringToWasm0(frame_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
927
+ const len0 = WASM_VECTOR_LEN;
928
+ const ret = wasm.oganalyticbrep_placed(this.__wbg_ptr, ptr0, len0, scale);
929
+ if (ret[2]) {
930
+ throw takeFromExternrefTable0(ret[1]);
931
+ }
932
+ return OGAnalyticBrep.__wrap(ret[0]);
933
+ }
934
+ /**
935
+ * @returns {string}
936
+ */
937
+ prepare_ifc_exchange() {
938
+ let deferred2_0;
939
+ let deferred2_1;
940
+ try {
941
+ const ret = wasm.oganalyticbrep_prepare_ifc_exchange(this.__wbg_ptr);
942
+ var ptr1 = ret[0];
943
+ var len1 = ret[1];
944
+ if (ret[3]) {
945
+ ptr1 = 0; len1 = 0;
946
+ throw takeFromExternrefTable0(ret[2]);
947
+ }
948
+ deferred2_0 = ptr1;
949
+ deferred2_1 = len1;
950
+ return getStringFromWasm0(ptr1, len1);
951
+ } finally {
952
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
953
+ }
954
+ }
955
+ /**
956
+ * @param {number} face_id
957
+ * @param {Float64Array} point
958
+ * @returns {Float64Array}
959
+ */
960
+ face_normal_at(face_id, point) {
961
+ const ptr0 = passArrayF64ToWasm0(point, wasm.__wbindgen_malloc);
962
+ const len0 = WASM_VECTOR_LEN;
963
+ const ret = wasm.oganalyticbrep_face_normal_at(this.__wbg_ptr, face_id, ptr0, len0);
964
+ if (ret[3]) {
965
+ throw takeFromExternrefTable0(ret[2]);
966
+ }
967
+ var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
968
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
969
+ return v2;
970
+ }
971
+ /**
972
+ * @param {Float64Array} point
973
+ * @returns {string}
974
+ */
975
+ classify_point(point) {
976
+ let deferred3_0;
977
+ let deferred3_1;
978
+ try {
979
+ const ptr0 = passArrayF64ToWasm0(point, wasm.__wbindgen_malloc);
980
+ const len0 = WASM_VECTOR_LEN;
981
+ const ret = wasm.oganalyticbrep_classify_point(this.__wbg_ptr, ptr0, len0);
982
+ var ptr2 = ret[0];
983
+ var len2 = ret[1];
984
+ if (ret[3]) {
985
+ ptr2 = 0; len2 = 0;
986
+ throw takeFromExternrefTable0(ret[2]);
987
+ }
988
+ deferred3_0 = ptr2;
989
+ deferred3_1 = len2;
990
+ return getStringFromWasm0(ptr2, len2);
991
+ } finally {
992
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
993
+ }
994
+ }
995
+ /**
996
+ * @param {string} camera_json
997
+ * @param {string} hlr_json
998
+ * @param {number} deflection
999
+ * @returns {string}
1000
+ */
1001
+ project_to_2d_lines(camera_json, hlr_json, deflection) {
1002
+ let deferred4_0;
1003
+ let deferred4_1;
1004
+ try {
1005
+ const ptr0 = passStringToWasm0(camera_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1006
+ const len0 = WASM_VECTOR_LEN;
1007
+ const ptr1 = passStringToWasm0(hlr_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1008
+ const len1 = WASM_VECTOR_LEN;
1009
+ const ret = wasm.oganalyticbrep_project_to_2d_lines(this.__wbg_ptr, ptr0, len0, ptr1, len1, deflection);
1010
+ var ptr3 = ret[0];
1011
+ var len3 = ret[1];
1012
+ if (ret[3]) {
1013
+ ptr3 = 0; len3 = 0;
1014
+ throw takeFromExternrefTable0(ret[2]);
1015
+ }
1016
+ deferred4_0 = ptr3;
1017
+ deferred4_1 = len3;
1018
+ return getStringFromWasm0(ptr3, len3);
1019
+ } finally {
1020
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1021
+ }
1022
+ }
1023
+ /**
1024
+ * @param {OGAnalyticBrep} other
1025
+ * @param {string} operation
1026
+ * @param {string} id
1027
+ * @returns {OGAnalyticBrep}
1028
+ */
1029
+ boolean_brep(other, operation, id) {
1030
+ _assertClass(other, OGAnalyticBrep);
1031
+ const ptr0 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1032
+ const len0 = WASM_VECTOR_LEN;
1033
+ const ptr1 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1034
+ const len1 = WASM_VECTOR_LEN;
1035
+ const ret = wasm.oganalyticbrep_boolean_brep(this.__wbg_ptr, other.__wbg_ptr, ptr0, len0, ptr1, len1);
1036
+ if (ret[2]) {
1037
+ throw takeFromExternrefTable0(ret[1]);
1038
+ }
1039
+ return OGAnalyticBrep.__wrap(ret[0]);
1040
+ }
1041
+ /**
1042
+ * @param {string} cutters_json
1043
+ * @param {string} id
1044
+ * @returns {OGAnalyticBrep}
1045
+ */
1046
+ subtract_planar_cutters(cutters_json, id) {
1047
+ const ptr0 = passStringToWasm0(cutters_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1048
+ const len0 = WASM_VECTOR_LEN;
1049
+ const ptr1 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1050
+ const len1 = WASM_VECTOR_LEN;
1051
+ const ret = wasm.oganalyticbrep_subtract_planar_cutters(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1052
+ if (ret[2]) {
1053
+ throw takeFromExternrefTable0(ret[1]);
1054
+ }
1055
+ return OGAnalyticBrep.__wrap(ret[0]);
1056
+ }
1057
+ /**
1058
+ * @param {number} thickness
1059
+ * @param {string} id
1060
+ * @returns {OGAnalyticBrep}
1061
+ */
1062
+ shell(thickness, id) {
1063
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1064
+ const len0 = WASM_VECTOR_LEN;
1065
+ const ret = wasm.oganalyticbrep_shell(this.__wbg_ptr, thickness, ptr0, len0);
1066
+ if (ret[2]) {
1067
+ throw takeFromExternrefTable0(ret[1]);
1068
+ }
1069
+ return OGAnalyticBrep.__wrap(ret[0]);
1070
+ }
1071
+ /**
1072
+ * @returns {string | undefined}
1073
+ */
1074
+ get_boolean_report_serialized() {
1075
+ const ret = wasm.oganalyticbrep_get_boolean_report_serialized(this.__wbg_ptr);
1076
+ if (ret[3]) {
1077
+ throw takeFromExternrefTable0(ret[2]);
1078
+ }
1079
+ let v1;
1080
+ if (ret[0] !== 0) {
1081
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1082
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1083
+ }
1084
+ return v1;
1085
+ }
1086
+ /**
1087
+ * @param {number} deflection
1088
+ * @returns {OGAnalyticTessellation}
1089
+ */
1090
+ tessellate(deflection) {
1091
+ const ret = wasm.oganalyticbrep_tessellate(this.__wbg_ptr, deflection);
1092
+ if (ret[2]) {
1093
+ throw takeFromExternrefTable0(ret[1]);
1094
+ }
1095
+ return OGAnalyticTessellation.__wrap(ret[0]);
1096
+ }
1097
+ /**
1098
+ * @returns {number}
1099
+ */
1100
+ get_face_count() {
1101
+ const ret = wasm.oganalyticbrep_get_face_count(this.__wbg_ptr);
1102
+ return ret >>> 0;
1103
+ }
1104
+ /**
1105
+ * @returns {number}
1106
+ */
1107
+ get_edge_count() {
1108
+ const ret = wasm.oganalyticbrep_get_edge_count(this.__wbg_ptr);
1109
+ return ret >>> 0;
1110
+ }
1111
+ /**
1112
+ * @returns {string}
1113
+ */
1114
+ get_id() {
1115
+ let deferred1_0;
1116
+ let deferred1_1;
1117
+ try {
1118
+ const ret = wasm.oganalyticbrep_get_id(this.__wbg_ptr);
1119
+ deferred1_0 = ret[0];
1120
+ deferred1_1 = ret[1];
1121
+ return getStringFromWasm0(ret[0], ret[1]);
1122
+ } finally {
1123
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1124
+ }
1125
+ }
1126
+ /**
1127
+ * @returns {Float64Array}
1128
+ */
1129
+ get_bounds() {
1130
+ const ret = wasm.oganalyticbrep_get_bounds(this.__wbg_ptr);
1131
+ if (ret[3]) {
1132
+ throw takeFromExternrefTable0(ret[2]);
1133
+ }
1134
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
1135
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
1136
+ return v1;
1137
+ }
1138
+ /**
1139
+ * @returns {number}
1140
+ */
1141
+ get_vertex_count() {
1142
+ const ret = wasm.oganalyticbrep_get_vertex_count(this.__wbg_ptr);
1143
+ return ret >>> 0;
1144
+ }
1145
+ /**
1146
+ * @returns {bigint}
1147
+ */
1148
+ get_revision() {
1149
+ const ret = wasm.oganalyticbrep_get_revision(this.__wbg_ptr);
1150
+ return BigInt.asUintN(64, ret);
1151
+ }
1152
+ }
1153
+
1154
+ const OGAnalyticTessellationFinalization = (typeof FinalizationRegistry === 'undefined')
1155
+ ? { register: () => {}, unregister: () => {} }
1156
+ : new FinalizationRegistry(ptr => wasm.__wbg_oganalytictessellation_free(ptr >>> 0, 1));
1157
+
1158
+ export class OGAnalyticTessellation {
661
1159
 
662
1160
  static __wrap(ptr) {
663
1161
  ptr = ptr >>> 0;
664
- const obj = Object.create(Matrix4.prototype);
1162
+ const obj = Object.create(OGAnalyticTessellation.prototype);
665
1163
  obj.__wbg_ptr = ptr;
666
- Matrix4Finalization.register(obj, obj.__wbg_ptr, obj);
1164
+ OGAnalyticTessellationFinalization.register(obj, obj.__wbg_ptr, obj);
667
1165
  return obj;
668
1166
  }
669
1167
 
670
1168
  __destroy_into_raw() {
671
1169
  const ptr = this.__wbg_ptr;
672
1170
  this.__wbg_ptr = 0;
673
- Matrix4Finalization.unregister(this);
1171
+ OGAnalyticTessellationFinalization.unregister(this);
674
1172
  return ptr;
675
1173
  }
676
1174
 
677
1175
  free() {
678
1176
  const ptr = this.__destroy_into_raw();
679
- wasm.__wbg_matrix4_free(ptr, 0);
1177
+ wasm.__wbg_oganalytictessellation_free(ptr, 0);
680
1178
  }
681
1179
  /**
682
1180
  * @returns {Float64Array}
683
1181
  */
684
- get elements() {
685
- const ret = wasm.matrix4_elements(this.__wbg_ptr);
1182
+ positions() {
1183
+ const ret = wasm.oganalytictessellation_positions(this.__wbg_ptr);
686
1184
  var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
687
1185
  wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
688
1186
  return v1;
689
1187
  }
690
1188
  /**
691
- *
692
- * * Create a new Matrix4 with identity elements.
693
- *
694
- */
695
- constructor() {
696
- const ret = wasm.matrix4_new();
697
- this.__wbg_ptr = ret >>> 0;
698
- Matrix4Finalization.register(this, this.__wbg_ptr, this);
699
- return this;
700
- }
701
- /**
702
- * @param {number} m0
703
- * @param {number} m1
704
- * @param {number} m2
705
- * @param {number} m3
706
- * @param {number} m4
707
- * @param {number} m5
708
- * @param {number} m6
709
- * @param {number} m7
710
- * @param {number} m8
711
- * @param {number} m9
712
- * @param {number} m10
713
- * @param {number} m11
714
- * @param {number} m12
715
- * @param {number} m13
716
- * @param {number} m14
717
- * @param {number} m15
718
- * @returns {Matrix4}
719
- */
720
- static set(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15) {
721
- const ret = wasm.matrix4_set(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15);
722
- return Matrix4.__wrap(ret);
723
- }
724
- /**
725
- *
726
- * * Clone the Matrix4 instance and return a new one.
727
- *
728
- * @returns {Matrix4}
729
- */
730
- clone() {
731
- const ret = wasm.matrix4_clone(this.__wbg_ptr);
732
- return Matrix4.__wrap(ret);
733
- }
734
- /**
735
- *
736
- * * Sets the matrix element to create an identity matrix.
737
- *
738
- */
739
- identity() {
740
- wasm.matrix4_identity(this.__wbg_ptr);
741
- }
742
- /**
743
- *
744
- * * Determinant for a 4x4 matrix.
745
- * * https://en.wikipedia.org/wiki/Determinant
746
- *
747
- * @returns {number}
748
- */
749
- determinant() {
750
- const ret = wasm.matrix4_determinant(this.__wbg_ptr);
751
- return ret;
752
- }
753
- /**
754
- * @returns {Matrix4}
755
- */
756
- adjucate() {
757
- const ret = wasm.matrix4_adjucate(this.__wbg_ptr);
758
- return Matrix4.__wrap(ret);
759
- }
760
- /**
761
- *
762
- * * Inverse of a matrix
763
- * * Returns a new Matrix4 instance.
764
- * * If the determinant is zero, it returns a zero matrix.
765
- * * It can be checked with is_zero() method.
766
- *
767
- * @returns {Matrix4}
768
- */
769
- inverse() {
770
- const ret = wasm.matrix4_inverse(this.__wbg_ptr);
771
- return Matrix4.__wrap(ret);
772
- }
773
- /**
774
- *
775
- * * Multiply this matrix with another Matrix4
776
- * * Returns a new Matrix4 instance
777
- *
778
- * @param {Matrix4} other
779
- * @returns {Matrix4}
1189
+ * @returns {Float32Array}
780
1190
  */
781
- multiply(other) {
782
- _assertClass(other, Matrix4);
783
- const ret = wasm.matrix4_multiply(this.__wbg_ptr, other.__wbg_ptr);
784
- return Matrix4.__wrap(ret);
1191
+ normals() {
1192
+ const ret = wasm.oganalytictessellation_normals(this.__wbg_ptr);
1193
+ var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
1194
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1195
+ return v1;
785
1196
  }
786
1197
  /**
787
- *
788
- * * Add another Matrix4 to this one.
789
- * * Returns a new Matrix4 instance with the result.
790
- *
791
- * @param {Matrix4} incoming
792
- * @returns {Matrix4}
1198
+ * @returns {Uint32Array}
793
1199
  */
794
- add(incoming) {
795
- _assertClass(incoming, Matrix4);
796
- const ret = wasm.matrix4_add(this.__wbg_ptr, incoming.__wbg_ptr);
797
- return Matrix4.__wrap(ret);
1200
+ indices() {
1201
+ const ret = wasm.oganalytictessellation_indices(this.__wbg_ptr);
1202
+ var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
1203
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1204
+ return v1;
798
1205
  }
799
1206
  /**
800
- *
801
- * * Subtract another Matrix4 from this one.
802
- * * Returns a new Matrix4 instance with the result.
803
- *
804
- * @param {Matrix4} incoming
805
- * @returns {Matrix4}
1207
+ * @returns {Uint32Array}
806
1208
  */
807
- subtract(incoming) {
808
- _assertClass(incoming, Matrix4);
809
- const ret = wasm.matrix4_subtract(this.__wbg_ptr, incoming.__wbg_ptr);
810
- return Matrix4.__wrap(ret);
1209
+ triangle_face_ids() {
1210
+ const ret = wasm.oganalytictessellation_triangle_face_ids(this.__wbg_ptr);
1211
+ var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
1212
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1213
+ return v1;
811
1214
  }
812
1215
  /**
813
- *
814
- * * Flatten the matrix into a vector of f64.
815
- *
816
1216
  * @returns {Float64Array}
817
1217
  */
818
- flatten() {
819
- const ret = wasm.matrix4_flatten(this.__wbg_ptr);
1218
+ outline_positions() {
1219
+ const ret = wasm.oganalytictessellation_outline_positions(this.__wbg_ptr);
820
1220
  var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
821
1221
  wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
822
1222
  return v1;
823
1223
  }
824
1224
  /**
825
- *
826
- * * Get the element at a specific index in the flattened matrix.
827
- *
828
- * @param {number} index
829
- * @returns {number | undefined}
830
- */
831
- get_element_at(index) {
832
- const ret = wasm.matrix4_get_element_at(this.__wbg_ptr, index);
833
- return ret[0] === 0 ? undefined : ret[1];
834
- }
835
- /**
836
- *
837
- * * Check if the matrix is a zero matrix.
838
- *
839
- * @returns {boolean}
1225
+ * @returns {Uint32Array}
840
1226
  */
841
- is_zero() {
842
- const ret = wasm.matrix4_is_zero(this.__wbg_ptr);
843
- return ret !== 0;
1227
+ outline_edge_ids() {
1228
+ const ret = wasm.oganalytictessellation_outline_edge_ids(this.__wbg_ptr);
1229
+ var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
1230
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1231
+ return v1;
844
1232
  }
845
1233
  /**
846
- *
847
- * * Check if the matrix is an identity matrix.
848
- *
849
- * @returns {boolean}
1234
+ * @returns {bigint}
850
1235
  */
851
- is_identity() {
852
- const ret = wasm.matrix4_is_identity(this.__wbg_ptr);
853
- return ret !== 0;
1236
+ revision() {
1237
+ const ret = wasm.oganalytictessellation_revision(this.__wbg_ptr);
1238
+ return BigInt.asUintN(64, ret);
854
1239
  }
855
1240
  /**
856
- *
857
- * * Create a Transpose of the matrix.
858
- * * Returns a new Matrix4 instance.
859
- *
860
- * @returns {Matrix4}
1241
+ * @returns {number}
861
1242
  */
862
- transpose() {
863
- const ret = wasm.matrix4_transpose(this.__wbg_ptr);
864
- return Matrix4.__wrap(ret);
1243
+ achieved_deflection() {
1244
+ const ret = wasm.oganalytictessellation_achieved_deflection(this.__wbg_ptr);
1245
+ return ret;
865
1246
  }
866
1247
  }
867
1248
 
@@ -1082,95 +1463,6 @@ export class OGArc {
1082
1463
  }
1083
1464
  }
1084
1465
 
1085
- const OGBooleanResultFinalization = (typeof FinalizationRegistry === 'undefined')
1086
- ? { register: () => {}, unregister: () => {} }
1087
- : new FinalizationRegistry(ptr => wasm.__wbg_ogbooleanresult_free(ptr >>> 0, 1));
1088
- /**
1089
- * Result payload returned across the wasm boundary.
1090
- */
1091
- export class OGBooleanResult {
1092
-
1093
- static __wrap(ptr) {
1094
- ptr = ptr >>> 0;
1095
- const obj = Object.create(OGBooleanResult.prototype);
1096
- obj.__wbg_ptr = ptr;
1097
- OGBooleanResultFinalization.register(obj, obj.__wbg_ptr, obj);
1098
- return obj;
1099
- }
1100
-
1101
- __destroy_into_raw() {
1102
- const ptr = this.__wbg_ptr;
1103
- this.__wbg_ptr = 0;
1104
- OGBooleanResultFinalization.unregister(this);
1105
- return ptr;
1106
- }
1107
-
1108
- free() {
1109
- const ptr = this.__destroy_into_raw();
1110
- wasm.__wbg_ogbooleanresult_free(ptr, 0);
1111
- }
1112
- /**
1113
- * @returns {string}
1114
- */
1115
- get brepSerialized() {
1116
- let deferred1_0;
1117
- let deferred1_1;
1118
- try {
1119
- const ret = wasm.ogbooleanresult_brepSerialized(this.__wbg_ptr);
1120
- deferred1_0 = ret[0];
1121
- deferred1_1 = ret[1];
1122
- return getStringFromWasm0(ret[0], ret[1]);
1123
- } finally {
1124
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1125
- }
1126
- }
1127
- /**
1128
- * @returns {string}
1129
- */
1130
- get geometrySerialized() {
1131
- let deferred1_0;
1132
- let deferred1_1;
1133
- try {
1134
- const ret = wasm.ogbooleanresult_geometrySerialized(this.__wbg_ptr);
1135
- deferred1_0 = ret[0];
1136
- deferred1_1 = ret[1];
1137
- return getStringFromWasm0(ret[0], ret[1]);
1138
- } finally {
1139
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1140
- }
1141
- }
1142
- /**
1143
- * @returns {string}
1144
- */
1145
- get outlineGeometrySerialized() {
1146
- let deferred1_0;
1147
- let deferred1_1;
1148
- try {
1149
- const ret = wasm.ogbooleanresult_outlineGeometrySerialized(this.__wbg_ptr);
1150
- deferred1_0 = ret[0];
1151
- deferred1_1 = ret[1];
1152
- return getStringFromWasm0(ret[0], ret[1]);
1153
- } finally {
1154
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1155
- }
1156
- }
1157
- /**
1158
- * @returns {string}
1159
- */
1160
- get reportJson() {
1161
- let deferred1_0;
1162
- let deferred1_1;
1163
- try {
1164
- const ret = wasm.ogbooleanresult_reportJson(this.__wbg_ptr);
1165
- deferred1_0 = ret[0];
1166
- deferred1_1 = ret[1];
1167
- return getStringFromWasm0(ret[0], ret[1]);
1168
- } finally {
1169
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1170
- }
1171
- }
1172
- }
1173
-
1174
1466
  const OGCuboidFinalization = (typeof FinalizationRegistry === 'undefined')
1175
1467
  ? { register: () => {}, unregister: () => {} }
1176
1468
  : new FinalizationRegistry(ptr => wasm.__wbg_ogcuboid_free(ptr >>> 0, 1));
@@ -5243,7 +5535,7 @@ export class OGSphere {
5243
5535
  * @returns {Vector3}
5244
5536
  */
5245
5537
  get_anchor() {
5246
- const ret = wasm.ogline_get_anchor(this.__wbg_ptr);
5538
+ const ret = wasm.ogcurve_get_anchor(this.__wbg_ptr);
5247
5539
  return Vector3.__wrap(ret);
5248
5540
  }
5249
5541
  }
@@ -5636,7 +5928,7 @@ export class OGSweep {
5636
5928
  * @returns {Vector3}
5637
5929
  */
5638
5930
  get_anchor() {
5639
- const ret = wasm.ogellipticalarc_get_anchor(this.__wbg_ptr);
5931
+ const ret = wasm.ogsweep_get_anchor(this.__wbg_ptr);
5640
5932
  return Vector3.__wrap(ret);
5641
5933
  }
5642
5934
  /**
@@ -6362,13 +6654,6 @@ function __wbg_get_imports() {
6362
6654
  const ret = Vector3.__unwrap(arg0);
6363
6655
  return ret;
6364
6656
  };
6365
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
6366
- const ret = debugString(arg1);
6367
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6368
- const len1 = WASM_VECTOR_LEN;
6369
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
6370
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
6371
- };
6372
6657
  imports.wbg.__wbindgen_init_externref_table = function() {
6373
6658
  const table = wasm.__wbindgen_export_2;
6374
6659
  const offset = table.grow(4);
@@ -6398,7 +6683,9 @@ function __wbg_finalize_init(instance, module) {
6398
6683
  wasm = instance.exports;
6399
6684
  __wbg_init.__wbindgen_wasm_module = module;
6400
6685
  cachedDataViewMemory0 = null;
6686
+ cachedFloat32ArrayMemory0 = null;
6401
6687
  cachedFloat64ArrayMemory0 = null;
6688
+ cachedUint32ArrayMemory0 = null;
6402
6689
  cachedUint8ArrayMemory0 = null;
6403
6690
 
6404
6691