Skip to content

[Bim Tiles] Error is thrown when removing a streamed model from the scene #345

@Rocha442

Description

@Rocha442

Describe the bug 📝

After streaming an IFC file into the scene, if i try to remove it by calling remove(modelID) in FragmentStreamLoader, an error will be thrown by GeometryCullerRenderer, because the _geometries property has been cleared by the culler's corresponding remove(modelID), but the _foundGeometry property will still have some of the model's geometry data. The "Geometry not found!" error is thrown in this block the next time the culler is automatically updated.

if (bboxAmount <= this.bboxThreshold) {
// When too many bounding boxes on sight
// don't hide / destroy geometry to prevent flickering
for (const color of lostGeometries) {
const geometry = this._geometries.get(color);
if (!geometry) {
throw new Error("Geometry not found!");

Reproduction ▶️

No response

Steps to reproduce 🔢

  1. Call FragmentStreamLoader.load() and stream an ifc model into the scene
  2. Call FragmentStreamLoader.remove(modelID) and remove the previosuly added model
  3. Check console for the GeometryCullerRendered error the next time the culler is updated

System Info 💻

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 5.85 GB / 15.89 GB
  Binaries:
    Node: 20.12.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (123.0.2420.65)
    Internet Explorer: 11.0.19041.3636
  npmPackages:
    openbim-components: 1.4.15 => 1.4.15

Used Package Manager 📦

npm

Error Trace/Logs 📃

No response

Validations ✅

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • 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.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions