Import BIM models from IFC STEP files using the web-ifc API
The xeokit SDK provides functionality to import 3D building models from Industry Foundation Classes (IFC) files, which are commonly used in the field of Building Information Modeling (BIM). IFC files facilitate the exchange of information between different software applications used in the construction and building industries.
The loadWebIFC function can be used to import medium-sized IFC models into xeokit. This function loads the IFC file data into both a SceneModel (which holds the model's geometry and materials) and a DataModel (which holds the model's semantic data). The loadWebIFC function internally leverages the web-ifc API to parse geometry and data from the IFC file.
Installation
To install the xeokit SDK, use the following npm command:
npminstall@xeokit/sdk
Usage Example
The example below demonstrates how to use loadWebIFC in the xeokit context.
This example sets up a Viewer using a WebGLRenderer and a Scene to hold the model's geometry and materials. We also create a Data instance to store the model's semantic data.
In the Viewer, we create a View to render the model to an HTML canvas, and attach a CameraControl to allow mouse and touch input for camera control.
The Scene will include a SceneModel for geometry and materials, and the Data will include a DataModel to hold the IFC elements and property sets.
Before using loadWebIFC, we initialize the WebIFC API, which is then passed into the loadWebIFC function. The example also demonstrates error handling using the SDKError class.
xeokit IFC Importer
Import BIM models from IFC STEP files using the web-ifc API
The xeokit SDK provides functionality to import 3D building models from Industry Foundation Classes (IFC) files, which are commonly used in the field of Building Information Modeling (BIM). IFC files facilitate the exchange of information between different software applications used in the construction and building industries.
The loadWebIFC function can be used to import medium-sized IFC models into xeokit. This function loads the IFC file data into both a SceneModel (which holds the model's geometry and materials) and a DataModel (which holds the model's semantic data). The
loadWebIFC
function internally leverages the web-ifc API to parse geometry and data from the IFC file.Installation
To install the xeokit SDK, use the following npm command:
Usage Example
The example below demonstrates how to use loadWebIFC in the xeokit context.
This example sets up a Viewer using a WebGLRenderer and a Scene to hold the model's geometry and materials. We also create a Data instance to store the model's semantic data.
In the Viewer, we create a View to render the model to an HTML canvas, and attach a CameraControl to allow mouse and touch input for camera control.
The Scene will include a SceneModel for geometry and materials, and the Data will include a DataModel to hold the IFC elements and property sets.
Before using loadWebIFC, we initialize the WebIFC API, which is then passed into the
loadWebIFC
function. The example also demonstrates error handling using the SDKError class.Example JavaScript code: