engine_components icon indicating copy to clipboard operation
engine_components copied to clipboard

BoundingBoxer.addFragmentIdMap() not works & FPS become very low when load complex IFC model

Open steven11329 opened this issue 5 months ago • 0 comments

Describe the bug 📝

I'm try to get every floors' bbox for filter floor model with clipping plane.

I could get properties by IFCBUILDINGSTOREY

getAllPropertiesOfType(WEBIFC.IFCBUILDINGSTOREY)

I could get bbox on simple IFC file by

for (const id in properties) {
          const property = properties[id];
          this._fragmentBbox.addFragmentIdMap(
            gp.getFragmentMap([parseInt(id)])
          );
          const floorBbox = this._fragmentBbox.get();
          const scale = 1.01;
          infoMap[gp.userData.buildingIndex].floors.push({
            name: property?.Name?.value,
            bbox: {
              maxX: scale * floorBbox.max.x,
              minX: scale * floorBbox.min.x,
              maxY: scale * floorBbox.max.y,
              minY: scale * floorBbox.min.y,
              maxZ: scale * floorBbox.max.z,
              minZ: scale * floorBbox.min.z,
            },
          });
          this._fragmentBbox.reset();
        }

But it not works on complex IFC file.

Another problem is FPS become very low when complex IFC file loaded

I know that could exclude categories which follow link. But i'm not IFC expert. So I don't know what categories I could exclude.

Reproduction ▶️

https://github.com/steven11329/thatopen-api-issue

Steps to reproduce 🔢

  1. Run pnpm install
  2. Open browser http://localhost:5173/
  3. Select Issue 2

System Info 💻

System:
    OS: macOS 14.6.1
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 512.95 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.16.0 - /usr/local/opt/node@20/bin/node
    pnpm: 9.7.1 - ~/Library/pnpm/pnpm
    Watchman: 2024.08.12.00 - /usr/local/bin/watchman
  Browsers:
    Chrome: 128.0.6613.138

Used Package Manager 📦

pnpm

Error Trace/Logs 📃

No response

Validations ✅

  • [X] Read the docs.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
  • [ ] Check that this is a concrete bug. For Q&A join our Community.
  • [X] The provided reproduction is a minimal reproducible example of the bug.

steven11329 avatar Sep 23 '24 04:09 steven11329