@ifc-lite/wasm 3.0.7 → 3.0.9
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 +88 -0
- package/pkg/ifc-lite.js +198 -0
- package/pkg/ifc-lite_bg.wasm +0 -0
package/package.json
CHANGED
package/pkg/ifc-lite.d.ts
CHANGED
|
@@ -131,6 +131,34 @@ export class IfcAPI {
|
|
|
131
131
|
* ```
|
|
132
132
|
*/
|
|
133
133
|
exportObj(content: Uint8Array, include_normals: boolean, hidden: Uint32Array, isolated: Uint32Array): Uint8Array;
|
|
134
|
+
/**
|
|
135
|
+
* Store the whole IFC source file ONCE per load so the `*FromSource` batch
|
|
136
|
+
* variants can read it from the wasm heap instead of re-copying it per call.
|
|
137
|
+
*
|
|
138
|
+
* Mirrors the `setEntityIndex` lifecycle: called once per worker per load,
|
|
139
|
+
* and REPLACES the previous file wholesale (repeated calls swap the bytes),
|
|
140
|
+
* so a parser/geometry worker reusing one `IfcAPI` across loads is safe.
|
|
141
|
+
* The bytes must be the exact source the batch jobs' byte spans index into
|
|
142
|
+
* (the same buffer passed as `data` to the legacy `processGeometryBatch*`),
|
|
143
|
+
* or the decoded entities won't match — the JS worker installs its own
|
|
144
|
+
* session buffer, so this holds by construction.
|
|
145
|
+
*
|
|
146
|
+
* Taking `Vec<u8>` (by value) means wasm-bindgen hands us ownership of the
|
|
147
|
+
* single JS→wasm copy directly; we wrap it in `Arc` with no second copy.
|
|
148
|
+
*/
|
|
149
|
+
setSourceBytes(data: Uint8Array): void;
|
|
150
|
+
/**
|
|
151
|
+
* Like [`IfcAPI::process_geometry_batch`] but reads the source bytes held by
|
|
152
|
+
* [`IfcAPI::set_source_bytes`] instead of taking `data`. Byte-for-byte
|
|
153
|
+
* identical output — it delegates to the legacy twin with the held slice.
|
|
154
|
+
*/
|
|
155
|
+
processGeometryBatchFromSource(jobs_flat: Uint32Array, unit_scale: number, rtc_x: number, rtc_y: number, rtc_z: number, needs_shift: boolean, void_keys: Uint32Array, void_counts: Uint32Array, void_values: Uint32Array, style_ids: Uint32Array, style_colors: Uint8Array, plane_angle_to_radians?: number | null, material_element_ids?: Uint32Array | null, material_color_counts?: Uint32Array | null, material_colors_rgba?: Uint8Array | null): MeshCollection;
|
|
156
|
+
/**
|
|
157
|
+
* Like [`IfcAPI::process_geometry_batch_partitioned`] but reads the source
|
|
158
|
+
* bytes held by [`IfcAPI::set_source_bytes`] instead of taking `data`.
|
|
159
|
+
* Byte-for-byte identical output — it delegates to the legacy twin.
|
|
160
|
+
*/
|
|
161
|
+
processGeometryBatchPartitionedFromSource(jobs_flat: Uint32Array, unit_scale: number, rtc_x: number, rtc_y: number, rtc_z: number, needs_shift: boolean, void_keys: Uint32Array, void_counts: Uint32Array, void_values: Uint32Array, style_ids: Uint32Array, style_colors: Uint8Array, plane_angle_to_radians?: number | null, material_element_ids?: Uint32Array | null, material_color_counts?: Uint32Array | null, material_colors_rgba?: Uint8Array | null): PartitionedBatch;
|
|
134
162
|
/**
|
|
135
163
|
* Process geometry for a subset of pre-scanned entities → flat
|
|
136
164
|
* MeshCollection. Takes raw bytes + pre-pass data from buildPrePassOnce.
|
|
@@ -378,6 +406,52 @@ export class IfcAPI {
|
|
|
378
406
|
* Recovers a poisoned cache Mutex instead of panicking; see `mod_tests.rs`.
|
|
379
407
|
*/
|
|
380
408
|
clearPrePassCache(): void;
|
|
409
|
+
/**
|
|
410
|
+
* Install the pre-computed set of `IfcRepresentationMap` ids referenced by
|
|
411
|
+
* an `IfcMappedItem` (issue #957), so the worker's first type-product batch
|
|
412
|
+
* SKIPS the per-worker [`Self::get_or_build_referenced_repmaps`] full-file
|
|
413
|
+
* walk. The streaming pre-pass built the same set once from the
|
|
414
|
+
* `IfcMappedItem` spans it already scanned (see
|
|
415
|
+
* `styling::build_referenced_representation_maps_from_spans`) and ships the
|
|
416
|
+
* id list here — bit-identical to what each worker would compute, since a
|
|
417
|
+
* set's membership is order-invariant and consumers only call `.contains`.
|
|
418
|
+
*
|
|
419
|
+
* Installed AFTER `setEntityIndex` (which clears this cache on content
|
|
420
|
+
* swap), so the injected value survives. When this setter is never called
|
|
421
|
+
* (native path, non-streaming callers), the lazy build path is unchanged.
|
|
422
|
+
*/
|
|
423
|
+
setReferencedRepmaps(ids: Uint32Array): void;
|
|
424
|
+
/**
|
|
425
|
+
* Install the pre-computed #1623 Phase 3 don't-bake plan: the flat list of
|
|
426
|
+
* `IfcRepresentationMap` ids that an `IfcMappedItem` instantiates >= 2 times.
|
|
427
|
+
* The streaming pre-pass tallies it in the SAME scan that builds the referenced-
|
|
428
|
+
* repmap set (`styling::build_mapped_instance_plan_from_spans`) and ships the id
|
|
429
|
+
* list here. The batch path arms its router with it (batch-local template mode),
|
|
430
|
+
* so a repeated single-solid mapped source materializes ONCE per batch and the
|
|
431
|
+
* rest ride as instances in the IFNS shard.
|
|
432
|
+
*
|
|
433
|
+
* Same injection contract as [`Self::set_referenced_repmaps`]: installed after
|
|
434
|
+
* `setEntityIndex` (which clears it on content swap), and a no-op absence leaves
|
|
435
|
+
* the batch path materializing every occurrence (byte-identical). Each id is
|
|
436
|
+
* stored as `(2, id)` — the batch-local router only needs the eligibility set
|
|
437
|
+
* (count >= 2); the min-id template slot is unused in batch-local mode.
|
|
438
|
+
*/
|
|
439
|
+
setMappedInstancePlan(source_ids: Uint32Array): void;
|
|
440
|
+
/**
|
|
441
|
+
* Install the pre-computed [`ifc_lite_geometry::MaterialLayerIndex`] (#563)
|
|
442
|
+
* from its flat SoA encoding, so the worker's first batch skips the
|
|
443
|
+
* per-worker [`Self::get_or_build_material_layer_index`] full-file decode
|
|
444
|
+
* scan (the dominant first-batch cost on layered architectural models,
|
|
445
|
+
* which run this on the DEFAULT view). The streaming pre-pass built the
|
|
446
|
+
* index once from the `IfcRelAssociatesMaterial` spans it already scanned
|
|
447
|
+
* (`MaterialLayerIndex::from_spans`) and flat-encoded it here; the flat
|
|
448
|
+
* encoding round-trips bit-for-bit (proven in `material_layer_index` tests),
|
|
449
|
+
* so the injected index equals each worker's `from_content` result.
|
|
450
|
+
*
|
|
451
|
+
* Same injection contract as [`Self::set_referenced_repmaps`]: installed
|
|
452
|
+
* after `setEntityIndex`, and a no-op absence leaves the lazy build intact.
|
|
453
|
+
*/
|
|
454
|
+
setMaterialLayerIndex(element_ids: Uint32Array, axis: Uint32Array, layer_counts: Uint32Array, direction_sense: Float64Array, offset: Float64Array, layer_material_ids: Uint32Array, layer_thicknesses: Float64Array): void;
|
|
381
455
|
/**
|
|
382
456
|
* Enable or disable the PARAMETRIC rectangular-opening fast path (the
|
|
383
457
|
* placement-frame, ground-truth-exact analytic cut) for `processGeometryBatch`.
|
|
@@ -407,6 +481,13 @@ export class IfcAPI {
|
|
|
407
481
|
* silently rendering at the wrong density.
|
|
408
482
|
*/
|
|
409
483
|
setTessellationQuality(level?: string | null): void;
|
|
484
|
+
/**
|
|
485
|
+
* Install the pre-computed set of type ids that an `IfcRelDefinesByType`
|
|
486
|
+
* instantiates (#957 follow-up), so the worker's first type-product batch
|
|
487
|
+
* skips the per-worker [`Self::get_or_build_instantiated_type_ids`]
|
|
488
|
+
* full-file walk. Same injection contract as [`Self::set_referenced_repmaps`].
|
|
489
|
+
*/
|
|
490
|
+
setInstantiatedTypeIds(ids: Uint32Array): void;
|
|
410
491
|
/**
|
|
411
492
|
* Enable or disable per-entity geometry fingerprinting in
|
|
412
493
|
* `processGeometryBatch`, used by the viewer's revision-diff feature.
|
|
@@ -1156,16 +1237,23 @@ export interface InitOutput {
|
|
|
1156
1237
|
readonly ifcapi_parseGridLines: (a: number, b: number, c: number) => number;
|
|
1157
1238
|
readonly ifcapi_parseSymbolicRepresentations: (a: number, b: number, c: number) => number;
|
|
1158
1239
|
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, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number) => number;
|
|
1240
|
+
readonly ifcapi_processGeometryBatchFromSource: (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, u: number, v: number, w: number, x: number, y: number, z: number) => number;
|
|
1159
1241
|
readonly ifcapi_processGeometryBatchInstanced: (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, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number) => void;
|
|
1160
1242
|
readonly ifcapi_processGeometryBatchPartitioned: (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, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number) => number;
|
|
1243
|
+
readonly ifcapi_processGeometryBatchPartitionedFromSource: (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, u: number, v: number, w: number, x: number, y: number, z: number) => number;
|
|
1161
1244
|
readonly ifcapi_scanEntitiesFast: (a: number, b: number, c: number) => number;
|
|
1162
1245
|
readonly ifcapi_scanEntitiesFastBytes: (a: number, b: number, c: number) => number;
|
|
1163
1246
|
readonly ifcapi_scanGeometryEntitiesFast: (a: number, b: number, c: number) => number;
|
|
1164
1247
|
readonly ifcapi_setComputeGeometryHashes: (a: number, b: number, c: number) => void;
|
|
1165
1248
|
readonly ifcapi_setEntityIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1249
|
+
readonly ifcapi_setInstantiatedTypeIds: (a: number, b: number, c: number) => void;
|
|
1250
|
+
readonly ifcapi_setMappedInstancePlan: (a: number, b: number, c: number) => void;
|
|
1251
|
+
readonly ifcapi_setMaterialLayerIndex: (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) => void;
|
|
1166
1252
|
readonly ifcapi_setMergeLayers: (a: number, b: number) => void;
|
|
1167
1253
|
readonly ifcapi_setRectParamFastPath: (a: number, b: number) => void;
|
|
1254
|
+
readonly ifcapi_setReferencedRepmaps: (a: number, b: number, c: number) => void;
|
|
1168
1255
|
readonly ifcapi_setSkipSmallCuts: (a: number, b: number) => void;
|
|
1256
|
+
readonly ifcapi_setSourceBytes: (a: number, b: number, c: number) => void;
|
|
1169
1257
|
readonly ifcapi_setTessellationQuality: (a: number, b: number, c: number, d: number) => void;
|
|
1170
1258
|
readonly ifcapi_version: (a: number, b: number) => void;
|
|
1171
1259
|
readonly meshOutline2d: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
package/pkg/ifc-lite.js
CHANGED
|
@@ -795,6 +795,113 @@ export class IfcAPI {
|
|
|
795
795
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
|
+
/**
|
|
799
|
+
* Store the whole IFC source file ONCE per load so the `*FromSource` batch
|
|
800
|
+
* variants can read it from the wasm heap instead of re-copying it per call.
|
|
801
|
+
*
|
|
802
|
+
* Mirrors the `setEntityIndex` lifecycle: called once per worker per load,
|
|
803
|
+
* and REPLACES the previous file wholesale (repeated calls swap the bytes),
|
|
804
|
+
* so a parser/geometry worker reusing one `IfcAPI` across loads is safe.
|
|
805
|
+
* The bytes must be the exact source the batch jobs' byte spans index into
|
|
806
|
+
* (the same buffer passed as `data` to the legacy `processGeometryBatch*`),
|
|
807
|
+
* or the decoded entities won't match — the JS worker installs its own
|
|
808
|
+
* session buffer, so this holds by construction.
|
|
809
|
+
*
|
|
810
|
+
* Taking `Vec<u8>` (by value) means wasm-bindgen hands us ownership of the
|
|
811
|
+
* single JS→wasm copy directly; we wrap it in `Arc` with no second copy.
|
|
812
|
+
* @param {Uint8Array} data
|
|
813
|
+
*/
|
|
814
|
+
setSourceBytes(data) {
|
|
815
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
816
|
+
const len0 = WASM_VECTOR_LEN;
|
|
817
|
+
wasm.ifcapi_setSourceBytes(this.__wbg_ptr, ptr0, len0);
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* Like [`IfcAPI::process_geometry_batch`] but reads the source bytes held by
|
|
821
|
+
* [`IfcAPI::set_source_bytes`] instead of taking `data`. Byte-for-byte
|
|
822
|
+
* identical output — it delegates to the legacy twin with the held slice.
|
|
823
|
+
* @param {Uint32Array} jobs_flat
|
|
824
|
+
* @param {number} unit_scale
|
|
825
|
+
* @param {number} rtc_x
|
|
826
|
+
* @param {number} rtc_y
|
|
827
|
+
* @param {number} rtc_z
|
|
828
|
+
* @param {boolean} needs_shift
|
|
829
|
+
* @param {Uint32Array} void_keys
|
|
830
|
+
* @param {Uint32Array} void_counts
|
|
831
|
+
* @param {Uint32Array} void_values
|
|
832
|
+
* @param {Uint32Array} style_ids
|
|
833
|
+
* @param {Uint8Array} style_colors
|
|
834
|
+
* @param {number | null} [plane_angle_to_radians]
|
|
835
|
+
* @param {Uint32Array | null} [material_element_ids]
|
|
836
|
+
* @param {Uint32Array | null} [material_color_counts]
|
|
837
|
+
* @param {Uint8Array | null} [material_colors_rgba]
|
|
838
|
+
* @returns {MeshCollection}
|
|
839
|
+
*/
|
|
840
|
+
processGeometryBatchFromSource(jobs_flat, unit_scale, rtc_x, rtc_y, rtc_z, needs_shift, void_keys, void_counts, void_values, style_ids, style_colors, plane_angle_to_radians, material_element_ids, material_color_counts, material_colors_rgba) {
|
|
841
|
+
const ptr0 = passArray32ToWasm0(jobs_flat, wasm.__wbindgen_export);
|
|
842
|
+
const len0 = WASM_VECTOR_LEN;
|
|
843
|
+
const ptr1 = passArray32ToWasm0(void_keys, wasm.__wbindgen_export);
|
|
844
|
+
const len1 = WASM_VECTOR_LEN;
|
|
845
|
+
const ptr2 = passArray32ToWasm0(void_counts, wasm.__wbindgen_export);
|
|
846
|
+
const len2 = WASM_VECTOR_LEN;
|
|
847
|
+
const ptr3 = passArray32ToWasm0(void_values, wasm.__wbindgen_export);
|
|
848
|
+
const len3 = WASM_VECTOR_LEN;
|
|
849
|
+
const ptr4 = passArray32ToWasm0(style_ids, wasm.__wbindgen_export);
|
|
850
|
+
const len4 = WASM_VECTOR_LEN;
|
|
851
|
+
const ptr5 = passArray8ToWasm0(style_colors, wasm.__wbindgen_export);
|
|
852
|
+
const len5 = WASM_VECTOR_LEN;
|
|
853
|
+
var ptr6 = isLikeNone(material_element_ids) ? 0 : passArray32ToWasm0(material_element_ids, wasm.__wbindgen_export);
|
|
854
|
+
var len6 = WASM_VECTOR_LEN;
|
|
855
|
+
var ptr7 = isLikeNone(material_color_counts) ? 0 : passArray32ToWasm0(material_color_counts, wasm.__wbindgen_export);
|
|
856
|
+
var len7 = WASM_VECTOR_LEN;
|
|
857
|
+
var ptr8 = isLikeNone(material_colors_rgba) ? 0 : passArray8ToWasm0(material_colors_rgba, wasm.__wbindgen_export);
|
|
858
|
+
var len8 = WASM_VECTOR_LEN;
|
|
859
|
+
const ret = wasm.ifcapi_processGeometryBatchFromSource(this.__wbg_ptr, ptr0, len0, unit_scale, rtc_x, rtc_y, rtc_z, needs_shift, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, !isLikeNone(plane_angle_to_radians), isLikeNone(plane_angle_to_radians) ? 0 : plane_angle_to_radians, ptr6, len6, ptr7, len7, ptr8, len8);
|
|
860
|
+
return MeshCollection.__wrap(ret);
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Like [`IfcAPI::process_geometry_batch_partitioned`] but reads the source
|
|
864
|
+
* bytes held by [`IfcAPI::set_source_bytes`] instead of taking `data`.
|
|
865
|
+
* Byte-for-byte identical output — it delegates to the legacy twin.
|
|
866
|
+
* @param {Uint32Array} jobs_flat
|
|
867
|
+
* @param {number} unit_scale
|
|
868
|
+
* @param {number} rtc_x
|
|
869
|
+
* @param {number} rtc_y
|
|
870
|
+
* @param {number} rtc_z
|
|
871
|
+
* @param {boolean} needs_shift
|
|
872
|
+
* @param {Uint32Array} void_keys
|
|
873
|
+
* @param {Uint32Array} void_counts
|
|
874
|
+
* @param {Uint32Array} void_values
|
|
875
|
+
* @param {Uint32Array} style_ids
|
|
876
|
+
* @param {Uint8Array} style_colors
|
|
877
|
+
* @param {number | null} [plane_angle_to_radians]
|
|
878
|
+
* @param {Uint32Array | null} [material_element_ids]
|
|
879
|
+
* @param {Uint32Array | null} [material_color_counts]
|
|
880
|
+
* @param {Uint8Array | null} [material_colors_rgba]
|
|
881
|
+
* @returns {PartitionedBatch}
|
|
882
|
+
*/
|
|
883
|
+
processGeometryBatchPartitionedFromSource(jobs_flat, unit_scale, rtc_x, rtc_y, rtc_z, needs_shift, void_keys, void_counts, void_values, style_ids, style_colors, plane_angle_to_radians, material_element_ids, material_color_counts, material_colors_rgba) {
|
|
884
|
+
const ptr0 = passArray32ToWasm0(jobs_flat, wasm.__wbindgen_export);
|
|
885
|
+
const len0 = WASM_VECTOR_LEN;
|
|
886
|
+
const ptr1 = passArray32ToWasm0(void_keys, wasm.__wbindgen_export);
|
|
887
|
+
const len1 = WASM_VECTOR_LEN;
|
|
888
|
+
const ptr2 = passArray32ToWasm0(void_counts, wasm.__wbindgen_export);
|
|
889
|
+
const len2 = WASM_VECTOR_LEN;
|
|
890
|
+
const ptr3 = passArray32ToWasm0(void_values, wasm.__wbindgen_export);
|
|
891
|
+
const len3 = WASM_VECTOR_LEN;
|
|
892
|
+
const ptr4 = passArray32ToWasm0(style_ids, wasm.__wbindgen_export);
|
|
893
|
+
const len4 = WASM_VECTOR_LEN;
|
|
894
|
+
const ptr5 = passArray8ToWasm0(style_colors, wasm.__wbindgen_export);
|
|
895
|
+
const len5 = WASM_VECTOR_LEN;
|
|
896
|
+
var ptr6 = isLikeNone(material_element_ids) ? 0 : passArray32ToWasm0(material_element_ids, wasm.__wbindgen_export);
|
|
897
|
+
var len6 = WASM_VECTOR_LEN;
|
|
898
|
+
var ptr7 = isLikeNone(material_color_counts) ? 0 : passArray32ToWasm0(material_color_counts, wasm.__wbindgen_export);
|
|
899
|
+
var len7 = WASM_VECTOR_LEN;
|
|
900
|
+
var ptr8 = isLikeNone(material_colors_rgba) ? 0 : passArray8ToWasm0(material_colors_rgba, wasm.__wbindgen_export);
|
|
901
|
+
var len8 = WASM_VECTOR_LEN;
|
|
902
|
+
const ret = wasm.ifcapi_processGeometryBatchPartitionedFromSource(this.__wbg_ptr, ptr0, len0, unit_scale, rtc_x, rtc_y, rtc_z, needs_shift, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, !isLikeNone(plane_angle_to_radians), isLikeNone(plane_angle_to_radians) ? 0 : plane_angle_to_radians, ptr6, len6, ptr7, len7, ptr8, len8);
|
|
903
|
+
return PartitionedBatch.__wrap(ret);
|
|
904
|
+
}
|
|
798
905
|
/**
|
|
799
906
|
* Process geometry for a subset of pre-scanned entities → flat
|
|
800
907
|
* MeshCollection. Takes raw bytes + pre-pass data from buildPrePassOnce.
|
|
@@ -1410,6 +1517,85 @@ export class IfcAPI {
|
|
|
1410
1517
|
clearPrePassCache() {
|
|
1411
1518
|
wasm.ifcapi_clearPrePassCache(this.__wbg_ptr);
|
|
1412
1519
|
}
|
|
1520
|
+
/**
|
|
1521
|
+
* Install the pre-computed set of `IfcRepresentationMap` ids referenced by
|
|
1522
|
+
* an `IfcMappedItem` (issue #957), so the worker's first type-product batch
|
|
1523
|
+
* SKIPS the per-worker [`Self::get_or_build_referenced_repmaps`] full-file
|
|
1524
|
+
* walk. The streaming pre-pass built the same set once from the
|
|
1525
|
+
* `IfcMappedItem` spans it already scanned (see
|
|
1526
|
+
* `styling::build_referenced_representation_maps_from_spans`) and ships the
|
|
1527
|
+
* id list here — bit-identical to what each worker would compute, since a
|
|
1528
|
+
* set's membership is order-invariant and consumers only call `.contains`.
|
|
1529
|
+
*
|
|
1530
|
+
* Installed AFTER `setEntityIndex` (which clears this cache on content
|
|
1531
|
+
* swap), so the injected value survives. When this setter is never called
|
|
1532
|
+
* (native path, non-streaming callers), the lazy build path is unchanged.
|
|
1533
|
+
* @param {Uint32Array} ids
|
|
1534
|
+
*/
|
|
1535
|
+
setReferencedRepmaps(ids) {
|
|
1536
|
+
const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export);
|
|
1537
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1538
|
+
wasm.ifcapi_setReferencedRepmaps(this.__wbg_ptr, ptr0, len0);
|
|
1539
|
+
}
|
|
1540
|
+
/**
|
|
1541
|
+
* Install the pre-computed #1623 Phase 3 don't-bake plan: the flat list of
|
|
1542
|
+
* `IfcRepresentationMap` ids that an `IfcMappedItem` instantiates >= 2 times.
|
|
1543
|
+
* The streaming pre-pass tallies it in the SAME scan that builds the referenced-
|
|
1544
|
+
* repmap set (`styling::build_mapped_instance_plan_from_spans`) and ships the id
|
|
1545
|
+
* list here. The batch path arms its router with it (batch-local template mode),
|
|
1546
|
+
* so a repeated single-solid mapped source materializes ONCE per batch and the
|
|
1547
|
+
* rest ride as instances in the IFNS shard.
|
|
1548
|
+
*
|
|
1549
|
+
* Same injection contract as [`Self::set_referenced_repmaps`]: installed after
|
|
1550
|
+
* `setEntityIndex` (which clears it on content swap), and a no-op absence leaves
|
|
1551
|
+
* the batch path materializing every occurrence (byte-identical). Each id is
|
|
1552
|
+
* stored as `(2, id)` — the batch-local router only needs the eligibility set
|
|
1553
|
+
* (count >= 2); the min-id template slot is unused in batch-local mode.
|
|
1554
|
+
* @param {Uint32Array} source_ids
|
|
1555
|
+
*/
|
|
1556
|
+
setMappedInstancePlan(source_ids) {
|
|
1557
|
+
const ptr0 = passArray32ToWasm0(source_ids, wasm.__wbindgen_export);
|
|
1558
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1559
|
+
wasm.ifcapi_setMappedInstancePlan(this.__wbg_ptr, ptr0, len0);
|
|
1560
|
+
}
|
|
1561
|
+
/**
|
|
1562
|
+
* Install the pre-computed [`ifc_lite_geometry::MaterialLayerIndex`] (#563)
|
|
1563
|
+
* from its flat SoA encoding, so the worker's first batch skips the
|
|
1564
|
+
* per-worker [`Self::get_or_build_material_layer_index`] full-file decode
|
|
1565
|
+
* scan (the dominant first-batch cost on layered architectural models,
|
|
1566
|
+
* which run this on the DEFAULT view). The streaming pre-pass built the
|
|
1567
|
+
* index once from the `IfcRelAssociatesMaterial` spans it already scanned
|
|
1568
|
+
* (`MaterialLayerIndex::from_spans`) and flat-encoded it here; the flat
|
|
1569
|
+
* encoding round-trips bit-for-bit (proven in `material_layer_index` tests),
|
|
1570
|
+
* so the injected index equals each worker's `from_content` result.
|
|
1571
|
+
*
|
|
1572
|
+
* Same injection contract as [`Self::set_referenced_repmaps`]: installed
|
|
1573
|
+
* after `setEntityIndex`, and a no-op absence leaves the lazy build intact.
|
|
1574
|
+
* @param {Uint32Array} element_ids
|
|
1575
|
+
* @param {Uint32Array} axis
|
|
1576
|
+
* @param {Uint32Array} layer_counts
|
|
1577
|
+
* @param {Float64Array} direction_sense
|
|
1578
|
+
* @param {Float64Array} offset
|
|
1579
|
+
* @param {Uint32Array} layer_material_ids
|
|
1580
|
+
* @param {Float64Array} layer_thicknesses
|
|
1581
|
+
*/
|
|
1582
|
+
setMaterialLayerIndex(element_ids, axis, layer_counts, direction_sense, offset, layer_material_ids, layer_thicknesses) {
|
|
1583
|
+
const ptr0 = passArray32ToWasm0(element_ids, wasm.__wbindgen_export);
|
|
1584
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1585
|
+
const ptr1 = passArray32ToWasm0(axis, wasm.__wbindgen_export);
|
|
1586
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1587
|
+
const ptr2 = passArray32ToWasm0(layer_counts, wasm.__wbindgen_export);
|
|
1588
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1589
|
+
const ptr3 = passArrayF64ToWasm0(direction_sense, wasm.__wbindgen_export);
|
|
1590
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1591
|
+
const ptr4 = passArrayF64ToWasm0(offset, wasm.__wbindgen_export);
|
|
1592
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1593
|
+
const ptr5 = passArray32ToWasm0(layer_material_ids, wasm.__wbindgen_export);
|
|
1594
|
+
const len5 = WASM_VECTOR_LEN;
|
|
1595
|
+
const ptr6 = passArrayF64ToWasm0(layer_thicknesses, wasm.__wbindgen_export);
|
|
1596
|
+
const len6 = WASM_VECTOR_LEN;
|
|
1597
|
+
wasm.ifcapi_setMaterialLayerIndex(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
|
|
1598
|
+
}
|
|
1413
1599
|
/**
|
|
1414
1600
|
* Enable or disable the PARAMETRIC rectangular-opening fast path (the
|
|
1415
1601
|
* placement-frame, ground-truth-exact analytic cut) for `processGeometryBatch`.
|
|
@@ -1457,6 +1643,18 @@ export class IfcAPI {
|
|
|
1457
1643
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1458
1644
|
}
|
|
1459
1645
|
}
|
|
1646
|
+
/**
|
|
1647
|
+
* Install the pre-computed set of type ids that an `IfcRelDefinesByType`
|
|
1648
|
+
* instantiates (#957 follow-up), so the worker's first type-product batch
|
|
1649
|
+
* skips the per-worker [`Self::get_or_build_instantiated_type_ids`]
|
|
1650
|
+
* full-file walk. Same injection contract as [`Self::set_referenced_repmaps`].
|
|
1651
|
+
* @param {Uint32Array} ids
|
|
1652
|
+
*/
|
|
1653
|
+
setInstantiatedTypeIds(ids) {
|
|
1654
|
+
const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export);
|
|
1655
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1656
|
+
wasm.ifcapi_setInstantiatedTypeIds(this.__wbg_ptr, ptr0, len0);
|
|
1657
|
+
}
|
|
1460
1658
|
/**
|
|
1461
1659
|
* Enable or disable per-entity geometry fingerprinting in
|
|
1462
1660
|
* `processGeometryBatch`, used by the viewer's revision-diff feature.
|
package/pkg/ifc-lite_bg.wasm
CHANGED
|
Binary file
|