@ifc-lite/wasm 2.9.1 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/pkg/ifc-lite.d.ts +27 -0
- package/pkg/ifc-lite.js +50 -0
- package/pkg/ifc-lite_bg.wasm +0 -0
package/package.json
CHANGED
package/pkg/ifc-lite.d.ts
CHANGED
|
@@ -134,6 +134,19 @@ export class IfcAPI {
|
|
|
134
134
|
* clear the overlay cheaply.
|
|
135
135
|
*/
|
|
136
136
|
parseGridLines(content: string): Float32Array;
|
|
137
|
+
/**
|
|
138
|
+
* Export the `IfcSpace` volumes in `content` as a Honeybee **HBJSON** string.
|
|
139
|
+
*
|
|
140
|
+
* Rooms are built analytically from extruded-area profiles (watertight by construction);
|
|
141
|
+
* faces are typed Floor / RoofCeiling / Wall with outward normals. The result loads via
|
|
142
|
+
* `honeybee.model.Model.from_hbjson` and is ready for Ladybug Tools / Pollination.
|
|
143
|
+
*
|
|
144
|
+
* ```javascript
|
|
145
|
+
* const api = new IfcAPI();
|
|
146
|
+
* const hbjson = api.exportHbjson(ifcContent, "my_model");
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
exportHbjson(content: string, name: string): string;
|
|
137
150
|
/**
|
|
138
151
|
* Parse the file and return every `IfcAlignment` directrix as a flat
|
|
139
152
|
* `Float32Array` of 3D line-list vertices `[x0,y0,z0, x1,y1,z1, …]` in
|
|
@@ -220,6 +233,18 @@ export class IfcAPI {
|
|
|
220
233
|
* fail fast.
|
|
221
234
|
*/
|
|
222
235
|
clearPrePassCache(): void;
|
|
236
|
+
/**
|
|
237
|
+
* Enable or disable the PARAMETRIC rectangular-opening fast path (the
|
|
238
|
+
* placement-frame, ground-truth-exact analytic cut) for `processGeometryBatch`.
|
|
239
|
+
*
|
|
240
|
+
* DEFAULT OFF. This is the wasm-side toggle that lets native and wasm flip the
|
|
241
|
+
* flag in LOCKSTEP — the byte-identical native==wasm contract requires both
|
|
242
|
+
* targets take the same path, and wasm has no env to read `IFC_LITE_RECT_PARAM`.
|
|
243
|
+
* The path subtracts rectangular openings as exact parametric boxes in the host's
|
|
244
|
+
* own placement frame (rotated walls included), deferring any non-clean case to
|
|
245
|
+
* the exact kernel. Pass `true` before `processGeometryBatch`.
|
|
246
|
+
*/
|
|
247
|
+
setRectParamFastPath(enabled: boolean): void;
|
|
223
248
|
/**
|
|
224
249
|
* Select the tessellation detail level applied by every subsequent
|
|
225
250
|
* `processGeometryBatch` call (issue #976, step 4).
|
|
@@ -914,6 +939,7 @@ export interface InitOutput {
|
|
|
914
939
|
readonly ifcapi_buildPrePassOnce: (a: number, b: number, c: number) => number;
|
|
915
940
|
readonly ifcapi_buildPrePassStreaming: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
916
941
|
readonly ifcapi_clearPrePassCache: (a: number) => void;
|
|
942
|
+
readonly ifcapi_exportHbjson: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
917
943
|
readonly ifcapi_extractProfiles: (a: number, b: number, c: number, d: number) => number;
|
|
918
944
|
readonly ifcapi_getMemory: (a: number) => number;
|
|
919
945
|
readonly ifcapi_is_ready: (a: number) => number;
|
|
@@ -929,6 +955,7 @@ export interface InitOutput {
|
|
|
929
955
|
readonly ifcapi_setComputeGeometryHashes: (a: number, b: number, c: number) => void;
|
|
930
956
|
readonly ifcapi_setEntityIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
931
957
|
readonly ifcapi_setMergeLayers: (a: number, b: number) => void;
|
|
958
|
+
readonly ifcapi_setRectParamFastPath: (a: number, b: number) => void;
|
|
932
959
|
readonly ifcapi_setTessellationQuality: (a: number, b: number, c: number, d: number) => void;
|
|
933
960
|
readonly ifcapi_version: (a: number, b: number) => void;
|
|
934
961
|
readonly meshOutline2d: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
package/pkg/ifc-lite.js
CHANGED
|
@@ -762,6 +762,41 @@ export class IfcAPI {
|
|
|
762
762
|
const ret = wasm.ifcapi_parseGridLines(this.__wbg_ptr, ptr0, len0);
|
|
763
763
|
return takeObject(ret);
|
|
764
764
|
}
|
|
765
|
+
/**
|
|
766
|
+
* Export the `IfcSpace` volumes in `content` as a Honeybee **HBJSON** string.
|
|
767
|
+
*
|
|
768
|
+
* Rooms are built analytically from extruded-area profiles (watertight by construction);
|
|
769
|
+
* faces are typed Floor / RoofCeiling / Wall with outward normals. The result loads via
|
|
770
|
+
* `honeybee.model.Model.from_hbjson` and is ready for Ladybug Tools / Pollination.
|
|
771
|
+
*
|
|
772
|
+
* ```javascript
|
|
773
|
+
* const api = new IfcAPI();
|
|
774
|
+
* const hbjson = api.exportHbjson(ifcContent, "my_model");
|
|
775
|
+
* ```
|
|
776
|
+
* @param {string} content
|
|
777
|
+
* @param {string} name
|
|
778
|
+
* @returns {string}
|
|
779
|
+
*/
|
|
780
|
+
exportHbjson(content, name) {
|
|
781
|
+
let deferred3_0;
|
|
782
|
+
let deferred3_1;
|
|
783
|
+
try {
|
|
784
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
785
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
786
|
+
const len0 = WASM_VECTOR_LEN;
|
|
787
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
788
|
+
const len1 = WASM_VECTOR_LEN;
|
|
789
|
+
wasm.ifcapi_exportHbjson(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
790
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
791
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
792
|
+
deferred3_0 = r0;
|
|
793
|
+
deferred3_1 = r1;
|
|
794
|
+
return getStringFromWasm0(r0, r1);
|
|
795
|
+
} finally {
|
|
796
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
797
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
798
|
+
}
|
|
799
|
+
}
|
|
765
800
|
/**
|
|
766
801
|
* Parse the file and return every `IfcAlignment` directrix as a flat
|
|
767
802
|
* `Float32Array` of 3D line-list vertices `[x0,y0,z0, x1,y1,z1, …]` in
|
|
@@ -883,6 +918,21 @@ export class IfcAPI {
|
|
|
883
918
|
clearPrePassCache() {
|
|
884
919
|
wasm.ifcapi_clearPrePassCache(this.__wbg_ptr);
|
|
885
920
|
}
|
|
921
|
+
/**
|
|
922
|
+
* Enable or disable the PARAMETRIC rectangular-opening fast path (the
|
|
923
|
+
* placement-frame, ground-truth-exact analytic cut) for `processGeometryBatch`.
|
|
924
|
+
*
|
|
925
|
+
* DEFAULT OFF. This is the wasm-side toggle that lets native and wasm flip the
|
|
926
|
+
* flag in LOCKSTEP — the byte-identical native==wasm contract requires both
|
|
927
|
+
* targets take the same path, and wasm has no env to read `IFC_LITE_RECT_PARAM`.
|
|
928
|
+
* The path subtracts rectangular openings as exact parametric boxes in the host's
|
|
929
|
+
* own placement frame (rotated walls included), deferring any non-clean case to
|
|
930
|
+
* the exact kernel. Pass `true` before `processGeometryBatch`.
|
|
931
|
+
* @param {boolean} enabled
|
|
932
|
+
*/
|
|
933
|
+
setRectParamFastPath(enabled) {
|
|
934
|
+
wasm.ifcapi_setRectParamFastPath(this.__wbg_ptr, enabled);
|
|
935
|
+
}
|
|
886
936
|
/**
|
|
887
937
|
* Select the tessellation detail level applied by every subsequent
|
|
888
938
|
* `processGeometryBatch` call (issue #976, step 4).
|
package/pkg/ifc-lite_bg.wasm
CHANGED
|
Binary file
|