ThatOpen / engine_components

MIT License
349 stars 134 forks source link

Abnormal FragmentBoundingBox values after upgrading to 1.3.2 and web-ifc 0.0.50 #286

Closed tb-viktor closed 9 months ago

tb-viktor commented 9 months ago

Describe the bug 📝

Hello,

After upgrading to the latest components version and using the web-ifc 0.0.50 wasm, our "center camera on object" functionality, which is based on the official docs, stopped working and I've managed to narrow it down to a problem with the FragmentBoundingBox of the loaded model.

We're getting strange values from the bounding box get, getMesh and getSphere methods after this upgrade. These values make the model vanish from view and the camera becomes unresponsive.

This is what the values look like before upgrading (1.3.0/0.0.46):

image

This is what they look like after upgrading (1.3.2/0.0.50):

image

The Z value is particularly large, but also the other values are very different.

Is there a different/better way to get the bounding box values now, or is this a bug?

Reproduction ▶️

No response

Steps to reproduce 🔢

https://docs.thatopen.com/Tutorials/FragmentBoundingBox

After loading the model we do:

scene.add(model);

const fragmentBbox = components.tools.get(OBC.FragmentBoundingBox);
fragmentBbox.add(model);

And when centering we do:

camera.controls.fitToSphere(fragmentBbox.getMesh(), true);

System Info 💻

System:
  OS: Windows 10 10.0.19045
  CPU: (8) x64 Intel(R) Core(TM) i5-1035G7 CPU @ 1.20GHz
  Memory: 5.76 GB / 15.60 GB
Binaries:
  Node: 20.3.0 - C:\Program Files\nodejs\node.EXE
  npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
  Edge: Chromium (121.0.2277.83)
  Internet Explorer: 11.0.19041.3636
npmPackages:
  openbim-components: ^1.3.2 => 1.3.2

Used Package Manager 📦

npm

Error Trace/Logs 📃

No response

Validations ✅

tb-viktor commented 9 months ago

Solved with components 1.3.4 and web-ifc 0.0.51 ✔️