@ifc-lite/wasm 2.9.1 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/pkg/ifc-lite.d.ts +109 -0
- package/pkg/ifc-lite.js +386 -0
- package/pkg/ifc-lite_bg.wasm +0 -0
package/package.json
CHANGED
package/pkg/ifc-lite.d.ts
CHANGED
|
@@ -82,6 +82,41 @@ export class GridAxisJs {
|
|
|
82
82
|
export class IfcAPI {
|
|
83
83
|
free(): void;
|
|
84
84
|
[Symbol.dispose](): void;
|
|
85
|
+
/**
|
|
86
|
+
* Export the render geometry in `content` as a binary **GLB** (`Uint8Array`).
|
|
87
|
+
*
|
|
88
|
+
* `hidden` / `isolated` are express-id visibility filters; `hidden_types_csv` is a
|
|
89
|
+
* comma-separated list of IFC type names whose class toggle is off (e.g.
|
|
90
|
+
* `"IfcOpeningElement,IfcSpace"`). `include_metadata` attaches counts + per-node
|
|
91
|
+
* `expressId`. Per-mesh RTC origin rides the node translation (precision-safe).
|
|
92
|
+
*/
|
|
93
|
+
exportGlb(content: string, include_metadata: boolean, hidden: Uint32Array, isolated: Uint32Array, hidden_types_csv: string): Uint8Array;
|
|
94
|
+
/**
|
|
95
|
+
* Package an already-produced **GLB** + georeference into a **KMZ** (`Uint8Array`)
|
|
96
|
+
* for Google Earth: a ZIP of `doc.kml` (a `<Model>` placed at `latitude`/`longitude`/
|
|
97
|
+
* `altitude`) + `model.glb`. `x_axis_abscissa`/`x_axis_ordinate` are the
|
|
98
|
+
* `IfcMapConversion` grid-north components; pass both as `undefined` for heading 0.
|
|
99
|
+
*/
|
|
100
|
+
exportKmz(glb: Uint8Array, latitude: number, longitude: number, altitude: number, x_axis_abscissa: number | null | undefined, x_axis_ordinate: number | null | undefined, name: string): Uint8Array;
|
|
101
|
+
/**
|
|
102
|
+
* Assemble a **GLB** from already-produced meshes (the viewer's `MeshData`, flattened)
|
|
103
|
+
* — no re-meshing. Per mesh `i`: `vertex_counts[i]` verts + `index_counts[i]` indices
|
|
104
|
+
* taken in order from the concatenated `positions`/`normals`/`indices`; `colors` is
|
|
105
|
+
* RGBA per mesh, `origins` xyz per mesh, `express_ids` labels each mesh (indices are
|
|
106
|
+
* per-mesh local). The caller passes exactly the meshes it wants emitted.
|
|
107
|
+
*/
|
|
108
|
+
exportGlbFromMeshes(positions: Float32Array, normals: Float32Array, indices: Uint32Array, vertex_counts: Uint32Array, index_counts: Uint32Array, colors: Float32Array, origins: Float64Array, express_ids: Uint32Array, include_metadata: boolean): Uint8Array;
|
|
109
|
+
/**
|
|
110
|
+
* Export the render geometry in `content` as a Wavefront **OBJ** string.
|
|
111
|
+
*
|
|
112
|
+
* `hidden` / `isolated` are express-id filters mirroring the viewer's visibility
|
|
113
|
+
* state (empty `isolated` ⇒ all visible). Instanced type-library shapes are skipped.
|
|
114
|
+
*
|
|
115
|
+
* ```javascript
|
|
116
|
+
* const obj = api.exportObj(ifcContent, true, new Uint32Array(), new Uint32Array());
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
exportObj(content: string, include_normals: boolean, hidden: Uint32Array, isolated: Uint32Array): string;
|
|
85
120
|
/**
|
|
86
121
|
* Run the pre-pass ONCE and return serialized results for worker distribution.
|
|
87
122
|
* Takes raw bytes (&[u8]) to avoid TextDecoder overhead.
|
|
@@ -134,6 +169,56 @@ export class IfcAPI {
|
|
|
134
169
|
* clear the overlay cheaply.
|
|
135
170
|
*/
|
|
136
171
|
parseGridLines(content: string): Float32Array;
|
|
172
|
+
/**
|
|
173
|
+
* Export tabular **CSV**. `mode` ∈ {`"entities"`, `"properties"`, `"quantities"`,
|
|
174
|
+
* `"spatial"`}. `delimiter` defaults to `,` when empty; `include_properties` adds
|
|
175
|
+
* flattened `Pset_Prop` columns to the entities view.
|
|
176
|
+
*/
|
|
177
|
+
exportCsv(content: string, mode: string, delimiter: string, include_properties: boolean): string;
|
|
178
|
+
/**
|
|
179
|
+
* Export **IFC5 / IFCX** (the USD-style node graph). `only_known_properties` keeps
|
|
180
|
+
* only properties with an official IFC5 schema.
|
|
181
|
+
*/
|
|
182
|
+
exportIfcx(content: string, only_known_properties: boolean, pretty: boolean): string;
|
|
183
|
+
/**
|
|
184
|
+
* Export structured **JSON** (array of entity objects with typed property values).
|
|
185
|
+
*/
|
|
186
|
+
exportJson(content: string, pretty: boolean, include_properties: boolean, include_quantities: boolean): string;
|
|
187
|
+
/**
|
|
188
|
+
* Export **JSON-LD** (`@graph` of `ifc:` nodes). Empty `context` ⇒ buildingSMART
|
|
189
|
+
* IFC4 OWL default. `included` is an express-id isolation filter mirroring the
|
|
190
|
+
* OBJ/glTF/STEP exporters (empty ⇒ all entities).
|
|
191
|
+
*/
|
|
192
|
+
exportJsonld(content: string, context: string, include_properties: boolean, include_quantities: boolean, pretty: boolean, included: Uint32Array): string;
|
|
193
|
+
/**
|
|
194
|
+
* Re-serialize the model in `content` to a STEP/IFC string.
|
|
195
|
+
*
|
|
196
|
+
* `schema` is the FILE_SCHEMA label to write (empty ⇒ preserve the source schema).
|
|
197
|
+
* `included` is an express-id allowlist (empty ⇒ whole model); when set, the forward
|
|
198
|
+
* `#`-reference closure is added so the subset never dangles a reference.
|
|
199
|
+
* `mutations_json` carries `MutablePropertyView` edits (attribute updates +
|
|
200
|
+
* property-set synthesis); empty ⇒ none. See `export_step_json` for the shape.
|
|
201
|
+
*/
|
|
202
|
+
exportStep(content: string, schema: string, included: Uint32Array, mutations_json: string): string;
|
|
203
|
+
/**
|
|
204
|
+
* Merge several IFC models into one STEP/IFC string. `concatenated` is every model's
|
|
205
|
+
* bytes laid end-to-end; `lengths[i]` is the byte length of model `i`. The first model
|
|
206
|
+
* keeps its ids; later models are id-offset and their project unified to the first.
|
|
207
|
+
*/
|
|
208
|
+
exportMerged(concatenated: Uint8Array, lengths: Uint32Array, schema: string): string;
|
|
209
|
+
/**
|
|
210
|
+
* Export the `IfcSpace` volumes in `content` as a Honeybee **HBJSON** string.
|
|
211
|
+
*
|
|
212
|
+
* Rooms are built analytically from extruded-area profiles (watertight by construction);
|
|
213
|
+
* faces are typed Floor / RoofCeiling / Wall with outward normals. The result loads via
|
|
214
|
+
* `honeybee.model.Model.from_hbjson` and is ready for Ladybug Tools / Pollination.
|
|
215
|
+
*
|
|
216
|
+
* ```javascript
|
|
217
|
+
* const api = new IfcAPI();
|
|
218
|
+
* const hbjson = api.exportHbjson(ifcContent, "my_model");
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
exportHbjson(content: string, name: string): string;
|
|
137
222
|
/**
|
|
138
223
|
* Parse the file and return every `IfcAlignment` directrix as a flat
|
|
139
224
|
* `Float32Array` of 3D line-list vertices `[x0,y0,z0, x1,y1,z1, …]` in
|
|
@@ -220,6 +305,18 @@ export class IfcAPI {
|
|
|
220
305
|
* fail fast.
|
|
221
306
|
*/
|
|
222
307
|
clearPrePassCache(): void;
|
|
308
|
+
/**
|
|
309
|
+
* Enable or disable the PARAMETRIC rectangular-opening fast path (the
|
|
310
|
+
* placement-frame, ground-truth-exact analytic cut) for `processGeometryBatch`.
|
|
311
|
+
*
|
|
312
|
+
* DEFAULT OFF. This is the wasm-side toggle that lets native and wasm flip the
|
|
313
|
+
* flag in LOCKSTEP — the byte-identical native==wasm contract requires both
|
|
314
|
+
* targets take the same path, and wasm has no env to read `IFC_LITE_RECT_PARAM`.
|
|
315
|
+
* The path subtracts rectangular openings as exact parametric boxes in the host's
|
|
316
|
+
* own placement frame (rotated walls included), deferring any non-clean case to
|
|
317
|
+
* the exact kernel. Pass `true` before `processGeometryBatch`.
|
|
318
|
+
*/
|
|
319
|
+
setRectParamFastPath(enabled: boolean): void;
|
|
223
320
|
/**
|
|
224
321
|
* Select the tessellation detail level applied by every subsequent
|
|
225
322
|
* `processGeometryBatch` call (issue #976, step 4).
|
|
@@ -914,6 +1011,17 @@ export interface InitOutput {
|
|
|
914
1011
|
readonly ifcapi_buildPrePassOnce: (a: number, b: number, c: number) => number;
|
|
915
1012
|
readonly ifcapi_buildPrePassStreaming: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
916
1013
|
readonly ifcapi_clearPrePassCache: (a: number) => void;
|
|
1014
|
+
readonly ifcapi_exportCsv: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
1015
|
+
readonly ifcapi_exportGlb: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
|
|
1016
|
+
readonly ifcapi_exportGlbFromMeshes: (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) => void;
|
|
1017
|
+
readonly ifcapi_exportHbjson: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1018
|
+
readonly ifcapi_exportIfcx: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1019
|
+
readonly ifcapi_exportJson: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1020
|
+
readonly ifcapi_exportJsonld: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
|
|
1021
|
+
readonly ifcapi_exportKmz: (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) => void;
|
|
1022
|
+
readonly ifcapi_exportMerged: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
1023
|
+
readonly ifcapi_exportObj: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
1024
|
+
readonly ifcapi_exportStep: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
917
1025
|
readonly ifcapi_extractProfiles: (a: number, b: number, c: number, d: number) => number;
|
|
918
1026
|
readonly ifcapi_getMemory: (a: number) => number;
|
|
919
1027
|
readonly ifcapi_is_ready: (a: number) => number;
|
|
@@ -929,6 +1037,7 @@ export interface InitOutput {
|
|
|
929
1037
|
readonly ifcapi_setComputeGeometryHashes: (a: number, b: number, c: number) => void;
|
|
930
1038
|
readonly ifcapi_setEntityIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
931
1039
|
readonly ifcapi_setMergeLayers: (a: number, b: number) => void;
|
|
1040
|
+
readonly ifcapi_setRectParamFastPath: (a: number, b: number) => void;
|
|
932
1041
|
readonly ifcapi_setTessellationQuality: (a: number, b: number, c: number, d: number) => void;
|
|
933
1042
|
readonly ifcapi_version: (a: number, b: number) => void;
|
|
934
1043
|
readonly meshOutline2d: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
package/pkg/ifc-lite.js
CHANGED
|
@@ -624,6 +624,155 @@ export class IfcAPI {
|
|
|
624
624
|
const ptr = this.__destroy_into_raw();
|
|
625
625
|
wasm.__wbg_ifcapi_free(ptr, 0);
|
|
626
626
|
}
|
|
627
|
+
/**
|
|
628
|
+
* Export the render geometry in `content` as a binary **GLB** (`Uint8Array`).
|
|
629
|
+
*
|
|
630
|
+
* `hidden` / `isolated` are express-id visibility filters; `hidden_types_csv` is a
|
|
631
|
+
* comma-separated list of IFC type names whose class toggle is off (e.g.
|
|
632
|
+
* `"IfcOpeningElement,IfcSpace"`). `include_metadata` attaches counts + per-node
|
|
633
|
+
* `expressId`. Per-mesh RTC origin rides the node translation (precision-safe).
|
|
634
|
+
* @param {string} content
|
|
635
|
+
* @param {boolean} include_metadata
|
|
636
|
+
* @param {Uint32Array} hidden
|
|
637
|
+
* @param {Uint32Array} isolated
|
|
638
|
+
* @param {string} hidden_types_csv
|
|
639
|
+
* @returns {Uint8Array}
|
|
640
|
+
*/
|
|
641
|
+
exportGlb(content, include_metadata, hidden, isolated, hidden_types_csv) {
|
|
642
|
+
try {
|
|
643
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
644
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
645
|
+
const len0 = WASM_VECTOR_LEN;
|
|
646
|
+
const ptr1 = passArray32ToWasm0(hidden, wasm.__wbindgen_export);
|
|
647
|
+
const len1 = WASM_VECTOR_LEN;
|
|
648
|
+
const ptr2 = passArray32ToWasm0(isolated, wasm.__wbindgen_export);
|
|
649
|
+
const len2 = WASM_VECTOR_LEN;
|
|
650
|
+
const ptr3 = passStringToWasm0(hidden_types_csv, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
651
|
+
const len3 = WASM_VECTOR_LEN;
|
|
652
|
+
wasm.ifcapi_exportGlb(retptr, this.__wbg_ptr, ptr0, len0, include_metadata, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
653
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
654
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
655
|
+
var v5 = getArrayU8FromWasm0(r0, r1).slice();
|
|
656
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
657
|
+
return v5;
|
|
658
|
+
} finally {
|
|
659
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Package an already-produced **GLB** + georeference into a **KMZ** (`Uint8Array`)
|
|
664
|
+
* for Google Earth: a ZIP of `doc.kml` (a `<Model>` placed at `latitude`/`longitude`/
|
|
665
|
+
* `altitude`) + `model.glb`. `x_axis_abscissa`/`x_axis_ordinate` are the
|
|
666
|
+
* `IfcMapConversion` grid-north components; pass both as `undefined` for heading 0.
|
|
667
|
+
* @param {Uint8Array} glb
|
|
668
|
+
* @param {number} latitude
|
|
669
|
+
* @param {number} longitude
|
|
670
|
+
* @param {number} altitude
|
|
671
|
+
* @param {number | null | undefined} x_axis_abscissa
|
|
672
|
+
* @param {number | null | undefined} x_axis_ordinate
|
|
673
|
+
* @param {string} name
|
|
674
|
+
* @returns {Uint8Array}
|
|
675
|
+
*/
|
|
676
|
+
exportKmz(glb, latitude, longitude, altitude, x_axis_abscissa, x_axis_ordinate, name) {
|
|
677
|
+
try {
|
|
678
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
679
|
+
const ptr0 = passArray8ToWasm0(glb, wasm.__wbindgen_export);
|
|
680
|
+
const len0 = WASM_VECTOR_LEN;
|
|
681
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
682
|
+
const len1 = WASM_VECTOR_LEN;
|
|
683
|
+
wasm.ifcapi_exportKmz(retptr, this.__wbg_ptr, ptr0, len0, latitude, longitude, altitude, !isLikeNone(x_axis_abscissa), isLikeNone(x_axis_abscissa) ? 0 : x_axis_abscissa, !isLikeNone(x_axis_ordinate), isLikeNone(x_axis_ordinate) ? 0 : x_axis_ordinate, ptr1, len1);
|
|
684
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
685
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
686
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
687
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
688
|
+
return v3;
|
|
689
|
+
} finally {
|
|
690
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Assemble a **GLB** from already-produced meshes (the viewer's `MeshData`, flattened)
|
|
695
|
+
* — no re-meshing. Per mesh `i`: `vertex_counts[i]` verts + `index_counts[i]` indices
|
|
696
|
+
* taken in order from the concatenated `positions`/`normals`/`indices`; `colors` is
|
|
697
|
+
* RGBA per mesh, `origins` xyz per mesh, `express_ids` labels each mesh (indices are
|
|
698
|
+
* per-mesh local). The caller passes exactly the meshes it wants emitted.
|
|
699
|
+
* @param {Float32Array} positions
|
|
700
|
+
* @param {Float32Array} normals
|
|
701
|
+
* @param {Uint32Array} indices
|
|
702
|
+
* @param {Uint32Array} vertex_counts
|
|
703
|
+
* @param {Uint32Array} index_counts
|
|
704
|
+
* @param {Float32Array} colors
|
|
705
|
+
* @param {Float64Array} origins
|
|
706
|
+
* @param {Uint32Array} express_ids
|
|
707
|
+
* @param {boolean} include_metadata
|
|
708
|
+
* @returns {Uint8Array}
|
|
709
|
+
*/
|
|
710
|
+
exportGlbFromMeshes(positions, normals, indices, vertex_counts, index_counts, colors, origins, express_ids, include_metadata) {
|
|
711
|
+
try {
|
|
712
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
713
|
+
const ptr0 = passArrayF32ToWasm0(positions, wasm.__wbindgen_export);
|
|
714
|
+
const len0 = WASM_VECTOR_LEN;
|
|
715
|
+
const ptr1 = passArrayF32ToWasm0(normals, wasm.__wbindgen_export);
|
|
716
|
+
const len1 = WASM_VECTOR_LEN;
|
|
717
|
+
const ptr2 = passArray32ToWasm0(indices, wasm.__wbindgen_export);
|
|
718
|
+
const len2 = WASM_VECTOR_LEN;
|
|
719
|
+
const ptr3 = passArray32ToWasm0(vertex_counts, wasm.__wbindgen_export);
|
|
720
|
+
const len3 = WASM_VECTOR_LEN;
|
|
721
|
+
const ptr4 = passArray32ToWasm0(index_counts, wasm.__wbindgen_export);
|
|
722
|
+
const len4 = WASM_VECTOR_LEN;
|
|
723
|
+
const ptr5 = passArrayF32ToWasm0(colors, wasm.__wbindgen_export);
|
|
724
|
+
const len5 = WASM_VECTOR_LEN;
|
|
725
|
+
const ptr6 = passArrayF64ToWasm0(origins, wasm.__wbindgen_export);
|
|
726
|
+
const len6 = WASM_VECTOR_LEN;
|
|
727
|
+
const ptr7 = passArray32ToWasm0(express_ids, wasm.__wbindgen_export);
|
|
728
|
+
const len7 = WASM_VECTOR_LEN;
|
|
729
|
+
wasm.ifcapi_exportGlbFromMeshes(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, include_metadata);
|
|
730
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
731
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
732
|
+
var v9 = getArrayU8FromWasm0(r0, r1).slice();
|
|
733
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
734
|
+
return v9;
|
|
735
|
+
} finally {
|
|
736
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* Export the render geometry in `content` as a Wavefront **OBJ** string.
|
|
741
|
+
*
|
|
742
|
+
* `hidden` / `isolated` are express-id filters mirroring the viewer's visibility
|
|
743
|
+
* state (empty `isolated` ⇒ all visible). Instanced type-library shapes are skipped.
|
|
744
|
+
*
|
|
745
|
+
* ```javascript
|
|
746
|
+
* const obj = api.exportObj(ifcContent, true, new Uint32Array(), new Uint32Array());
|
|
747
|
+
* ```
|
|
748
|
+
* @param {string} content
|
|
749
|
+
* @param {boolean} include_normals
|
|
750
|
+
* @param {Uint32Array} hidden
|
|
751
|
+
* @param {Uint32Array} isolated
|
|
752
|
+
* @returns {string}
|
|
753
|
+
*/
|
|
754
|
+
exportObj(content, include_normals, hidden, isolated) {
|
|
755
|
+
let deferred4_0;
|
|
756
|
+
let deferred4_1;
|
|
757
|
+
try {
|
|
758
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
759
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
760
|
+
const len0 = WASM_VECTOR_LEN;
|
|
761
|
+
const ptr1 = passArray32ToWasm0(hidden, wasm.__wbindgen_export);
|
|
762
|
+
const len1 = WASM_VECTOR_LEN;
|
|
763
|
+
const ptr2 = passArray32ToWasm0(isolated, wasm.__wbindgen_export);
|
|
764
|
+
const len2 = WASM_VECTOR_LEN;
|
|
765
|
+
wasm.ifcapi_exportObj(retptr, this.__wbg_ptr, ptr0, len0, include_normals, ptr1, len1, ptr2, len2);
|
|
766
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
767
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
768
|
+
deferred4_0 = r0;
|
|
769
|
+
deferred4_1 = r1;
|
|
770
|
+
return getStringFromWasm0(r0, r1);
|
|
771
|
+
} finally {
|
|
772
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
773
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
627
776
|
/**
|
|
628
777
|
* Run the pre-pass ONCE and return serialized results for worker distribution.
|
|
629
778
|
* Takes raw bytes (&[u8]) to avoid TextDecoder overhead.
|
|
@@ -762,6 +911,228 @@ export class IfcAPI {
|
|
|
762
911
|
const ret = wasm.ifcapi_parseGridLines(this.__wbg_ptr, ptr0, len0);
|
|
763
912
|
return takeObject(ret);
|
|
764
913
|
}
|
|
914
|
+
/**
|
|
915
|
+
* Export tabular **CSV**. `mode` ∈ {`"entities"`, `"properties"`, `"quantities"`,
|
|
916
|
+
* `"spatial"`}. `delimiter` defaults to `,` when empty; `include_properties` adds
|
|
917
|
+
* flattened `Pset_Prop` columns to the entities view.
|
|
918
|
+
* @param {string} content
|
|
919
|
+
* @param {string} mode
|
|
920
|
+
* @param {string} delimiter
|
|
921
|
+
* @param {boolean} include_properties
|
|
922
|
+
* @returns {string}
|
|
923
|
+
*/
|
|
924
|
+
exportCsv(content, mode, delimiter, include_properties) {
|
|
925
|
+
let deferred4_0;
|
|
926
|
+
let deferred4_1;
|
|
927
|
+
try {
|
|
928
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
929
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
930
|
+
const len0 = WASM_VECTOR_LEN;
|
|
931
|
+
const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
932
|
+
const len1 = WASM_VECTOR_LEN;
|
|
933
|
+
const ptr2 = passStringToWasm0(delimiter, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
934
|
+
const len2 = WASM_VECTOR_LEN;
|
|
935
|
+
wasm.ifcapi_exportCsv(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, include_properties);
|
|
936
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
937
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
938
|
+
deferred4_0 = r0;
|
|
939
|
+
deferred4_1 = r1;
|
|
940
|
+
return getStringFromWasm0(r0, r1);
|
|
941
|
+
} finally {
|
|
942
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
943
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Export **IFC5 / IFCX** (the USD-style node graph). `only_known_properties` keeps
|
|
948
|
+
* only properties with an official IFC5 schema.
|
|
949
|
+
* @param {string} content
|
|
950
|
+
* @param {boolean} only_known_properties
|
|
951
|
+
* @param {boolean} pretty
|
|
952
|
+
* @returns {string}
|
|
953
|
+
*/
|
|
954
|
+
exportIfcx(content, only_known_properties, pretty) {
|
|
955
|
+
let deferred2_0;
|
|
956
|
+
let deferred2_1;
|
|
957
|
+
try {
|
|
958
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
959
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
960
|
+
const len0 = WASM_VECTOR_LEN;
|
|
961
|
+
wasm.ifcapi_exportIfcx(retptr, this.__wbg_ptr, ptr0, len0, only_known_properties, pretty);
|
|
962
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
963
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
964
|
+
deferred2_0 = r0;
|
|
965
|
+
deferred2_1 = r1;
|
|
966
|
+
return getStringFromWasm0(r0, r1);
|
|
967
|
+
} finally {
|
|
968
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
969
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* Export structured **JSON** (array of entity objects with typed property values).
|
|
974
|
+
* @param {string} content
|
|
975
|
+
* @param {boolean} pretty
|
|
976
|
+
* @param {boolean} include_properties
|
|
977
|
+
* @param {boolean} include_quantities
|
|
978
|
+
* @returns {string}
|
|
979
|
+
*/
|
|
980
|
+
exportJson(content, pretty, include_properties, include_quantities) {
|
|
981
|
+
let deferred2_0;
|
|
982
|
+
let deferred2_1;
|
|
983
|
+
try {
|
|
984
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
985
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
986
|
+
const len0 = WASM_VECTOR_LEN;
|
|
987
|
+
wasm.ifcapi_exportJson(retptr, this.__wbg_ptr, ptr0, len0, pretty, include_properties, include_quantities);
|
|
988
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
989
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
990
|
+
deferred2_0 = r0;
|
|
991
|
+
deferred2_1 = r1;
|
|
992
|
+
return getStringFromWasm0(r0, r1);
|
|
993
|
+
} finally {
|
|
994
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
995
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* Export **JSON-LD** (`@graph` of `ifc:` nodes). Empty `context` ⇒ buildingSMART
|
|
1000
|
+
* IFC4 OWL default. `included` is an express-id isolation filter mirroring the
|
|
1001
|
+
* OBJ/glTF/STEP exporters (empty ⇒ all entities).
|
|
1002
|
+
* @param {string} content
|
|
1003
|
+
* @param {string} context
|
|
1004
|
+
* @param {boolean} include_properties
|
|
1005
|
+
* @param {boolean} include_quantities
|
|
1006
|
+
* @param {boolean} pretty
|
|
1007
|
+
* @param {Uint32Array} included
|
|
1008
|
+
* @returns {string}
|
|
1009
|
+
*/
|
|
1010
|
+
exportJsonld(content, context, include_properties, include_quantities, pretty, included) {
|
|
1011
|
+
let deferred4_0;
|
|
1012
|
+
let deferred4_1;
|
|
1013
|
+
try {
|
|
1014
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1015
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1016
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1017
|
+
const ptr1 = passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1018
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1019
|
+
const ptr2 = passArray32ToWasm0(included, wasm.__wbindgen_export);
|
|
1020
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1021
|
+
wasm.ifcapi_exportJsonld(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, include_properties, include_quantities, pretty, ptr2, len2);
|
|
1022
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1023
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1024
|
+
deferred4_0 = r0;
|
|
1025
|
+
deferred4_1 = r1;
|
|
1026
|
+
return getStringFromWasm0(r0, r1);
|
|
1027
|
+
} finally {
|
|
1028
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1029
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* Re-serialize the model in `content` to a STEP/IFC string.
|
|
1034
|
+
*
|
|
1035
|
+
* `schema` is the FILE_SCHEMA label to write (empty ⇒ preserve the source schema).
|
|
1036
|
+
* `included` is an express-id allowlist (empty ⇒ whole model); when set, the forward
|
|
1037
|
+
* `#`-reference closure is added so the subset never dangles a reference.
|
|
1038
|
+
* `mutations_json` carries `MutablePropertyView` edits (attribute updates +
|
|
1039
|
+
* property-set synthesis); empty ⇒ none. See `export_step_json` for the shape.
|
|
1040
|
+
* @param {string} content
|
|
1041
|
+
* @param {string} schema
|
|
1042
|
+
* @param {Uint32Array} included
|
|
1043
|
+
* @param {string} mutations_json
|
|
1044
|
+
* @returns {string}
|
|
1045
|
+
*/
|
|
1046
|
+
exportStep(content, schema, included, mutations_json) {
|
|
1047
|
+
let deferred5_0;
|
|
1048
|
+
let deferred5_1;
|
|
1049
|
+
try {
|
|
1050
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1051
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1052
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1053
|
+
const ptr1 = passStringToWasm0(schema, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1054
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1055
|
+
const ptr2 = passArray32ToWasm0(included, wasm.__wbindgen_export);
|
|
1056
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1057
|
+
const ptr3 = passStringToWasm0(mutations_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1058
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1059
|
+
wasm.ifcapi_exportStep(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1060
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1061
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1062
|
+
deferred5_0 = r0;
|
|
1063
|
+
deferred5_1 = r1;
|
|
1064
|
+
return getStringFromWasm0(r0, r1);
|
|
1065
|
+
} finally {
|
|
1066
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1067
|
+
wasm.__wbindgen_export4(deferred5_0, deferred5_1, 1);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* Merge several IFC models into one STEP/IFC string. `concatenated` is every model's
|
|
1072
|
+
* bytes laid end-to-end; `lengths[i]` is the byte length of model `i`. The first model
|
|
1073
|
+
* keeps its ids; later models are id-offset and their project unified to the first.
|
|
1074
|
+
* @param {Uint8Array} concatenated
|
|
1075
|
+
* @param {Uint32Array} lengths
|
|
1076
|
+
* @param {string} schema
|
|
1077
|
+
* @returns {string}
|
|
1078
|
+
*/
|
|
1079
|
+
exportMerged(concatenated, lengths, schema) {
|
|
1080
|
+
let deferred4_0;
|
|
1081
|
+
let deferred4_1;
|
|
1082
|
+
try {
|
|
1083
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1084
|
+
const ptr0 = passArray8ToWasm0(concatenated, wasm.__wbindgen_export);
|
|
1085
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1086
|
+
const ptr1 = passArray32ToWasm0(lengths, wasm.__wbindgen_export);
|
|
1087
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1088
|
+
const ptr2 = passStringToWasm0(schema, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1089
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1090
|
+
wasm.ifcapi_exportMerged(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1091
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1092
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1093
|
+
deferred4_0 = r0;
|
|
1094
|
+
deferred4_1 = r1;
|
|
1095
|
+
return getStringFromWasm0(r0, r1);
|
|
1096
|
+
} finally {
|
|
1097
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1098
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
/**
|
|
1102
|
+
* Export the `IfcSpace` volumes in `content` as a Honeybee **HBJSON** string.
|
|
1103
|
+
*
|
|
1104
|
+
* Rooms are built analytically from extruded-area profiles (watertight by construction);
|
|
1105
|
+
* faces are typed Floor / RoofCeiling / Wall with outward normals. The result loads via
|
|
1106
|
+
* `honeybee.model.Model.from_hbjson` and is ready for Ladybug Tools / Pollination.
|
|
1107
|
+
*
|
|
1108
|
+
* ```javascript
|
|
1109
|
+
* const api = new IfcAPI();
|
|
1110
|
+
* const hbjson = api.exportHbjson(ifcContent, "my_model");
|
|
1111
|
+
* ```
|
|
1112
|
+
* @param {string} content
|
|
1113
|
+
* @param {string} name
|
|
1114
|
+
* @returns {string}
|
|
1115
|
+
*/
|
|
1116
|
+
exportHbjson(content, name) {
|
|
1117
|
+
let deferred3_0;
|
|
1118
|
+
let deferred3_1;
|
|
1119
|
+
try {
|
|
1120
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1121
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1122
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1123
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1124
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1125
|
+
wasm.ifcapi_exportHbjson(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1126
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1127
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1128
|
+
deferred3_0 = r0;
|
|
1129
|
+
deferred3_1 = r1;
|
|
1130
|
+
return getStringFromWasm0(r0, r1);
|
|
1131
|
+
} finally {
|
|
1132
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1133
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
765
1136
|
/**
|
|
766
1137
|
* Parse the file and return every `IfcAlignment` directrix as a flat
|
|
767
1138
|
* `Float32Array` of 3D line-list vertices `[x0,y0,z0, x1,y1,z1, …]` in
|
|
@@ -883,6 +1254,21 @@ export class IfcAPI {
|
|
|
883
1254
|
clearPrePassCache() {
|
|
884
1255
|
wasm.ifcapi_clearPrePassCache(this.__wbg_ptr);
|
|
885
1256
|
}
|
|
1257
|
+
/**
|
|
1258
|
+
* Enable or disable the PARAMETRIC rectangular-opening fast path (the
|
|
1259
|
+
* placement-frame, ground-truth-exact analytic cut) for `processGeometryBatch`.
|
|
1260
|
+
*
|
|
1261
|
+
* DEFAULT OFF. This is the wasm-side toggle that lets native and wasm flip the
|
|
1262
|
+
* flag in LOCKSTEP — the byte-identical native==wasm contract requires both
|
|
1263
|
+
* targets take the same path, and wasm has no env to read `IFC_LITE_RECT_PARAM`.
|
|
1264
|
+
* The path subtracts rectangular openings as exact parametric boxes in the host's
|
|
1265
|
+
* own placement frame (rotated walls included), deferring any non-clean case to
|
|
1266
|
+
* the exact kernel. Pass `true` before `processGeometryBatch`.
|
|
1267
|
+
* @param {boolean} enabled
|
|
1268
|
+
*/
|
|
1269
|
+
setRectParamFastPath(enabled) {
|
|
1270
|
+
wasm.ifcapi_setRectParamFastPath(this.__wbg_ptr, enabled);
|
|
1271
|
+
}
|
|
886
1272
|
/**
|
|
887
1273
|
* Select the tessellation detail level applied by every subsequent
|
|
888
1274
|
* `processGeometryBatch` call (issue #976, step 4).
|
package/pkg/ifc-lite_bg.wasm
CHANGED
|
Binary file
|