Parse the IFC, again

We have now a working script (without Three). Let's finish the Web Worker. Also, don't forget to generate the new build file.

importScripts('../libs/chevrotain.min.js');
importScripts('../../build/IFC.workerr.js');
onmessage = (e) => {
    const ifcData = e.data; 
    const loaded = IFCjs.loadIfcFileItems(ifcData);
    const structured = IFCjs.constructProject(loaded);
    postMessage(structured);
};

Please note that our build is dependent on Chevrotain, but not Three. We need to import Chevrotain first (!).

Of course, our Web Worker will not work. We dissuced this problem in Single Web Worker Example. We need to remove the mainObject.

Last updated