IFCImporter
Introduction
vtkIFCImporter is a source object that reads Industry Foundation Class(IFC) files.
The vtkIFCImporter is using web-ifc library to parse the IFC file.
Usage
js
import vtkResourceLoader from '@kitware/vtk.js/IO/Core/ResourceLoader';
import vtkIFCImporter from '@kitware/vtk.js/IO/Geometry/IFCImporter';
function update() {
importer.onReady(() => {
importer.importActors(renderer);
renderer.resetCamera();
renderWindow.render();
});
}
vtkResourceLoader
.loadScript('https://esm.sh/web-ifc@0.0.55/web-ifc-api-iife.js')
.then(() => {
// Pass WebIFC api to vtkIFCImporter
vtkIFCImporter.setIFCAPI(window.WebIFC);
// Trigger data download
importer.setUrl(`${__BASE_PATH__}/data/ifc/house.ifc`).then(update);
});Methods
extend
Method used to decorate a given object (publicAPI+model) with vtkIFCImporter characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IIFCImporterInitialValues | No | (default: {}) |
getBaseURL
getDataAccessHelper
getMergeGeometries
Get whether the geometries are merged into a single actor when imported.
getUrl
Get the url of the object to load.
importActors
Import actors into the renderer.
| Argument | Type | Required | Description |
|---|---|---|---|
renderer | vtkRenderer | Yes | The vtkRenderer to import the actors into. |
invokeReady
loadData
Load the object data.
| Argument | Type | Required | Description |
|---|---|---|---|
options | IIFCImporterOptions | No |
newInstance
Method used to create a new instance of vtkIFCImporter
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IIFCImporterInitialValues | No | for pre-setting some of its content |
onReady
| Argument | Type | Required | Description |
|---|---|---|---|
cb | Function | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
parse
Parse data.
| Argument | Type | Required | Description |
|---|---|---|---|
content | String or ArrayBuffer | Yes | The content to parse. |
parseAsArrayBuffer
Parse data as ArrayBuffer.
| Argument | Type | Required | Description |
|---|---|---|---|
content | ArrayBuffer | Yes | The content to parse. |
setDataAccessHelper
| Argument | Type | Required | Description |
|---|---|---|---|
dataAccessHelper | Yes |
setMergeGeometries
Set whether the geometries are merged into a single actor when imported.
| Argument | Type | Required | Description |
|---|---|---|---|
mergeGeometries | Boolean | Yes |
setUrl
Set the url of the object to load.
| Argument | Type | Required | Description |
|---|---|---|---|
url | String | Yes | the url of the object to load. |
option | IIFCImporterOptions | No | The PLY reader options. |