@ifc-lite/wasm 6.0.0 → 6.1.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": "6.0.0",
8
+ "version": "6.1.0",
9
9
  "license": "MPL-2.0",
10
10
  "repository": {
11
11
  "type": "git",
package/pkg/ifc-lite.d.ts CHANGED
@@ -891,7 +891,10 @@ export class MeshCollection {
891
891
  * worker reads each mesh exactly once, so moving avoids the full vertex-
892
892
  * data clone `get` pays — one fewer copy of positions/normals/indices/uvs/
893
893
  * texture per mesh (the JS getters still do the single Rust→JS copy). Calling
894
- * it twice for the same index yields the second call an empty mesh.
894
+ * it twice for the same index yields the second call a DEFAULT mesh:
895
+ * `expressId` 0 and every buffer empty, rather than the metadata-bearing
896
+ * husk the hand-written copy used to leave. The method is read-once by
897
+ * contract and the wasm-contract test pins this.
895
898
  */
896
899
  takeMesh(index: number): MeshDataJs | undefined;
897
900
  /**
@@ -1015,6 +1018,27 @@ export class MeshCollection {
1015
1018
 
1016
1019
  /**
1017
1020
  * Individual mesh data with express ID and color (matches MeshData interface)
1021
+ *
1022
+ * `Clone` is derived so the three sites that used to enumerate all 21 fields
1023
+ * by hand -- `get`, `takeMesh` and `MeshCollection`'s own `Clone` -- reduce to
1024
+ * `.cloned()`, `mem::take` and `.clone()`. Adding a field to #3199 meant
1025
+ * editing three literals in lockstep; the allowlist row for this file records
1026
+ * exactly that cost.
1027
+ *
1028
+ * To be precise about what this does and does not buy, because the obvious
1029
+ * claim is wrong: an exhaustive struct literal that OMITS a field is a compile
1030
+ * error, so those literals were never silently lossy. What they were is three
1031
+ * places to edit for one field, and `..Default::default()` is the shortcut a
1032
+ * hurried author reaches for when the compiler complains -- which WOULD be
1033
+ * silently lossy. `Default` is what makes `takeMesh` a one-liner, so the rule
1034
+ * is: TWO literals remain, `new` and `Default` below (both spelled
1035
+ * `Self { .. }`, which is why a grep for `MeshDataJs {` finds neither). Both
1036
+ * must stay exhaustive AND must agree on every field `new` does not take as an
1037
+ * argument. The compiler catches an omitted field in either; it cannot catch
1038
+ * the two DISAGREEING, which is the failure the pair exists to prevent, so
1039
+ * `default_agrees_with_new_on_the_fields_new_does_not_take` covers that.
1040
+ * Never spread `Default` into `new` -- `new` is the only place a field's
1041
+ * initial value is decided, so a field defaulted there is inert everywhere.
1018
1042
  */
1019
1043
  export class MeshDataJs {
1020
1044
  private constructor();
@@ -1034,6 +1058,11 @@ export class MeshDataJs {
1034
1058
  * type geometry (hidden in Model mode, shown in Types mode).
1035
1059
  */
1036
1060
  readonly geometryClass: number;
1061
+ /**
1062
+ * Source `IfcRepresentationItem`, or `undefined` where identity is merged
1063
+ * away. Never set alongside `materialId` (#3199).
1064
+ */
1065
+ readonly geometryItemId: number | undefined;
1037
1066
  /**
1038
1067
  * True when this mesh carries a surface texture (#961).
1039
1068
  */
@@ -1058,6 +1087,10 @@ export class MeshDataJs {
1058
1087
  * `local_bounds` above).
1059
1088
  */
1060
1089
  readonly localToWorld: Float64Array | undefined;
1090
+ /**
1091
+ * `IfcMaterial` layer sliced, or `undefined` (#3199).
1092
+ */
1093
+ readonly materialId: number | undefined;
1061
1094
  /**
1062
1095
  * Get normals as Float32Array (copy to JS)
1063
1096
  */
@@ -1976,11 +2009,13 @@ export interface InitOutput {
1976
2009
  readonly meshdatajs_color: (a: number, b: number) => void;
1977
2010
  readonly meshdatajs_expressId: (a: number) => number;
1978
2011
  readonly meshdatajs_geometryClass: (a: number) => number;
2012
+ readonly meshdatajs_geometryItemId: (a: number) => number;
1979
2013
  readonly meshdatajs_hasTexture: (a: number) => number;
1980
2014
  readonly meshdatajs_ifcType: (a: number, b: number) => void;
1981
2015
  readonly meshdatajs_indices: (a: number) => number;
1982
2016
  readonly meshdatajs_localBounds: (a: number, b: number) => void;
1983
2017
  readonly meshdatajs_localToWorld: (a: number, b: number) => void;
2018
+ readonly meshdatajs_materialId: (a: number) => number;
1984
2019
  readonly meshdatajs_normals: (a: number) => number;
1985
2020
  readonly meshdatajs_origin: (a: number) => number;
1986
2021
  readonly meshdatajs_positions: (a: number) => number;
package/pkg/ifc-lite.js CHANGED
@@ -2417,7 +2417,10 @@ export class MeshCollection {
2417
2417
  * worker reads each mesh exactly once, so moving avoids the full vertex-
2418
2418
  * data clone `get` pays — one fewer copy of positions/normals/indices/uvs/
2419
2419
  * texture per mesh (the JS getters still do the single Rust→JS copy). Calling
2420
- * it twice for the same index yields the second call an empty mesh.
2420
+ * it twice for the same index yields the second call a DEFAULT mesh:
2421
+ * `expressId` 0 and every buffer empty, rather than the metadata-bearing
2422
+ * husk the hand-written copy used to leave. The method is read-once by
2423
+ * contract and the wasm-contract test pins this.
2421
2424
  * @param {number} index
2422
2425
  * @returns {MeshDataJs | undefined}
2423
2426
  */
@@ -2446,6 +2449,27 @@ if (Symbol.dispose) MeshCollection.prototype[Symbol.dispose] = MeshCollection.pr
2446
2449
 
2447
2450
  /**
2448
2451
  * Individual mesh data with express ID and color (matches MeshData interface)
2452
+ *
2453
+ * `Clone` is derived so the three sites that used to enumerate all 21 fields
2454
+ * by hand -- `get`, `takeMesh` and `MeshCollection`'s own `Clone` -- reduce to
2455
+ * `.cloned()`, `mem::take` and `.clone()`. Adding a field to #3199 meant
2456
+ * editing three literals in lockstep; the allowlist row for this file records
2457
+ * exactly that cost.
2458
+ *
2459
+ * To be precise about what this does and does not buy, because the obvious
2460
+ * claim is wrong: an exhaustive struct literal that OMITS a field is a compile
2461
+ * error, so those literals were never silently lossy. What they were is three
2462
+ * places to edit for one field, and `..Default::default()` is the shortcut a
2463
+ * hurried author reaches for when the compiler complains -- which WOULD be
2464
+ * silently lossy. `Default` is what makes `takeMesh` a one-liner, so the rule
2465
+ * is: TWO literals remain, `new` and `Default` below (both spelled
2466
+ * `Self { .. }`, which is why a grep for `MeshDataJs {` finds neither). Both
2467
+ * must stay exhaustive AND must agree on every field `new` does not take as an
2468
+ * argument. The compiler catches an omitted field in either; it cannot catch
2469
+ * the two DISAGREEING, which is the failure the pair exists to prevent, so
2470
+ * `default_agrees_with_new_on_the_fields_new_does_not_take` covers that.
2471
+ * Never spread `Default` into `new` -- `new` is the only place a field's
2472
+ * initial value is decided, so a field defaulted there is inert everywhere.
2449
2473
  */
2450
2474
  export class MeshDataJs {
2451
2475
  static __wrap(ptr) {
@@ -2499,6 +2523,15 @@ export class MeshDataJs {
2499
2523
  const ret = wasm.meshdatajs_geometryClass(this.__wbg_ptr);
2500
2524
  return ret;
2501
2525
  }
2526
+ /**
2527
+ * Source `IfcRepresentationItem`, or `undefined` where identity is merged
2528
+ * away. Never set alongside `materialId` (#3199).
2529
+ * @returns {number | undefined}
2530
+ */
2531
+ get geometryItemId() {
2532
+ const ret = wasm.meshdatajs_geometryItemId(this.__wbg_ptr);
2533
+ return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
2534
+ }
2502
2535
  /**
2503
2536
  * True when this mesh carries a surface texture (#961).
2504
2537
  * @returns {boolean}
@@ -2579,6 +2612,14 @@ export class MeshDataJs {
2579
2612
  wasm.__wbindgen_add_to_stack_pointer(16);
2580
2613
  }
2581
2614
  }
2615
+ /**
2616
+ * `IfcMaterial` layer sliced, or `undefined` (#3199).
2617
+ * @returns {number | undefined}
2618
+ */
2619
+ get materialId() {
2620
+ const ret = wasm.meshdatajs_materialId(this.__wbg_ptr);
2621
+ return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
2622
+ }
2582
2623
  /**
2583
2624
  * Get normals as Float32Array (copy to JS)
2584
2625
  * @returns {Float32Array}
Binary file