thatopen-syntax-ifc-loading
Installation
SKILL.md
IFC Loading: IfcLoader & IfcImporter
Overview
IFC loading in ThatOpen converts IFC files into the internal Fragments binary format for high-performance 3D rendering. There are two approaches:
- IfcLoader (high-level,
@thatopen/components) — The standard component for loading IFC files in a ThatOpen application. Wraps web-ifc and handles WASM setup, conversion to fragments, and scene integration. - IfcImporter (low-level,
@thatopen/fragments) — Direct fragment conversion without the component framework. Useful for server-side processing, Web Workers, or custom pipelines.
The time-consuming part is the IFC-to-Fragments conversion, not the actual fragment loading. ALWAYS convert once and store the Fragments binary for fast reloading.
Critical Rules
- ALWAYS call
setup()beforeload()— IfcLoader implementsConfigurable. Callingload()beforesetup()causes WASM initialization failures. - ALWAYS match WASM path version to installed web-ifc version — A version mismatch between the WASM files and the
web-ifcnpm package causes silent parsing failures or crashes. - NEVER hardcode a web-ifc version in the WASM path without checking
package.json— the installed version may differ. - ALWAYS initialize FragmentsManager before loading IFC — Call
fragmentsManager.init(workerURL)before any IFC loading to enable fragment processing.
Related skills