@ifc-lite/wasm 2.0.0 → 2.1.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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "IFC-Lite Contributors"
6
6
  ],
7
7
  "description": "WebAssembly bindings for IFC-Lite",
8
- "version": "2.0.0",
8
+ "version": "2.1.0",
9
9
  "license": "MPL-2.0",
10
10
  "repository": {
11
11
  "type": "git",
package/pkg/ifc-lite.d.ts CHANGED
@@ -48,6 +48,17 @@ export class IfcAPI {
48
48
  * `{ type: "complete", totalJobs }`
49
49
  */
50
50
  buildPrePassStreaming(data: Uint8Array, on_event: Function, chunk_size: number): any;
51
+ /**
52
+ * Parse the file and return every `IfcAlignment` directrix as a flat
53
+ * `Float32Array` of 3D line-list vertices `[x0,y0,z0, x1,y1,z1, …]` in
54
+ * the renderer's Y-up world space (RTC-subtracted, metres). Consecutive
55
+ * samples form line segments. Feed straight to
56
+ * `renderer.uploadAnnotationLines3D(...)`.
57
+ *
58
+ * Returns an empty array when the file has no alignments (or none with a
59
+ * resolvable Axis curve), so the caller can clear the overlay cheaply.
60
+ */
61
+ parseAlignmentLines(content: string): Float32Array;
51
62
  /**
52
63
  * Extract raw profile polygons from all building elements with `IfcExtrudedAreaSolid`
53
64
  * representations.
@@ -561,6 +572,7 @@ export interface InitOutput {
561
572
  readonly ifcapi_is_ready: (a: number) => number;
562
573
  readonly ifcapi_new: () => number;
563
574
  readonly ifcapi_parse: (a: number, b: number, c: number) => number;
575
+ readonly ifcapi_parseAlignmentLines: (a: number, b: number, c: number) => number;
564
576
  readonly ifcapi_parseStreaming: (a: number, b: number, c: number, d: number) => number;
565
577
  readonly ifcapi_parseSymbolicRepresentations: (a: number, b: number, c: number) => number;
566
578
  readonly ifcapi_processGeometryBatch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number) => number;
@@ -665,9 +677,9 @@ export interface InitOutput {
665
677
  readonly symbolictext_worldY: (a: number) => number;
666
678
  readonly symbolictext_x: (a: number) => number;
667
679
  readonly symbolictext_y: (a: number) => number;
668
- readonly __wasm_bindgen_func_elem_1685: (a: number, b: number, c: number) => void;
669
- readonly __wasm_bindgen_func_elem_1684: (a: number, b: number) => void;
670
- readonly __wasm_bindgen_func_elem_1832: (a: number, b: number, c: number, d: number) => void;
680
+ readonly __wasm_bindgen_func_elem_569: (a: number, b: number, c: number) => void;
681
+ readonly __wasm_bindgen_func_elem_568: (a: number, b: number) => void;
682
+ readonly __wasm_bindgen_func_elem_603: (a: number, b: number, c: number, d: number) => void;
671
683
  readonly __wbindgen_export: (a: number) => void;
672
684
  readonly __wbindgen_export2: (a: number, b: number, c: number) => void;
673
685
  readonly __wbindgen_export3: (a: number, b: number) => number;
package/pkg/ifc-lite.js CHANGED
@@ -220,12 +220,12 @@ if (!('encodeInto' in cachedTextEncoder)) {
220
220
 
221
221
  let WASM_VECTOR_LEN = 0;
222
222
 
223
- function __wasm_bindgen_func_elem_1685(arg0, arg1, arg2) {
224
- wasm.__wasm_bindgen_func_elem_1685(arg0, arg1, addHeapObject(arg2));
223
+ function __wasm_bindgen_func_elem_569(arg0, arg1, arg2) {
224
+ wasm.__wasm_bindgen_func_elem_569(arg0, arg1, addHeapObject(arg2));
225
225
  }
226
226
 
227
- function __wasm_bindgen_func_elem_1832(arg0, arg1, arg2, arg3) {
228
- wasm.__wasm_bindgen_func_elem_1832(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
227
+ function __wasm_bindgen_func_elem_603(arg0, arg1, arg2, arg3) {
228
+ wasm.__wasm_bindgen_func_elem_603(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
229
229
  }
230
230
 
231
231
  const IfcAPIFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -391,6 +391,24 @@ export class IfcAPI {
391
391
  heap[stack_pointer++] = undefined;
392
392
  }
393
393
  }
394
+ /**
395
+ * Parse the file and return every `IfcAlignment` directrix as a flat
396
+ * `Float32Array` of 3D line-list vertices `[x0,y0,z0, x1,y1,z1, …]` in
397
+ * the renderer's Y-up world space (RTC-subtracted, metres). Consecutive
398
+ * samples form line segments. Feed straight to
399
+ * `renderer.uploadAnnotationLines3D(...)`.
400
+ *
401
+ * Returns an empty array when the file has no alignments (or none with a
402
+ * resolvable Axis curve), so the caller can clear the overlay cheaply.
403
+ * @param {string} content
404
+ * @returns {Float32Array}
405
+ */
406
+ parseAlignmentLines(content) {
407
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
408
+ const len0 = WASM_VECTOR_LEN;
409
+ const ret = wasm.ifcapi_parseAlignmentLines(this.__wbg_ptr, ptr0, len0);
410
+ return takeObject(ret);
411
+ }
394
412
  /**
395
413
  * Extract raw profile polygons from all building elements with `IfcExtrudedAreaSolid`
396
414
  * representations.
@@ -1932,7 +1950,7 @@ function __wbg_get_imports() {
1932
1950
  const a = state0.a;
1933
1951
  state0.a = 0;
1934
1952
  try {
1935
- return __wasm_bindgen_func_elem_1832(a, state0.b, arg0, arg1);
1953
+ return __wasm_bindgen_func_elem_603(a, state0.b, arg0, arg1);
1936
1954
  } finally {
1937
1955
  state0.a = a;
1938
1956
  }
@@ -2037,16 +2055,16 @@ function __wbg_get_imports() {
2037
2055
  const ret = BigInt.asUintN(64, arg0);
2038
2056
  return addHeapObject(ret);
2039
2057
  };
2040
- imports.wbg.__wbindgen_cast_89b0435615caf0ab = function(arg0, arg1) {
2041
- // Cast intrinsic for `Closure(Closure { dtor_idx: 211, function: Function { arguments: [Externref], shim_idx: 212, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2042
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1684, __wasm_bindgen_func_elem_1685);
2043
- return addHeapObject(ret);
2044
- };
2045
2058
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
2046
2059
  // Cast intrinsic for `F64 -> Externref`.
2047
2060
  const ret = arg0;
2048
2061
  return addHeapObject(ret);
2049
2062
  };
2063
+ imports.wbg.__wbindgen_cast_e7ad0d7b317830d5 = function(arg0, arg1) {
2064
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 56, function: Function { arguments: [Externref], shim_idx: 57, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2065
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_568, __wasm_bindgen_func_elem_569);
2066
+ return addHeapObject(ret);
2067
+ };
2050
2068
  imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2051
2069
  const ret = getObject(arg0);
2052
2070
  return addHeapObject(ret);
Binary file