Dealing with the mainObject

The mainObject (see /src/ifc-to-three.js/scene/mainObject.js) is a part of Three.

We cannot use Three inside a Web Worker!

We simply exclude that object. Instead, we return an empty object.

function constructProject(ifcData) {
    const finder = createIfcItemsFinder(ifcData);
    bindAllElements(finder);
    const ifcProjects = get(finder, t.IfcProject);
    const elements = finder.findAllProducts(ifcProjects);
    const spaces = get(finder, t.IfcSpace);
    const units = get(finder, t.IfcUnitAssignment)[0];
    return {
      [s.ifcProject]: ifcProjects,
      [s.products]: elements,
      [s.spaces]: spaces,
      [s.units]: units,
      [s.mainObject]: {} // mainObject
    };
}

Please note that this change will break the regular code.

Last updated