Skip to main content

Introduction

Full IFC control at native speed#

🌎 It is often thought that web applications are not as powerful as desktop applications. Relatively recently, however, WebAssembly appeared on the scene.

🔥🔥🔥 This means we can have the best of both worlds: the flexibility of a web application and the full performance of a machine. And this is what web-ifc is all about. You can install it with npm i web-ifc or yarn add web-ifc and it has the following features:

⚡ It is as fast as native applications thanks to its parsing core, written from scratch in C++.

🚀 It can be run directly on the client or as a backend service. Bring BIM to all parts of your system!

📚 It can read 100% of the IFC data, including IFC types. This allows data to be easily extracted, structured, traversed and entered into databases.

🌈 It can edit data and write entire IFCs from scratch. Create apps that communicate with the large software vendors.

In the following points, the API and its functionalities will be shown step by step. However, there are a some issues that are important to be clear about before using web-ifc.

But wait, I don't know C++!#

👌 Don't worry! Although the parser is written in C++, it is compiled in a file called web-ifc.wasm that browsers understand automatically. Just include this file in your application and you will have access to the full API with native speed with JavaScript or TypeScript. How cool is that?

What is the .wasm file for?#

🧠 The web-ifc.wasm file contains the IFC parsing core. It is pre-compiled and hyper-efficient; unlike JavaScript, which has to be compiled line by line, this file can be sent directly to the CPU and executed without prior interpretation.

📦 You can find this file in the node-modules/web-ifc/web-ifc.wasm folder. You will need to serve this file with your application (if frontend) or have it on your server (if backend).

When should I use web-ifc?#

🦅 Web-ifc is the lightest and most flexible module of IFC.js. However, this flexibility also means that you have to know what you are doing, and therefore know the internals of the IFC schema relatively well.

☝ Moreover, web-ifc does not implement a 3d viewer. This is an advantage, because it means that you can get IFC geometry without relying on a particular 3d renderer in a more agile way.

If you want to see 3d geometry easily, you will either have to implement it yourself, or use web-ifc-three or web-ifc-viewer.