@ifc-lite/wasm 4.2.2 → 4.3.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": "4.2.2",
8
+ "version": "4.3.0",
9
9
  "license": "MPL-2.0",
10
10
  "repository": {
11
11
  "type": "git",
package/pkg/ifc-lite.d.ts CHANGED
@@ -789,6 +789,47 @@ export class MeshCollection {
789
789
  * nested shape as a single FFI crossing instead of dozens of getters.
790
790
  */
791
791
  readonly diagnostics: any;
792
+ /**
793
+ * Per-entity world-space AABBs as a `Float64Array`, SIX values per entry
794
+ * (`minx, miny, minz, maxx, maxy, maxz`), in the same order as
795
+ * [`Self::geometry_hash_ids`] — entry `i` spans `[6*i, 6*i+6)`. Empty
796
+ * unless geometry hashing was enabled; the same
797
+ * `IfcAPI.setComputeGeometryHashes` switch gates both, so nothing is
798
+ * computed when the diff feature is off.
799
+ *
800
+ * Unquantized world `f64` (the file's RTC folded back in), so two
801
+ * revisions that chose different RTC offsets report the same box. This is
802
+ * what lets a consumer say "MOVED" honestly instead of inferring it from a
803
+ * changed hash, which also fires on reshape and on retriangulation.
804
+ *
805
+ * **Frame: WebGL Y-up**, like every other box, position, origin and
806
+ * placement that crosses this boundary (see `MeshDataJs::local_bounds`).
807
+ * The hasher accumulates in the producer's IFC Z-up frame, so the swap
808
+ * `(x,y,z) -> (x,z,-y)` is applied here, on the way out. Unconverted, the
809
+ * boxes would not enclose the very meshes `processGeometryBatch` returns
810
+ * alongside them. Positions are RTC-relative and this box is absolute, so
811
+ * a consumer comparing the two folds `rtcOffset*` in — itself Y-up-swapped.
812
+ *
813
+ * Present for every hashed entity. Its companion
814
+ * [`Self::geometry_volume_values`] is not — see there.
815
+ */
816
+ readonly geometryAabbValues: Float64Array;
817
+ /**
818
+ * Per-entity topology verdict as a `Uint8Array`, one packed byte per entry
819
+ * in [`Self::geometry_hash_ids`] order:
820
+ *
821
+ * * bit 0 (`1`) — every segment closed (no boundary / non-manifold edge)
822
+ * * bit 1 (`2`) — every segment orientable
823
+ * * bit 2 (`4`) — every segment a single connected component
824
+ * * bit 3 (`8`) — the entity produced exactly one segment
825
+ *
826
+ * `0x0F` is exactly the set that carries a volume in
827
+ * [`Self::geometry_volume_values`]. The individual bits are the diagnosis:
828
+ * a model checker can distinguish "this wall is an open shell" (bit 0
829
+ * clear) from "this door is a multi-item assembly whose parts may overlap"
830
+ * (bit 3 clear), which are different findings with different fixes.
831
+ */
832
+ readonly geometryClosureFlags: Uint8Array;
792
833
  /**
793
834
  * Number of per-entity geometry fingerprints recorded.
794
835
  */
@@ -806,6 +847,28 @@ export class MeshCollection {
806
847
  * geometry hashing was enabled.
807
848
  */
808
849
  readonly geometryHashValues: BigUint64Array;
850
+ /**
851
+ * Per-entity enclosed volume in CUBIC METRES as a `Float64Array`, one
852
+ * value per entry in [`Self::geometry_hash_ids`] order. `NaN` means NO
853
+ * TRUSTWORTHY VOLUME — the same absent convention as
854
+ * [`Self::geometry_aabb_values`] — and it is `NaN` for roughly a third of
855
+ * entities by design, not by failure.
856
+ *
857
+ * A value is emitted only when that entity's produced geometry was
858
+ * PROVABLY a single closed, orientable, single-component solid, as decided
859
+ * by the mesher's own orientation pass. Read
860
+ * `ifc_lite_geometry::GeometryHasher::volume` before treating a `NaN` as a
861
+ * bug: an open `SurfaceModel`, a material-layered wall (whose slices are
862
+ * open bands by construction), and any element assembled from more than one
863
+ * representation item all correctly report nothing rather than a plausible
864
+ * wrong number. [`Self::geometry_closure_flags`] says which.
865
+ *
866
+ * This is NOT a substitute for an IFC `BaseQuantities` `GrossVolume`: it is
867
+ * the volume of the geometry that was actually meshed, after opening cuts,
868
+ * and it says nothing about whether a CSG degradation left the host uncut
869
+ * (see the `diagnostics` getter).
870
+ */
871
+ readonly geometryVolumeValues: Float64Array;
809
872
  /**
810
873
  * Get number of meshes
811
874
  */
@@ -1620,9 +1683,12 @@ export interface InitOutput {
1620
1683
  readonly meshOutline2d: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
1621
1684
  readonly meshcollection_buildingRotation: (a: number, b: number) => void;
1622
1685
  readonly meshcollection_diagnostics: (a: number) => number;
1686
+ readonly meshcollection_geometryAabbValues: (a: number) => number;
1687
+ readonly meshcollection_geometryClosureFlags: (a: number) => number;
1623
1688
  readonly meshcollection_geometryHashCount: (a: number) => number;
1624
1689
  readonly meshcollection_geometryHashIds: (a: number) => number;
1625
1690
  readonly meshcollection_geometryHashValues: (a: number) => number;
1691
+ readonly meshcollection_geometryVolumeValues: (a: number) => number;
1626
1692
  readonly meshcollection_get: (a: number, b: number) => number;
1627
1693
  readonly meshcollection_hasRtcOffset: (a: number) => number;
1628
1694
  readonly meshcollection_length: (a: number) => number;
package/pkg/ifc-lite.js CHANGED
@@ -2005,6 +2005,55 @@ export class MeshCollection {
2005
2005
  const ret = wasm.meshcollection_diagnostics(this.__wbg_ptr);
2006
2006
  return takeObject(ret);
2007
2007
  }
2008
+ /**
2009
+ * Per-entity world-space AABBs as a `Float64Array`, SIX values per entry
2010
+ * (`minx, miny, minz, maxx, maxy, maxz`), in the same order as
2011
+ * [`Self::geometry_hash_ids`] — entry `i` spans `[6*i, 6*i+6)`. Empty
2012
+ * unless geometry hashing was enabled; the same
2013
+ * `IfcAPI.setComputeGeometryHashes` switch gates both, so nothing is
2014
+ * computed when the diff feature is off.
2015
+ *
2016
+ * Unquantized world `f64` (the file's RTC folded back in), so two
2017
+ * revisions that chose different RTC offsets report the same box. This is
2018
+ * what lets a consumer say "MOVED" honestly instead of inferring it from a
2019
+ * changed hash, which also fires on reshape and on retriangulation.
2020
+ *
2021
+ * **Frame: WebGL Y-up**, like every other box, position, origin and
2022
+ * placement that crosses this boundary (see `MeshDataJs::local_bounds`).
2023
+ * The hasher accumulates in the producer's IFC Z-up frame, so the swap
2024
+ * `(x,y,z) -> (x,z,-y)` is applied here, on the way out. Unconverted, the
2025
+ * boxes would not enclose the very meshes `processGeometryBatch` returns
2026
+ * alongside them. Positions are RTC-relative and this box is absolute, so
2027
+ * a consumer comparing the two folds `rtcOffset*` in — itself Y-up-swapped.
2028
+ *
2029
+ * Present for every hashed entity. Its companion
2030
+ * [`Self::geometry_volume_values`] is not — see there.
2031
+ * @returns {Float64Array}
2032
+ */
2033
+ get geometryAabbValues() {
2034
+ const ret = wasm.meshcollection_geometryAabbValues(this.__wbg_ptr);
2035
+ return takeObject(ret);
2036
+ }
2037
+ /**
2038
+ * Per-entity topology verdict as a `Uint8Array`, one packed byte per entry
2039
+ * in [`Self::geometry_hash_ids`] order:
2040
+ *
2041
+ * * bit 0 (`1`) — every segment closed (no boundary / non-manifold edge)
2042
+ * * bit 1 (`2`) — every segment orientable
2043
+ * * bit 2 (`4`) — every segment a single connected component
2044
+ * * bit 3 (`8`) — the entity produced exactly one segment
2045
+ *
2046
+ * `0x0F` is exactly the set that carries a volume in
2047
+ * [`Self::geometry_volume_values`]. The individual bits are the diagnosis:
2048
+ * a model checker can distinguish "this wall is an open shell" (bit 0
2049
+ * clear) from "this door is a multi-item assembly whose parts may overlap"
2050
+ * (bit 3 clear), which are different findings with different fixes.
2051
+ * @returns {Uint8Array}
2052
+ */
2053
+ get geometryClosureFlags() {
2054
+ const ret = wasm.meshcollection_geometryClosureFlags(this.__wbg_ptr);
2055
+ return takeObject(ret);
2056
+ }
2008
2057
  /**
2009
2058
  * Number of per-entity geometry fingerprints recorded.
2010
2059
  * @returns {number}
@@ -2034,6 +2083,32 @@ export class MeshCollection {
2034
2083
  const ret = wasm.meshcollection_geometryHashValues(this.__wbg_ptr);
2035
2084
  return takeObject(ret);
2036
2085
  }
2086
+ /**
2087
+ * Per-entity enclosed volume in CUBIC METRES as a `Float64Array`, one
2088
+ * value per entry in [`Self::geometry_hash_ids`] order. `NaN` means NO
2089
+ * TRUSTWORTHY VOLUME — the same absent convention as
2090
+ * [`Self::geometry_aabb_values`] — and it is `NaN` for roughly a third of
2091
+ * entities by design, not by failure.
2092
+ *
2093
+ * A value is emitted only when that entity's produced geometry was
2094
+ * PROVABLY a single closed, orientable, single-component solid, as decided
2095
+ * by the mesher's own orientation pass. Read
2096
+ * `ifc_lite_geometry::GeometryHasher::volume` before treating a `NaN` as a
2097
+ * bug: an open `SurfaceModel`, a material-layered wall (whose slices are
2098
+ * open bands by construction), and any element assembled from more than one
2099
+ * representation item all correctly report nothing rather than a plausible
2100
+ * wrong number. [`Self::geometry_closure_flags`] says which.
2101
+ *
2102
+ * This is NOT a substitute for an IFC `BaseQuantities` `GrossVolume`: it is
2103
+ * the volume of the geometry that was actually meshed, after opening cuts,
2104
+ * and it says nothing about whether a CSG degradation left the host uncut
2105
+ * (see the `diagnostics` getter).
2106
+ * @returns {Float64Array}
2107
+ */
2108
+ get geometryVolumeValues() {
2109
+ const ret = wasm.meshcollection_geometryVolumeValues(this.__wbg_ptr);
2110
+ return takeObject(ret);
2111
+ }
2037
2112
  /**
2038
2113
  * Get mesh at index (clones — non-destructive). Prefer `takeMesh` on the
2039
2114
  * hot streaming path; this stays for callers that read meshes more than once.
Binary file