@yschindel/ara3d-webgl 1.3.14 → 1.3.15

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
@@ -1,6 +1,6 @@
1
1
  # Ara 3D WebGL - BIM Open Schema Viewer
2
2
 
3
- ![NPM Version](https://img.shields.io/npm/v/%40ara3d%2Fara3d-webgl)
3
+ [![NPM Version](https://img.shields.io/npm/v/%40ara3d%2Fara3d-webgl)](https://www.npmjs.com/package/@ara3d/ara3d-webgl)
4
4
 
5
5
  ## [Live Demo](https://ara3d.github.io/ara3d-webgl/)
6
6
 
@@ -35515,15 +35515,15 @@ const ZT = {
35515
35515
  LZ4: qT,
35516
35516
  LZ4_RAW: XT
35517
35517
  };
35518
- function Kg(r, e) {
35518
+ function Kg(r) {
35519
35519
  console.time("Building geometry");
35520
- const t = new Yn(), n = KT(r), i = jT(n), s = JT(n), o = YT(i);
35521
- let a = 0;
35522
- for (const c of s)
35523
- a += c.geometry.index.count / 3 * c.count, t.add(c);
35524
- for (const c of o)
35525
- a += c.geometry.index.count / 3, t.add(c);
35526
- return (e?.applyZUpToYUpRotation ?? !0) && (t.rotation.x = -Math.PI / 2), console.timeEnd("Building geometry"), t;
35520
+ const e = new Yn(), t = KT(r), n = jT(t), i = JT(t), s = YT(n);
35521
+ let o = 0;
35522
+ for (const a of i)
35523
+ o += a.geometry.index.count / 3 * a.count, e.add(a);
35524
+ for (const a of s)
35525
+ o += a.geometry.index.count / 3, e.add(a);
35526
+ return e.rotation.x = -Math.PI / 2, console.timeEnd("Building geometry"), e;
35527
35527
  }
35528
35528
  function YT(r) {
35529
35529
  const e = [];
@@ -35715,14 +35715,13 @@ class i2 {
35715
35715
  Q(this, "EntityParameters");
35716
35716
  Q(this, "SingleParameters");
35717
35717
  Q(this, "PointParameters");
35718
- Q(this, "geometryOptions", { applyZUpToYUpRotation: !0 });
35719
35718
  }
35720
35719
  rebuildGeometry(e) {
35721
- return Kg(e, this.geometryOptions);
35720
+ return Kg(e);
35722
35721
  }
35723
35722
  }
35724
35723
  class r2 {
35725
- constructor(e, t) {
35724
+ constructor(e) {
35726
35725
  Q(this, "Descriptors");
35727
35726
  Q(this, "Strings");
35728
35727
  Q(this, "Entities");
@@ -35731,7 +35730,7 @@ class r2 {
35731
35730
  Q(this, "BimGeometry");
35732
35731
  Q(this, "DescriptorCount");
35733
35732
  Q(this, "ParameterMap");
35734
- this.Data = e, this.Entities = e.Entities ?? {}, this.Strings = e.Strings ?? [], this.BimGeometry = e.BimGeometry, this.InstanceCount = this.BimGeometry?.InstanceEntityIndex?.length ?? 0, this.EntityCount = this.Entities?.Category?.length ?? 0, this.Descriptors = t?.skipDescriptorsAndParameters ? {} : e.Descriptors ?? {}, this.DescriptorCount = t?.skipDescriptorsAndParameters ? 0 : this.Descriptors?.Name?.length ?? 0, this.ParameterMap = /* @__PURE__ */ new Map(), t?.skipDescriptorsAndParameters || (console.time("Computing parameters"), e.IntegerParameters && this.ProcessParameters(e.IntegerParameters), e.SingleParameters && this.ProcessParameters(e.SingleParameters), e.StringParameters && this.ProcessParameters(e.StringParameters), e.EntityParameters && this.ProcessParameters(e.EntityParameters), console.timeEnd("Computing parameters"));
35733
+ this.Data = e, this.Entities = e.Entities ?? {}, this.Strings = e.Strings ?? [], this.BimGeometry = e.BimGeometry, this.InstanceCount = this.BimGeometry.InstanceEntityIndex.length, this.EntityCount = this.Entities.Category.length, this.Descriptors = e.Descriptors, this.DescriptorCount = 0, this.ParameterMap = /* @__PURE__ */ new Map(), this.Descriptors && (console.time("Computing parameters"), this.DescriptorCount = this.Descriptors.Name.length, this.ProcessParameters(e.IntegerParameters), this.ProcessParameters(e.SingleParameters), this.ProcessParameters(e.StringParameters), this.ProcessParameters(e.EntityParameters), console.timeEnd("Computing parameters"));
35735
35734
  }
35736
35735
  GetVal(e, t) {
35737
35736
  return t == 3 ? this.Strings[e] : t == 2 ? e >= 0 ? this.GetEntityName(e) : "" : e;
@@ -35829,8 +35828,6 @@ class s2 {
35829
35828
  constructor(e) {
35830
35829
  Q(this, "Resolver");
35831
35830
  this.Data = e, this.Resolver = new r2(e);
35832
- let t = this.Resolver.FindDescriptor("Rvt:Element:Level");
35833
- console.log("The level descriptor is ", t), e.EntityParameters.Descriptor;
35834
35831
  }
35835
35832
  FuncToInstances(e) {
35836
35833
  const t = /* @__PURE__ */ new Map();
@@ -35873,9 +35870,7 @@ class f2 {
35873
35870
  `Failed to fetch BOS from ${e}: ${n.status} ${n.statusText}`
35874
35871
  );
35875
35872
  const i = await n.arrayBuffer(), s = await UM.loadAsync(i), o = await o2(s, t);
35876
- return o.Instances = $T(o.BimGeometry), o.Query = new s2(o), o.Resolver = o.Query.Resolver, o.geometryOptions = {
35877
- applyZUpToYUpRotation: t?.applyZUpToYUpRotation ?? !0
35878
- }, o.ThreeGeometry = Kg(o.Instances, o.geometryOptions), o;
35873
+ return o.Instances = $T(o.BimGeometry), o.Query = new s2(o), o.Resolver = o.Query.Resolver, o.ThreeGeometry = Kg(o.Instances), o;
35879
35874
  }
35880
35875
  }
35881
35876
  async function o2(r, e) {
@@ -35913,13 +35908,14 @@ async function o2(r, e) {
35913
35908
  metadata: f,
35914
35909
  onChunk(d) {
35915
35910
  let m = d.columnData;
35916
- m instanceof BigInt64Array ? c === Int32Array ? m = Int32Array.from(m, (_) => Number(_)) : c === Float32Array ? m = Float32Array.from(m, (_) => Number(_)) : c === Uint32Array ? m = Uint32Array.from(m, (_) => Number(_)) : m = Array.from(m, (_) => Number(_)) : c && m.constructor.name != c.name && (m = new c(m)), a[d.columnName] = m;
35911
+ const g = typeof (m?.length ? m[0] : void 0) == "bigint";
35912
+ c && m.constructor.name != c.name && !g && (m = new c(m)), a[d.columnName] = m;
35917
35913
  }
35918
35914
  });
35919
35915
  }
35920
35916
  console.time("Reading parquet tables");
35921
35917
  const i = new i2(), s = {};
35922
- return await n("Instances", s, Int32Array), await n("VertexBuffer", s, Int32Array), await n("IndexBuffer", s, Uint32Array), await n("Meshes", s, Int32Array), await n("Materials", s, Uint8Array), await n("Transforms", s, Float32Array), i.BimGeometry = s, await n("Entities", i.Entities = {}, Int32Array), i.Descriptors = {}, e?.skipDescriptorsAndParameters || await n("Descriptors", i.Descriptors, void 0, !0), i.IntegerParameters = {}, i.SingleParameters = {}, i.StringParameters = {}, i.EntityParameters = {}, i.PointParameters = {}, e?.skipDescriptorsAndParameters || (await n("IntegerParameters", i.IntegerParameters, Int32Array, !0), await n("SingleParameters", i.SingleParameters, Int32Array, !0), await n("StringParameters", i.StringParameters, Int32Array, !0), await n("EntityParameters", i.EntityParameters, Int32Array, !0), await n("PointParameters", i.PointParameters, Int32Array, !0)), await n("Strings", i), i;
35918
+ return await n("Instances", s, Int32Array), await n("VertexBuffer", s, Int32Array), await n("IndexBuffer", s, Uint32Array), await n("Meshes", s, Int32Array), await n("Materials", s, Uint8Array), await n("Transforms", s, Float32Array), i.BimGeometry = s, await n("Entities", i.Entities = {}, Int32Array), e && e.loadParameters && (await n("Descriptors", i.Descriptors = {}), await n("IntegerParameters", i.IntegerParameters = {}, Int32Array), await n("SingleParameters", i.SingleParameters = {}, Int32Array), await n("StringParameters", i.StringParameters = {}, Int32Array), await n("EntityParameters", i.EntityParameters = {}, Int32Array), await n("PointParameters", i.PointParameters = {}, Int32Array)), await n("Strings", i), i;
35923
35919
  }
35924
35920
  export {
35925
35921
  f2 as BimOpenSchemaLoader,