Overview
OpenGeometry can export B-Reps to binary STL. You can export a single B-Rep payload or export a whole scene throughOGSceneManager.
The WebAssembly build returns STL as bytes (
Uint8Array). You are responsible for downloading or
persisting those bytes. Some file-writing convenience methods exist only in native builds.Initialization
Initialize the WASM module once before usingOGSceneManager:
Export APIs
exportBrepToStl
Export a single serialized B-Rep JSON string to STL bytes.exportSceneToStl / exportCurrentSceneToStl
Export a stored scene (or the current scene) to STL bytes.Result type
export*ToStl(...) returns an OGStlExportResult:
Uint8Array
The binary STL bytes.
string
A JSON string containing export statistics (triangle counts, skipped faces, topology errors).
Config JSON
All STL 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
StlExportConfig shape.
Default configuration (Rust):
Examples
Export a wrapper shape to STL
OGSceneManager expects a serialized B-Rep string. Wrapper shapes expose one of getBrep(),
getBrepData(), or getBrepSerialized() depending on the type.
Download STL in the browser
Write STL in Node.js
Native-only file export
Native-only builds also expose
exportSceneToStlFile(...) (not available in browser/WASM builds).Related
- Exports for an overview of available exporters and runtime constraints
- STEP export (experimental)
- IFC export (experimental)

