@ifc-lite/wasm 10.1.2 → 10.2.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/README.md CHANGED
@@ -33,6 +33,23 @@ console.log(`Entities: ${refs.length}`);
33
33
  api.free(); // free the API instance
34
34
  ```
35
35
 
36
+ `api.extrusionDefinitions(bytes, ids)` returns exact authored
37
+ `IfcExtrudedAreaSolid` sources and placed product occurrences without decoding
38
+ meshes. Omit `ids` for all products, pass `new Uint32Array()` for none, or
39
+ selected product STEP IDs for a filtered view. Repeated mapping targets share a source key while each
40
+ occurrence retains its f64 `world_from_source` matrix and deterministic ordinal.
41
+ Complete sources with valid positive net profile area have
42
+ `nominal_quantities` in raw squared/cubed IFC file units; unsupported or
43
+ invalid sources have `null`.
44
+ For a complete source-profile point, apply `profile_position`, then
45
+ `position_matrix`, then `world_from_source`; the last matrix includes file-unit
46
+ conversion and maps to absolute IFC Z-up metres. An absent optional `Position`
47
+ leaves its matrix field `null`, so use identity for that step when composing
48
+ rather than expecting an identity array. Check `status` before interpreting a
49
+ null matrix; unsupported sources and bounded output are reported by `status`
50
+ and `diagnostics`. CSG operands carry
51
+ `source_modified=true` because their final body can differ.
52
+
36
53
  ## Meshes (pre-pass + job batches)
37
54
 
38
55
  Geometry runs as a single pre-pass (one scan that produces a flat job list
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": "10.1.2",
8
+ "version": "10.2.0",
9
9
  "license": "MPL-2.0",
10
10
  "repository": {
11
11
  "type": "git",
package/pkg/ifc-lite.d.ts CHANGED
@@ -132,6 +132,56 @@ export interface LandXmlPipeJs { source_id: string; source_path: string; name: s
132
132
 
133
133
 
134
134
 
135
+ export type AnalyticStatusJs = { type: "complete" } | { type: "unsupported"; reason: string };
136
+ export type AnalyticSourceContextJs =
137
+ | { kind: "direct"; representation_id: number }
138
+ | { kind: "mapped"; representation_map_path: number[] };
139
+ export interface AnalyticSourceKeyJs {
140
+ model_sha256: string; schema: string | null; length_unit_scale_bits: string;
141
+ context: AnalyticSourceContextJs; solid_id: number;
142
+ }
143
+ export type AnalyticCurveSegmentJs =
144
+ | { type: "line"; start: number[]; end: number[] }
145
+ | { type: "arc"; center: number[]; normal: number[]; x_axis: number[];
146
+ radius: number; start_angle: number; sweep_angle: number };
147
+ export interface AnalyticProfileLoopJs {
148
+ kind: "outer" | "inner"; segments: AnalyticCurveSegmentJs[];
149
+ signed_area: number; perimeter: number;
150
+ }
151
+ export interface AnalyticProfileJs {
152
+ profile_id: number; ifc_type_name: string; ProfileType: string | null;
153
+ Position: number | null; profile_position: number[] | null;
154
+ loops: AnalyticProfileLoopJs[]; status: AnalyticStatusJs;
155
+ }
156
+ export interface AnalyticExtrusionJs {
157
+ solid_id: number; SweptArea: number | null; profile: AnalyticProfileJs | null;
158
+ Position: number | null; position_matrix: number[] | null;
159
+ ExtrudedDirection: number | null; DirectionRatios: number[] | null;
160
+ axis_unit_vector: number[] | null; Depth: number | null; status: AnalyticStatusJs;
161
+ }
162
+ export interface ExtrusionNominalQuantitiesJs {
163
+ profile_area: number; projected_height: number; nominal_volume: number;
164
+ }
165
+ export interface ExtrusionDefinitionJs {
166
+ key: AnalyticSourceKeyJs; source: AnalyticExtrusionJs;
167
+ /** Squared/cubed IFC file-length units; null for unsupported or invalid sources. */
168
+ nominal_quantities: ExtrusionNominalQuantitiesJs | null;
169
+ }
170
+ export interface ExtrusionInstanceJs {
171
+ ordinal: number; source: AnalyticSourceKeyJs; product_id: number;
172
+ solid_id: number; mapping_path: number[]; source_modified: boolean;
173
+ world_from_source: number[] | null; status: AnalyticStatusJs;
174
+ }
175
+ export interface ExtrusionDefinitionsJs {
176
+ up_axis: "Z"; source_units: "ifc_file_length_units"; world_units: "m";
177
+ coordinate_space: "absolute_ifc_world"; model_sha256: string;
178
+ schema: string | null; length_unit_scale: number;
179
+ sources: ExtrusionDefinitionJs[];
180
+ instances: Record<number, ExtrusionInstanceJs[]>; diagnostics: string[];
181
+ }
182
+
183
+
184
+
135
185
  /**
136
186
  * The overlap solid of one clashing pair, or the reason there is none.
137
187
  */
@@ -684,8 +734,13 @@ export class IfcAPI {
684
734
  * when a filter matched nothing (#4659, the STEP twin of #4483/#4484). When
685
735
  * set, the forward `#`-reference closure is added so the subset never dangles
686
736
  * a reference.
687
- * `mutations_json` carries `MutablePropertyView` edits (attribute updates +
688
- * property-set synthesis); empty ⇒ none. See `export_step_json` for the shape.
737
+ * `mutations_json` carries `MutablePropertyView` edits; empty ⇒ none. It is
738
+ * either the mutation log `MutablePropertyView.exportMutations()` returns
739
+ * (an object with a `mutations` array, optionally `newEntities` and
740
+ * `georefMutations`), written with byte parity to the TypeScript
741
+ * `StepExporter` (#5941), or the older pre-serialized
742
+ * `{ attributeUpdates, propertyMutations }` shape. A log does not combine
743
+ * with `included`. See `export_step_json` for both shapes.
689
744
  * A non-empty but malformed `mutations_json` throws rather than silently
690
745
  * exporting the model with none of the caller's edits applied — mirrors
691
746
  * `exportGlb`'s and `exportMerged`'s fail-closed contract on this same API.
@@ -720,6 +775,22 @@ export class IfcAPI {
720
775
  * ```
721
776
  */
722
777
  extractProfiles(content: string, model_index: number): ProfileCollection;
778
+ /**
779
+ * Return authored swept-disk occurrences, including exact line/arc
780
+ * directrices and derived measurements, in absolute IFC Z-up metres.
781
+ * `ids` contains product STEP IDs; omit it for all products or pass an
782
+ * empty `Uint32Array` for none. Unsupported records keep their status and
783
+ * a null `directrix_metrics`; malformed representation walks report a
784
+ * diagnostic and omit that product atomically.
785
+ */
786
+ extractSweptDiskDescriptions(content: Uint8Array, ids?: Uint32Array | null): any;
787
+ /**
788
+ * `ids` is an optional product STEP-ID filter; `None` selects all and
789
+ * `Some([])` selects no products, matching the Rust and Python APIs.
790
+ * Matrices are column-major f64; profile_position and position_matrix are
791
+ * applied before world_from_source. No mesh is decoded on this path.
792
+ */
793
+ extrusionDefinitions(content: Uint8Array, ids?: Uint32Array | null): ExtrusionDefinitionsJs;
723
794
  /**
724
795
  * Sharded pre-pass: merge the shard-resolved styled-item columns with the
725
796
  * SUPPORT spans (extracted host-side from the shard classes) and run the
@@ -728,7 +799,9 @@ export class IfcAPI {
728
799
  * Span arguments are `[id, start, len]` triples; `plane_angle_to_radians`
729
800
  * comes from the meta event. `orphanColors` / `geomColors` carry exactly
730
801
  * four floats per id in `orphanIds` / `geomIds`; any other length throws
731
- * before either column is read.
802
+ * before either column is read. The payload's `styleFinishes` come from
803
+ * the geometry finishes a preceding `setPrepassGeometryFinishes` stashed
804
+ * (consumed here); without that call they are all NaN.
732
805
  */
733
806
  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;
734
807
  /**
@@ -970,7 +1043,10 @@ export class IfcAPI {
970
1043
  * Sharded pre-pass: resolve ONE contiguous (file-ordered) slice of the
971
1044
  * styled-item span list on this worker, against the entity index installed
972
1045
  * by `setEntityIndex`. Returns raw resolved maps as flat columns:
973
- * `{ orphanIds, orphanColors (f32 rgba per id), geomIds, geomColors }`.
1046
+ * `{ orphanIds, orphanColors (f32 rgba per id), geomIds, geomColors,
1047
+ * geomFinishes }`, where `geomFinishes` is the #5582 `[metallic,
1048
+ * roughness]` pair per `geomIds` entry (NaN when unauthored), from
1049
+ * `resolve_geometry_finishes` over this slice.
974
1050
  * The host merges shard results IN SHARD ORDER with first-wins per
975
1051
  * geometry id, reproducing the serial resolver's file-order precedence,
976
1052
  * then hands the merged columns to `finalizePrepassStyles`.
@@ -1138,6 +1214,15 @@ export class IfcAPI {
1138
1214
  * Default is `false`. Pass `true` before calling `processGeometryBatch`.
1139
1215
  */
1140
1216
  setMergeLayers(enabled: boolean): void;
1217
+ /**
1218
+ * Sharded pre-pass (#5582): stash the shard-merged geometry finishes —
1219
+ * the `geomFinishes` columns `resolveStyledItemsShard` returns, merged
1220
+ * first-wins like `geomColors` — for the next `finalizePrepassStyles` /
1221
+ * `finalizePrepassStylesFromSource` call on this instance, which consumes
1222
+ * them and emits the aligned `styleFinishes`. Without this call that
1223
+ * finalize emits NaN finishes, as it always emitted colours only.
1224
+ */
1225
+ setPrepassGeometryFinishes(geom_ids: Uint32Array, geom_finishes: Float32Array): void;
1141
1226
  /**
1142
1227
  * Enable or disable the PARAMETRIC rectangular-opening fast path (the
1143
1228
  * placement-frame, ground-truth-exact analytic cut) for `processGeometryBatch`.
@@ -1193,6 +1278,22 @@ export class IfcAPI {
1193
1278
  * single JS→wasm copy directly; we wrap it in `Arc` with no second copy.
1194
1279
  */
1195
1280
  setSourceBytes(data: Uint8Array): void;
1281
+ /**
1282
+ * Install the prepass's authored metallic/roughness per style (#5582):
1283
+ * `styleFinishes` carries two floats per `styleIds` entry,
1284
+ * `[metallic, roughness]`, NaN for an unauthored field — the
1285
+ * `styleFinishes` array every prepass result carries beside `styleColors`.
1286
+ * Call it with the same `styleIds` later passed to `processGeometryBatch*`;
1287
+ * finishes set for a different style wire are ignored. Empty arrays clear
1288
+ * them. Malformed lengths never throw: a style without a complete pair
1289
+ * simply gets no finish.
1290
+ *
1291
+ * The batch stamps each returned `MeshDataJs` (`metallic` / `roughness`)
1292
+ * from these, taking each mesh's finish from the style its colour came
1293
+ * from (#5984). Occurrences that ride the instanced (IFNS) shard carry
1294
+ * theirs in the shard's per-instance finish field (v3).
1295
+ */
1296
+ setStyleFinishes(style_ids: Uint32Array, style_finishes: Float32Array): void;
1196
1297
  /**
1197
1298
  * Select the tessellation detail level applied by every subsequent
1198
1299
  * `processGeometryBatch` call (issue #976, step 4).
@@ -1492,6 +1593,10 @@ export class MeshDataJs {
1492
1593
  * `IfcMaterial` layer sliced, or `undefined` (#3199).
1493
1594
  */
1494
1595
  readonly materialId: number | undefined;
1596
+ /**
1597
+ * IFC-authored metallic/roughness (#5582). `undefined` when unauthored.
1598
+ */
1599
+ readonly metallic: number | undefined;
1495
1600
  /**
1496
1601
  * Get normals as Float32Array (copy to JS)
1497
1602
  */
@@ -1506,6 +1611,7 @@ export class MeshDataJs {
1506
1611
  * Get positions as Float32Array (copy to JS)
1507
1612
  */
1508
1613
  readonly positions: Float32Array;
1614
+ readonly roughness: number | undefined;
1509
1615
  /**
1510
1616
  * Optional SurfaceColour for the "Shading" GLB-export choice — only
1511
1617
  * present when the file authored a distinct DiffuseColour. JS sees
@@ -2383,6 +2489,8 @@ export interface InitOutput {
2383
2489
  readonly ifcapi_exportStep: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
2384
2490
  readonly ifcapi_exportUsd: (a: number, b: number, c: number, d: number) => void;
2385
2491
  readonly ifcapi_extractProfiles: (a: number, b: number, c: number, d: number) => number;
2492
+ readonly ifcapi_extractSweptDiskDescriptions: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
2493
+ readonly ifcapi_extrusionDefinitions: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
2386
2494
  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;
2387
2495
  readonly ifcapi_finalizePrepassStylesFromSource: (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) => void;
2388
2496
  readonly ifcapi_getMemory: (a: number) => number;
@@ -2430,10 +2538,12 @@ export interface InitOutput {
2430
2538
  readonly ifcapi_setMappedInstancePlan: (a: number, b: number, c: number) => void;
2431
2539
  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;
2432
2540
  readonly ifcapi_setMergeLayers: (a: number, b: number) => void;
2541
+ readonly ifcapi_setPrepassGeometryFinishes: (a: number, b: number, c: number, d: number, e: number) => void;
2433
2542
  readonly ifcapi_setRectParamFastPath: (a: number, b: number) => void;
2434
2543
  readonly ifcapi_setReferencedRepmaps: (a: number, b: number, c: number) => void;
2435
2544
  readonly ifcapi_setSkipSmallCuts: (a: number, b: number) => void;
2436
2545
  readonly ifcapi_setSourceBytes: (a: number, b: number, c: number) => void;
2546
+ readonly ifcapi_setStyleFinishes: (a: number, b: number, c: number, d: number, e: number) => void;
2437
2547
  readonly ifcapi_setTessellationQuality: (a: number, b: number, c: number, d: number) => void;
2438
2548
  readonly ifcapi_simplifyMeshes: (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) => void;
2439
2549
  readonly ifcapi_version: (a: number, b: number) => void;
@@ -2475,9 +2585,11 @@ export interface InitOutput {
2475
2585
  readonly meshdatajs_localBounds: (a: number, b: number) => void;
2476
2586
  readonly meshdatajs_localToWorld: (a: number, b: number) => void;
2477
2587
  readonly meshdatajs_materialId: (a: number) => number;
2588
+ readonly meshdatajs_metallic: (a: number) => number;
2478
2589
  readonly meshdatajs_normals: (a: number) => number;
2479
2590
  readonly meshdatajs_origin: (a: number) => number;
2480
2591
  readonly meshdatajs_positions: (a: number) => number;
2592
+ readonly meshdatajs_roughness: (a: number) => number;
2481
2593
  readonly meshdatajs_shadingColor: (a: number, b: number) => void;
2482
2594
  readonly meshdatajs_textureHeight: (a: number) => number;
2483
2595
  readonly meshdatajs_textureId: (a: number) => number;
package/pkg/ifc-lite.js CHANGED
@@ -1475,8 +1475,13 @@ export class IfcAPI {
1475
1475
  * when a filter matched nothing (#4659, the STEP twin of #4483/#4484). When
1476
1476
  * set, the forward `#`-reference closure is added so the subset never dangles
1477
1477
  * a reference.
1478
- * `mutations_json` carries `MutablePropertyView` edits (attribute updates +
1479
- * property-set synthesis); empty ⇒ none. See `export_step_json` for the shape.
1478
+ * `mutations_json` carries `MutablePropertyView` edits; empty ⇒ none. It is
1479
+ * either the mutation log `MutablePropertyView.exportMutations()` returns
1480
+ * (an object with a `mutations` array, optionally `newEntities` and
1481
+ * `georefMutations`), written with byte parity to the TypeScript
1482
+ * `StepExporter` (#5941), or the older pre-serialized
1483
+ * `{ attributeUpdates, propertyMutations }` shape. A log does not combine
1484
+ * with `included`. See `export_step_json` for both shapes.
1480
1485
  * A non-empty but malformed `mutations_json` throws rather than silently
1481
1486
  * exporting the model with none of the caller's edits applied — mirrors
1482
1487
  * `exportGlb`'s and `exportMerged`'s fail-closed contract on this same API.
@@ -1500,6 +1505,11 @@ export class IfcAPI {
1500
1505
  wasm.ifcapi_exportStep(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
1501
1506
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1502
1507
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1508
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1509
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1510
+ if (r3) {
1511
+ throw takeObject(r2);
1512
+ }
1503
1513
  var v5 = getArrayU8FromWasm0(r0, r1).slice();
1504
1514
  wasm.__wbindgen_export4(r0, r1 * 1, 1);
1505
1515
  return v5;
@@ -1560,6 +1570,64 @@ export class IfcAPI {
1560
1570
  const ret = wasm.ifcapi_extractProfiles(this.__wbg_ptr, ptr0, len0, model_index);
1561
1571
  return ProfileCollection.__wrap(ret);
1562
1572
  }
1573
+ /**
1574
+ * Return authored swept-disk occurrences, including exact line/arc
1575
+ * directrices and derived measurements, in absolute IFC Z-up metres.
1576
+ * `ids` contains product STEP IDs; omit it for all products or pass an
1577
+ * empty `Uint32Array` for none. Unsupported records keep their status and
1578
+ * a null `directrix_metrics`; malformed representation walks report a
1579
+ * diagnostic and omit that product atomically.
1580
+ * @param {Uint8Array} content
1581
+ * @param {Uint32Array | null} [ids]
1582
+ * @returns {any}
1583
+ */
1584
+ extractSweptDiskDescriptions(content, ids) {
1585
+ try {
1586
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1587
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
1588
+ const len0 = WASM_VECTOR_LEN;
1589
+ var ptr1 = isLikeNone(ids) ? 0 : passArray32ToWasm0(ids, wasm.__wbindgen_export);
1590
+ var len1 = WASM_VECTOR_LEN;
1591
+ wasm.ifcapi_extractSweptDiskDescriptions(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
1592
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1593
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1594
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1595
+ if (r2) {
1596
+ throw takeObject(r1);
1597
+ }
1598
+ return takeObject(r0);
1599
+ } finally {
1600
+ wasm.__wbindgen_add_to_stack_pointer(16);
1601
+ }
1602
+ }
1603
+ /**
1604
+ * `ids` is an optional product STEP-ID filter; `None` selects all and
1605
+ * `Some([])` selects no products, matching the Rust and Python APIs.
1606
+ * Matrices are column-major f64; profile_position and position_matrix are
1607
+ * applied before world_from_source. No mesh is decoded on this path.
1608
+ * @param {Uint8Array} content
1609
+ * @param {Uint32Array | null} [ids]
1610
+ * @returns {ExtrusionDefinitionsJs}
1611
+ */
1612
+ extrusionDefinitions(content, ids) {
1613
+ try {
1614
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1615
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
1616
+ const len0 = WASM_VECTOR_LEN;
1617
+ var ptr1 = isLikeNone(ids) ? 0 : passArray32ToWasm0(ids, wasm.__wbindgen_export);
1618
+ var len1 = WASM_VECTOR_LEN;
1619
+ wasm.ifcapi_extrusionDefinitions(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
1620
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1621
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1622
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1623
+ if (r2) {
1624
+ throw takeObject(r1);
1625
+ }
1626
+ return takeObject(r0);
1627
+ } finally {
1628
+ wasm.__wbindgen_add_to_stack_pointer(16);
1629
+ }
1630
+ }
1563
1631
  /**
1564
1632
  * Sharded pre-pass: merge the shard-resolved styled-item columns with the
1565
1633
  * SUPPORT spans (extracted host-side from the shard classes) and run the
@@ -1568,7 +1636,9 @@ export class IfcAPI {
1568
1636
  * Span arguments are `[id, start, len]` triples; `plane_angle_to_radians`
1569
1637
  * comes from the meta event. `orphanColors` / `geomColors` carry exactly
1570
1638
  * four floats per id in `orphanIds` / `geomIds`; any other length throws
1571
- * before either column is read.
1639
+ * before either column is read. The payload's `styleFinishes` come from
1640
+ * the geometry finishes a preceding `setPrepassGeometryFinishes` stashed
1641
+ * (consumed here); without that call they are all NaN.
1572
1642
  * @param {Uint8Array} data
1573
1643
  * @param {Uint32Array} orphan_ids
1574
1644
  * @param {Float32Array} orphan_colors
@@ -2587,7 +2657,10 @@ export class IfcAPI {
2587
2657
  * Sharded pre-pass: resolve ONE contiguous (file-ordered) slice of the
2588
2658
  * styled-item span list on this worker, against the entity index installed
2589
2659
  * by `setEntityIndex`. Returns raw resolved maps as flat columns:
2590
- * `{ orphanIds, orphanColors (f32 rgba per id), geomIds, geomColors }`.
2660
+ * `{ orphanIds, orphanColors (f32 rgba per id), geomIds, geomColors,
2661
+ * geomFinishes }`, where `geomFinishes` is the #5582 `[metallic,
2662
+ * roughness]` pair per `geomIds` entry (NaN when unauthored), from
2663
+ * `resolve_geometry_finishes` over this slice.
2591
2664
  * The host merges shard results IN SHARD ORDER with first-wins per
2592
2665
  * geometry id, reproducing the serial resolver's file-order precedence,
2593
2666
  * then hands the merged columns to `finalizePrepassStyles`.
@@ -2890,6 +2963,23 @@ export class IfcAPI {
2890
2963
  setMergeLayers(enabled) {
2891
2964
  wasm.ifcapi_setMergeLayers(this.__wbg_ptr, enabled);
2892
2965
  }
2966
+ /**
2967
+ * Sharded pre-pass (#5582): stash the shard-merged geometry finishes —
2968
+ * the `geomFinishes` columns `resolveStyledItemsShard` returns, merged
2969
+ * first-wins like `geomColors` — for the next `finalizePrepassStyles` /
2970
+ * `finalizePrepassStylesFromSource` call on this instance, which consumes
2971
+ * them and emits the aligned `styleFinishes`. Without this call that
2972
+ * finalize emits NaN finishes, as it always emitted colours only.
2973
+ * @param {Uint32Array} geom_ids
2974
+ * @param {Float32Array} geom_finishes
2975
+ */
2976
+ setPrepassGeometryFinishes(geom_ids, geom_finishes) {
2977
+ const ptr0 = passArray32ToWasm0(geom_ids, wasm.__wbindgen_export);
2978
+ const len0 = WASM_VECTOR_LEN;
2979
+ const ptr1 = passArrayF32ToWasm0(geom_finishes, wasm.__wbindgen_export);
2980
+ const len1 = WASM_VECTOR_LEN;
2981
+ wasm.ifcapi_setPrepassGeometryFinishes(this.__wbg_ptr, ptr0, len0, ptr1, len1);
2982
+ }
2893
2983
  /**
2894
2984
  * Enable or disable the PARAMETRIC rectangular-opening fast path (the
2895
2985
  * placement-frame, ground-truth-exact analytic cut) for `processGeometryBatch`.
@@ -2961,6 +3051,30 @@ export class IfcAPI {
2961
3051
  const len0 = WASM_VECTOR_LEN;
2962
3052
  wasm.ifcapi_setSourceBytes(this.__wbg_ptr, ptr0, len0);
2963
3053
  }
3054
+ /**
3055
+ * Install the prepass's authored metallic/roughness per style (#5582):
3056
+ * `styleFinishes` carries two floats per `styleIds` entry,
3057
+ * `[metallic, roughness]`, NaN for an unauthored field — the
3058
+ * `styleFinishes` array every prepass result carries beside `styleColors`.
3059
+ * Call it with the same `styleIds` later passed to `processGeometryBatch*`;
3060
+ * finishes set for a different style wire are ignored. Empty arrays clear
3061
+ * them. Malformed lengths never throw: a style without a complete pair
3062
+ * simply gets no finish.
3063
+ *
3064
+ * The batch stamps each returned `MeshDataJs` (`metallic` / `roughness`)
3065
+ * from these, taking each mesh's finish from the style its colour came
3066
+ * from (#5984). Occurrences that ride the instanced (IFNS) shard carry
3067
+ * theirs in the shard's per-instance finish field (v3).
3068
+ * @param {Uint32Array} style_ids
3069
+ * @param {Float32Array} style_finishes
3070
+ */
3071
+ setStyleFinishes(style_ids, style_finishes) {
3072
+ const ptr0 = passArray32ToWasm0(style_ids, wasm.__wbindgen_export);
3073
+ const len0 = WASM_VECTOR_LEN;
3074
+ const ptr1 = passArrayF32ToWasm0(style_finishes, wasm.__wbindgen_export);
3075
+ const len1 = WASM_VECTOR_LEN;
3076
+ wasm.ifcapi_setStyleFinishes(this.__wbg_ptr, ptr0, len0, ptr1, len1);
3077
+ }
2964
3078
  /**
2965
3079
  * Select the tessellation detail level applied by every subsequent
2966
3080
  * `processGeometryBatch` call (issue #976, step 4).
@@ -3634,6 +3748,14 @@ export class MeshDataJs {
3634
3748
  const ret = wasm.meshdatajs_materialId(this.__wbg_ptr);
3635
3749
  return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
3636
3750
  }
3751
+ /**
3752
+ * IFC-authored metallic/roughness (#5582). `undefined` when unauthored.
3753
+ * @returns {number | undefined}
3754
+ */
3755
+ get metallic() {
3756
+ const ret = wasm.meshdatajs_metallic(this.__wbg_ptr);
3757
+ return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
3758
+ }
3637
3759
  /**
3638
3760
  * Get normals as Float32Array (copy to JS)
3639
3761
  * @returns {Float32Array}
@@ -3660,6 +3782,13 @@ export class MeshDataJs {
3660
3782
  const ret = wasm.meshdatajs_positions(this.__wbg_ptr);
3661
3783
  return takeObject(ret);
3662
3784
  }
3785
+ /**
3786
+ * @returns {number | undefined}
3787
+ */
3788
+ get roughness() {
3789
+ const ret = wasm.meshdatajs_roughness(this.__wbg_ptr);
3790
+ return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
3791
+ }
3663
3792
  /**
3664
3793
  * Optional SurfaceColour for the "Shading" GLB-export choice — only
3665
3794
  * present when the file authored a distinct DiffuseColour. JS sees
Binary file