import {CxConverterIFCLoaderPlugin} from '@xeokit/xeokit-sdk/src/plugins/CxConverterIFCLoaderPlugin/CxConverterIFCLoaderPlugin.js'
CxConverterIFCLoaderPlugin
Extends:
Viewer plugin that uses CxConverter to load BIM models directly from IFC files, using its WebAssembly buid from npm package.
Overview
The WebAssembly build of CxConverter is still in alfa stage, so it may not work as expected. This documentation will be updated as the library and the plugin evolve. The example below shows how to use the plugin:
import { CxConverterIFCLoaderPlugin, Viewer } from "../../dist/xeokit-sdk.es.js";
const cxConverterIFCLoaderPlugin = new CxConverterIFCLoaderPlugin(viewer);
const sceneModel = await cxConverterIFCLoaderPlugin.load({
src: "../../assets/models/ifc/Duplex.ifc"
});
See the code in action here.
Constructor Summary
Public Constructor | ||
public |
constructor(viewer: Viewer, cfg: Object) |
Member Summary
Public Members | ||
public |
The GLTFLoaderPlugin used internally to load the converted GLTF. |
Method Summary
Public Methods | ||
public |
async load(params: Object): Promise<SceneModel> Loads an IFC model from the given source. |
Inherited Summary
From class Plugin | ||
public |
ID for this Plugin, unique within its Viewer. |
|
public |
viewer: Viewer The Viewer that contains this Plugin. |
|
public |
destroy() Destroys this Plugin and removes it from its Viewer. |
|
public |
Logs an error message to the JavaScript developer console, prefixed with the ID of this Plugin. |
|
public |
Fires an event on this Plugin. |
|
public |
Returns true if there are any subscribers to the given event on this Plugin. |
|
public |
Logs a message to the JavaScript developer console, prefixed with the ID of this Plugin. |
|
public |
Cancels an event subscription that was previously made with Plugin#on or Plugin#once. |
|
public |
Subscribes to an event on this Plugin. |
|
public |
Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd. |
|
public |
scheduleTask(task: *) Schedule a task to perform on the next browser interval |
|
public |
Logs a warning message to the JavaScript developer console, prefixed with the ID of this Plugin. |
Public Constructors
public constructor(viewer: Viewer, cfg: Object) source
Creates this Plugin and installs it into the given Viewer.
Override:
Plugin#constructorParams:
Name | Type | Attribute | Description |
viewer | Viewer | The Viewer. |
|
cfg | Object |
|
Plugin configuration. |
Public Members
public gltfLoader: GLTFLoaderPlugin source
The GLTFLoaderPlugin used internally to load the converted GLTF.
Public Methods
public async load(params: Object): Promise<SceneModel> source
Loads an IFC model from the given source.
Params:
Name | Type | Attribute | Description |
params | Object |
|
Loading parameters. |
params.src | string | Path to an IFC file. |
|
params.progressCallback | Function |
|
Callback to track loading progress. |
params.progressTextCallback | Function |
|
Callback to track loading progress with text updates. |