@ifc-lite/wasm 3.0.15 → 4.0.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": "3.0.15",
8
+ "version": "4.0.0",
9
9
  "license": "MPL-2.0",
10
10
  "repository": {
11
11
  "type": "git",
package/pkg/ifc-lite.d.ts CHANGED
@@ -155,6 +155,61 @@ export class IfcAPI {
155
155
  * ```
156
156
  */
157
157
  exportObj(content: Uint8Array, include_normals: boolean, hidden: Uint32Array, isolated: Uint32Array): Uint8Array;
158
+ /**
159
+ * Sharded pre-pass: merge the shard-resolved styled-item columns with the
160
+ * SUPPORT spans (extracted host-side from the shard classes) and run the
161
+ * CANONICAL styles flatten. Returns the exact `styles` event payload the
162
+ * serial path emits. Runs on any worker with `setEntityIndex` installed.
163
+ * Span arguments are `[id, start, len]` triples; `plane_angle_to_radians`
164
+ * comes from the meta event.
165
+ */
166
+ finalizePrepassStyles(data: Uint8Array, orphan_ids: Uint32Array, orphan_colors: Float32Array, geom_ids: Uint32Array, geom_colors: Float32Array, colour_map_spans: Uint32Array, material_def_spans: Uint32Array, rel_material_spans: Uint32Array, void_spans: Uint32Array, fills_spans: Uint32Array, aggregate_spans: Uint32Array, plane_angle_to_radians: number): any;
167
+ /**
168
+ * SPIKE (sharded pre-pass): scan the entity index over a single byte range.
169
+ *
170
+ * Each idle browser geometry worker calls this on its `[range_start,
171
+ * range_end)` shard; the main thread stitches the returned columns into the
172
+ * full entity index (byte-identical to the single-threaded
173
+ * `build_entity_index`) by binary-searching each shard for the previous
174
+ * shard's `handoff`. Delegates to `ifc_lite_processing::scan_shard`, the
175
+ * exact per-chunk primitive the native `build_entity_index_parallel` fans
176
+ * across cores — so the sharded merge cannot drift from the serial builder.
177
+ *
178
+ * Byte offsets returned are GLOBAL (relative to file start), so shards
179
+ * concatenate without rewriting. Returns a plain object:
180
+ * `{ ids: Uint32Array, starts: Uint32Array, lengths: Uint32Array,
181
+ * handoff: number }`
182
+ * where `handoff` is the global start of the first entity at/after
183
+ * `range_end` (the next shard's first real entity), or `-1` at EOF.
184
+ */
185
+ scanEntityIndexShard(data: Uint8Array, range_start: number, range_end: number): any;
186
+ /**
187
+ * Sharded pre-pass: resolve ONE contiguous (file-ordered) slice of the
188
+ * styled-item span list on this worker, against the entity index installed
189
+ * by `setEntityIndex`. Returns raw resolved maps as flat columns:
190
+ * `{ orphanIds, orphanColors (f32 rgba per id), geomIds, geomColors }`.
191
+ * The host merges shard results IN SHARD ORDER with first-wins per
192
+ * geometry id, reproducing the serial resolver's file-order precedence,
193
+ * then hands the merged columns to `finalizePrepassStyles`.
194
+ * `spans` is `[id, start, len]` triples.
195
+ */
196
+ resolveStyledItemsShard(data: Uint8Array, spans: Uint32Array): any;
197
+ /**
198
+ * Sharded pre-pass variant: same scan/discovery/jobs/columns pipeline as
199
+ * `buildPrePassStreaming`, but
200
+ * 1. the entity index is PREBUILT from the host's stitched shard columns
201
+ * (file order; see `scanEntityIndexShard`) — the scan skips its inline
202
+ * index build, the meta RTC ladder resolves against the FULL index
203
+ * (no partial-ladder full-rescan detour), and the post-scan
204
+ * `entity-index` event is skipped (the host already delivered it), and
205
+ * 2. styles resolution is EXTERNAL: the styled-item spans are resolved as
206
+ * shard slices on the geometry workers (`resolveStyledItemsShard`);
207
+ * this call stashes the SUPPORT spans + plane-angle scale, and the
208
+ * follow-up `finalizePrepassStyles` merges + flattens into the exact
209
+ * styles payload the serial path emits. NO `styles` event is emitted
210
+ * here.
211
+ */
212
+ buildPrePassStreamingSharded(data: Uint8Array, on_event: Function, chunk_size: number, disabled_type_names: string[] | null | undefined, skip_type_geometry: boolean, index_ids: Uint32Array, index_starts: Uint32Array, index_lengths: Uint32Array, index_classes: Uint8Array): any;
158
213
  /**
159
214
  * Store the whole IFC source file ONCE per load so the `*FromSource` batch
160
215
  * variants can read it from the wasm heap instead of re-copying it per call.
@@ -1239,6 +1294,7 @@ export interface InitOutput {
1239
1294
  readonly gridaxisjs_tag: (a: number, b: number) => void;
1240
1295
  readonly ifcapi_buildPrePassOnce: (a: number, b: number, c: number) => number;
1241
1296
  readonly ifcapi_buildPrePassStreaming: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
1297
+ readonly ifcapi_buildPrePassStreamingSharded: (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) => void;
1242
1298
  readonly ifcapi_clearPrePassCache: (a: number) => void;
1243
1299
  readonly ifcapi_diagnoseGeometry: (a: number, b: number, c: number) => number;
1244
1300
  readonly ifcapi_exportCsv: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
@@ -1254,6 +1310,7 @@ export interface InitOutput {
1254
1310
  readonly ifcapi_exportObj: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
1255
1311
  readonly ifcapi_exportStep: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
1256
1312
  readonly ifcapi_extractProfiles: (a: number, b: number, c: number, d: number) => number;
1313
+ readonly ifcapi_finalizePrepassStyles: (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) => void;
1257
1314
  readonly ifcapi_getMemory: (a: number) => number;
1258
1315
  readonly ifcapi_getPipelineDiagnostics: (a: number) => number;
1259
1316
  readonly ifcapi_is_ready: (a: number) => number;
@@ -1267,8 +1324,10 @@ export interface InitOutput {
1267
1324
  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;
1268
1325
  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;
1269
1326
  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;
1327
+ readonly ifcapi_resolveStyledItemsShard: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
1270
1328
  readonly ifcapi_scanEntitiesFast: (a: number, b: number, c: number) => number;
1271
1329
  readonly ifcapi_scanEntitiesFastBytes: (a: number, b: number, c: number) => number;
1330
+ readonly ifcapi_scanEntityIndexShard: (a: number, b: number, c: number, d: number, e: number) => number;
1272
1331
  readonly ifcapi_scanGeometryEntitiesFast: (a: number, b: number, c: number) => number;
1273
1332
  readonly ifcapi_setComputeGeometryHashes: (a: number, b: number, c: number) => void;
1274
1333
  readonly ifcapi_setEntityIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
package/pkg/ifc-lite.js CHANGED
@@ -869,6 +869,177 @@ export class IfcAPI {
869
869
  wasm.__wbindgen_add_to_stack_pointer(16);
870
870
  }
871
871
  }
872
+ /**
873
+ * Sharded pre-pass: merge the shard-resolved styled-item columns with the
874
+ * SUPPORT spans (extracted host-side from the shard classes) and run the
875
+ * CANONICAL styles flatten. Returns the exact `styles` event payload the
876
+ * serial path emits. Runs on any worker with `setEntityIndex` installed.
877
+ * Span arguments are `[id, start, len]` triples; `plane_angle_to_radians`
878
+ * comes from the meta event.
879
+ * @param {Uint8Array} data
880
+ * @param {Uint32Array} orphan_ids
881
+ * @param {Float32Array} orphan_colors
882
+ * @param {Uint32Array} geom_ids
883
+ * @param {Float32Array} geom_colors
884
+ * @param {Uint32Array} colour_map_spans
885
+ * @param {Uint32Array} material_def_spans
886
+ * @param {Uint32Array} rel_material_spans
887
+ * @param {Uint32Array} void_spans
888
+ * @param {Uint32Array} fills_spans
889
+ * @param {Uint32Array} aggregate_spans
890
+ * @param {number} plane_angle_to_radians
891
+ * @returns {any}
892
+ */
893
+ finalizePrepassStyles(data, orphan_ids, orphan_colors, geom_ids, geom_colors, colour_map_spans, material_def_spans, rel_material_spans, void_spans, fills_spans, aggregate_spans, plane_angle_to_radians) {
894
+ try {
895
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
896
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
897
+ const len0 = WASM_VECTOR_LEN;
898
+ const ptr1 = passArray32ToWasm0(orphan_ids, wasm.__wbindgen_export);
899
+ const len1 = WASM_VECTOR_LEN;
900
+ const ptr2 = passArrayF32ToWasm0(orphan_colors, wasm.__wbindgen_export);
901
+ const len2 = WASM_VECTOR_LEN;
902
+ const ptr3 = passArray32ToWasm0(geom_ids, wasm.__wbindgen_export);
903
+ const len3 = WASM_VECTOR_LEN;
904
+ const ptr4 = passArrayF32ToWasm0(geom_colors, wasm.__wbindgen_export);
905
+ const len4 = WASM_VECTOR_LEN;
906
+ const ptr5 = passArray32ToWasm0(colour_map_spans, wasm.__wbindgen_export);
907
+ const len5 = WASM_VECTOR_LEN;
908
+ const ptr6 = passArray32ToWasm0(material_def_spans, wasm.__wbindgen_export);
909
+ const len6 = WASM_VECTOR_LEN;
910
+ const ptr7 = passArray32ToWasm0(rel_material_spans, wasm.__wbindgen_export);
911
+ const len7 = WASM_VECTOR_LEN;
912
+ const ptr8 = passArray32ToWasm0(void_spans, wasm.__wbindgen_export);
913
+ const len8 = WASM_VECTOR_LEN;
914
+ const ptr9 = passArray32ToWasm0(fills_spans, wasm.__wbindgen_export);
915
+ const len9 = WASM_VECTOR_LEN;
916
+ const ptr10 = passArray32ToWasm0(aggregate_spans, wasm.__wbindgen_export);
917
+ const len10 = WASM_VECTOR_LEN;
918
+ wasm.ifcapi_finalizePrepassStyles(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, ptr8, len8, ptr9, len9, ptr10, len10, plane_angle_to_radians);
919
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
920
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
921
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
922
+ if (r2) {
923
+ throw takeObject(r1);
924
+ }
925
+ return takeObject(r0);
926
+ } finally {
927
+ wasm.__wbindgen_add_to_stack_pointer(16);
928
+ }
929
+ }
930
+ /**
931
+ * SPIKE (sharded pre-pass): scan the entity index over a single byte range.
932
+ *
933
+ * Each idle browser geometry worker calls this on its `[range_start,
934
+ * range_end)` shard; the main thread stitches the returned columns into the
935
+ * full entity index (byte-identical to the single-threaded
936
+ * `build_entity_index`) by binary-searching each shard for the previous
937
+ * shard's `handoff`. Delegates to `ifc_lite_processing::scan_shard`, the
938
+ * exact per-chunk primitive the native `build_entity_index_parallel` fans
939
+ * across cores — so the sharded merge cannot drift from the serial builder.
940
+ *
941
+ * Byte offsets returned are GLOBAL (relative to file start), so shards
942
+ * concatenate without rewriting. Returns a plain object:
943
+ * `{ ids: Uint32Array, starts: Uint32Array, lengths: Uint32Array,
944
+ * handoff: number }`
945
+ * where `handoff` is the global start of the first entity at/after
946
+ * `range_end` (the next shard's first real entity), or `-1` at EOF.
947
+ * @param {Uint8Array} data
948
+ * @param {number} range_start
949
+ * @param {number} range_end
950
+ * @returns {any}
951
+ */
952
+ scanEntityIndexShard(data, range_start, range_end) {
953
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
954
+ const len0 = WASM_VECTOR_LEN;
955
+ const ret = wasm.ifcapi_scanEntityIndexShard(this.__wbg_ptr, ptr0, len0, range_start, range_end);
956
+ return takeObject(ret);
957
+ }
958
+ /**
959
+ * Sharded pre-pass: resolve ONE contiguous (file-ordered) slice of the
960
+ * styled-item span list on this worker, against the entity index installed
961
+ * by `setEntityIndex`. Returns raw resolved maps as flat columns:
962
+ * `{ orphanIds, orphanColors (f32 rgba per id), geomIds, geomColors }`.
963
+ * The host merges shard results IN SHARD ORDER with first-wins per
964
+ * geometry id, reproducing the serial resolver's file-order precedence,
965
+ * then hands the merged columns to `finalizePrepassStyles`.
966
+ * `spans` is `[id, start, len]` triples.
967
+ * @param {Uint8Array} data
968
+ * @param {Uint32Array} spans
969
+ * @returns {any}
970
+ */
971
+ resolveStyledItemsShard(data, spans) {
972
+ try {
973
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
974
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
975
+ const len0 = WASM_VECTOR_LEN;
976
+ const ptr1 = passArray32ToWasm0(spans, wasm.__wbindgen_export);
977
+ const len1 = WASM_VECTOR_LEN;
978
+ wasm.ifcapi_resolveStyledItemsShard(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
979
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
980
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
981
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
982
+ if (r2) {
983
+ throw takeObject(r1);
984
+ }
985
+ return takeObject(r0);
986
+ } finally {
987
+ wasm.__wbindgen_add_to_stack_pointer(16);
988
+ }
989
+ }
990
+ /**
991
+ * Sharded pre-pass variant: same scan/discovery/jobs/columns pipeline as
992
+ * `buildPrePassStreaming`, but
993
+ * 1. the entity index is PREBUILT from the host's stitched shard columns
994
+ * (file order; see `scanEntityIndexShard`) — the scan skips its inline
995
+ * index build, the meta RTC ladder resolves against the FULL index
996
+ * (no partial-ladder full-rescan detour), and the post-scan
997
+ * `entity-index` event is skipped (the host already delivered it), and
998
+ * 2. styles resolution is EXTERNAL: the styled-item spans are resolved as
999
+ * shard slices on the geometry workers (`resolveStyledItemsShard`);
1000
+ * this call stashes the SUPPORT spans + plane-angle scale, and the
1001
+ * follow-up `finalizePrepassStyles` merges + flattens into the exact
1002
+ * styles payload the serial path emits. NO `styles` event is emitted
1003
+ * here.
1004
+ * @param {Uint8Array} data
1005
+ * @param {Function} on_event
1006
+ * @param {number} chunk_size
1007
+ * @param {string[] | null | undefined} disabled_type_names
1008
+ * @param {boolean} skip_type_geometry
1009
+ * @param {Uint32Array} index_ids
1010
+ * @param {Uint32Array} index_starts
1011
+ * @param {Uint32Array} index_lengths
1012
+ * @param {Uint8Array} index_classes
1013
+ * @returns {any}
1014
+ */
1015
+ buildPrePassStreamingSharded(data, on_event, chunk_size, disabled_type_names, skip_type_geometry, index_ids, index_starts, index_lengths, index_classes) {
1016
+ try {
1017
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1018
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
1019
+ const len0 = WASM_VECTOR_LEN;
1020
+ var ptr1 = isLikeNone(disabled_type_names) ? 0 : passArrayJsValueToWasm0(disabled_type_names, wasm.__wbindgen_export);
1021
+ var len1 = WASM_VECTOR_LEN;
1022
+ const ptr2 = passArray32ToWasm0(index_ids, wasm.__wbindgen_export);
1023
+ const len2 = WASM_VECTOR_LEN;
1024
+ const ptr3 = passArray32ToWasm0(index_starts, wasm.__wbindgen_export);
1025
+ const len3 = WASM_VECTOR_LEN;
1026
+ const ptr4 = passArray32ToWasm0(index_lengths, wasm.__wbindgen_export);
1027
+ const len4 = WASM_VECTOR_LEN;
1028
+ const ptr5 = passArray8ToWasm0(index_classes, wasm.__wbindgen_export);
1029
+ const len5 = WASM_VECTOR_LEN;
1030
+ wasm.ifcapi_buildPrePassStreamingSharded(retptr, this.__wbg_ptr, ptr0, len0, addBorrowedObject(on_event), chunk_size, ptr1, len1, skip_type_geometry, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
1031
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1032
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1033
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1034
+ if (r2) {
1035
+ throw takeObject(r1);
1036
+ }
1037
+ return takeObject(r0);
1038
+ } finally {
1039
+ wasm.__wbindgen_add_to_stack_pointer(16);
1040
+ heap[stack_pointer++] = undefined;
1041
+ }
1042
+ }
872
1043
  /**
873
1044
  * Store the whole IFC source file ONCE per load so the `*FromSource` batch
874
1045
  * variants can read it from the wasm heap instead of re-copying it per call.
@@ -3934,6 +4105,10 @@ function __wbg_get_imports() {
3934
4105
  const ret = new Float64Array(arg0 >>> 0);
3935
4106
  return addHeapObject(ret);
3936
4107
  };
4108
+ imports.wbg.__wbg_new_with_length_95ba657dfb7d3dfb = function(arg0) {
4109
+ const ret = new Float32Array(arg0 >>> 0);
4110
+ return addHeapObject(ret);
4111
+ };
3937
4112
  imports.wbg.__wbg_now_69d776cd24f5215b = function() {
3938
4113
  const ret = Date.now();
3939
4114
  return ret;
@@ -3951,6 +4126,9 @@ function __wbg_get_imports() {
3951
4126
  imports.wbg.__wbg_set_index_021489b2916af13e = function(arg0, arg1, arg2) {
3952
4127
  getObject(arg0)[arg1 >>> 0] = arg2;
3953
4128
  };
4129
+ imports.wbg.__wbg_set_index_165b46b0114d368c = function(arg0, arg1, arg2) {
4130
+ getObject(arg0)[arg1 >>> 0] = arg2;
4131
+ };
3954
4132
  imports.wbg.__wbg_set_index_42abe35f117e614e = function(arg0, arg1, arg2) {
3955
4133
  getObject(arg0)[arg1 >>> 0] = arg2 >>> 0;
3956
4134
  };
Binary file