Overview
OpenGeometry can export B-Reps and scenes to IFC4 (text / Part 21 style). You can export a single B-Rep payload or export a whole scene throughOGSceneManager. IFC export supports an
optional semantics mapping that lets you control which IFC classes to emit and attach properties.
Initialization
Initialize the WASM module once before usingOGSceneManager:
Export APIs
exportBrepToIfc
exportSceneToIfc / exportCurrentSceneToIfc
Result type
export*ToIfc(...) returns an OGIfcExportResult:
IFC text output.
A JSON string containing export statistics (elements written, semantics applied, fallbacks, and more).
Config JSON
All IFC exports accept an optionalconfig_json string. If it is null, undefined, or an empty
string, OpenGeometry uses defaults. If you provide config_json, it must deserialize into the full
IfcExportConfig shape (required fields must be present).
Example JSON payload:
Semantics mapping
Thesemantics map is keyed by your entity_id values in the scene. When you specify
ifc_class, OpenGeometry validates it against the allowed list and:
- Uses the requested class when it is supported
- Falls back to
IFCBUILDINGELEMENTPROXYin best-effort mode - Errors in strict mode
IFCBUILDINGELEMENTPROXYIFCWALLIFCSLABIFCCOLUMNIFCBEAMIFCMEMBERIFCDOORIFCWINDOWIFCROOFIFCSTAIRIFCRAILINGIFCFOOTING
Examples
Export and download IFC in the browser
Native-only file export
Native-only builds also expose
exportSceneToIfcFile(...) (not available in browser/WASM builds).Related
- Exports for an overview of available exporters and runtime constraints
- STL export
- STEP export (experimental)
- Scene Management - Organizing geometry entities

