engine_web-ifc icon indicating copy to clipboard operation
engine_web-ifc copied to clipboard

Fragments: no indices provided to create the mesh.

Open ynnob opened this issue 5 months ago • 1 comments

Describe the bug 📝

While testing more ifc files i failed to display a successfully parsed ifc file. The IFC is provided by ifcinfra.de and should display a Suspension Footbridge. I attached the resulting fragment file that failed to load.

Uncaught Error: Fragments: no indices provided to create the mesh.

Converted IFC to Fragement result: model.zip

The IFC can be downloaded here (ifcinfra.de): https://ifcinfra.de/wp-content/uploads/2019/07/ifcbridge-model05.zip

Versions used:


    "@thatopen/components": "^3.1.0"
    "@thatopen/components-front": "^3.1.0"
    "@thatopen/fragments": "^3.1.1",
    "@thatopen/ui": "^3.1.0"
     web-ifc.wasm: 0.0.69

Reproduction ▶️

No response

Steps to reproduce 🔢

  1. Download the example Suspension Footbridge model from ifcinfra.de (or see the attached .frag file): model.zip

  2. Parse the IFC file to Fragment 3.0

const serializer = new FRAGS.IfcImporter();
  serializer.wasm = {
    path: "./wasm/0.0.69/",
    absolute: false,
  };

  // A convenient variable to hold the ArrayBuffer data loaded into memory
  let fragmentBytes: ArrayBuffer | null = null;

  fragmentBytes = await serializer.process({bytes: buffer,});

  if (!fragmentBytes) {
    throw new Error("Failed to convert IFC to fragments, no data returned.");
  }
  1. Try to load the resulting frag file in the viewer
const workerUrl = "./webworker/worker.mjs";
        const fragments = this.components.get(OBC.FragmentsManager);
        fragments.init(workerUrl);

        fragments.core.models.list.onItemSet.add(({ value: model }) => {
            model.useCamera(this.world.camera.three);
            this.world.scene.three.add(model.object);
            fragments.core.update(true);
        });

        const loadFragmentFile = async (fileName: string, id: string) => {
            const file = await fetch(_____MODEL___URL_____)
            const buffer = await file.arrayBuffer();
            await fragments.core.load(buffer, { modelId: id });
        };

        await loadFragmentFile('model.frag', 'model');

System Info 💻

System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
    Memory: 29.24 GB / 63.92 GB
  Binaries:
    Node: 23.4.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
    npm: 11.4.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 10.12.4 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (137.0.3296.68)
    Internet Explorer: 11.0.22621.3527

Used Package Manager 📦

npm

Error Trace/Logs 📃

Uncaught Error: Fragments: no indices provided to create the mesh.
    at yi.setIndex (index.mjs:1:184861)
    at yi.createMesh (index.mjs:1:183712)
    at yi.create (index.mjs:1:184067)
    at yi.processTileRequest (index.mjs:1:183389)
    at yi.update (index.mjs:1:183042)
    at index.mjs:1:182866

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.
  • [x] 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.

ynnob avatar Jul 15 '25 08:07 ynnob

This seems to be a problem with our core ifc library. Moving the issue there

agviegas avatar Jul 28 '25 11:07 agviegas