# Parse the IFC

This is where the fun begins!

We are going to modify the orignal source code. Take a look at `IFC.js`.

{% code title="src/IFC.js" %}
```javascript
function loadIfc(ifcData) {
    const loaded = loadIfcFileItems(ifcData);
    const structured = constructProject(loaded);
    return buildGeometry(structured);
}
```
{% endcode %}

As we discuessed earlier, we cannot build the entire gemoetry inside the `Web Worker`.&#x20;

{% code title="example/web-worker/worker/worker.js" %}
```javascript
onmessage = (e) => {
    const ifcData = e.data; 
    const loaded = IFCjs.loadIfcFileItems(ifcData);
    const structured = IFCjs.constructProject(loaded);
    postMessage(structured);
};
```
{% endcode %}

If we run this code, it won't work. The Web Worker has no idea what `IFC.js` is. We must [import the scripts](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#importing_scripts_and_libraries).

{% code title="example/web-worker/worker/worker.js" %}
```javascript
importScripts('../../build/IFC.js');
onmessage = (e) => {
    const ifcData = e.data; 
    const loaded = IFCjs.loadIfcFileItems(ifcData);
    const structured = IFCjs.constructProject(loaded);
    postMessage(structured);
};
```
{% endcode %}

Again, please note that this will not work! The `Web Worker` will complain that [Three](https://threejs.org) and [Chevrotain](https://github.com/SAP/chevrotain) is missing.

Again, to clarify - **WE CANNOT USE THREE INSIDE THE WEB WORKER.**
