Export STEP Files to GLTF
This tutorial shows you how to convert STEP files to web-optimized GLTF/GLB format - with all processing happening directly in your browser.
Why Export to GLTF?
STEP files preserve precise CAD geometry but aren't optimized for web viewing. GLTF (the "JPEG of 3D") loads quickly in browsers and 3D engines while preserving colors and structure from the original file.
Browser-Based Conversion
All conversions happen entirely in your browser - no files are uploaded to any cloud servers. This has important implications:
Privacy Advantage
Your CAD files never leave your computer. While you do need to use Bitbybit editors to run these conversions, your files are processed locally and are not uploaded to any cloud servers. This is critical for confidential engineering data, proprietary designs, or any situation where data privacy matters.
If you cannot host your files on publicly accessible hosting providers, you can upload them to local browser storage instead. Learn more about this option in our Local Assets guide.
Performance Considerations
Since everything runs locally, conversion speed depends on your device's hardware. For most models, this works great. However, for large or complex STEP files, you may encounter memory limitations.
The standard 32-bit version of Bitbybit can use up to 2 GB of RAM, which may not be enough for larger STEP files. If you're working with complex assemblies or high-detail models, consider using the 64-bit version which supports up to 16 GB of RAM. This makes a significant difference for industrial-scale CAD data.
The Conversion Process
The workflow is simple:
- Fetch the STEP file - Download the compressed
.stpZfile from a URL - Load into OCCT document - Parse it using OpenCASCADE's assembly parser
- Export to GLTF - Convert the document to binary GLB format with automatic download
Export Settings Explained
| Setting | Value | Purpose |
|---|---|---|
meshDeflection | 0.05 | Controls mesh accuracy - smaller = more triangles, higher quality |
meshAngle | 0.5 | Angular tolerance for curved surfaces (in radians) |
mergeFaces | false | Keep faces separate (useful for per-part coloring) |
forceUVExport | true | Include texture coordinates for future texturing |
fileName | "assembly.glb" | Output filename with .glb extension for binary format |
tryDownload | true | Automatically trigger browser download when complete |
Lower meshDeflection values create smoother, more accurate meshes but result in larger files. For web use, values between 0.01 and 0.1 usually provide a good balance. Start with 0.05 and adjust based on your needs.
For larger models, use higher precision values (e.g., 0.1 or higher) to reduce mesh complexity, processing time, and output file size. This helps prevent memory issues and speeds up the conversion.
- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"e0e94797745b9499": {
"id": "e0e94797745b9499",
"name": "bitbybit.asset.fetchFile",
"customName": "fetch file",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"url": "https://learn.bitbybit.dev/files/3d/Soil-Sensor.stpZ"
},
"inputs": {},
"position": [
447.0390625,
364.58203125
]
},
"7985d5e3152d08c3": {
"id": "7985d5e3152d08c3",
"name": "bitbybit.occt.assembly.manager.exportDocumentToGltf",
"customName": "export document to gltf",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"meshDeflection": 0.05,
"meshAngle": 0.5,
"mergeFaces": false,
"forceUVExport": true,
"fileName": "assembly.glb",
"tryDownload": true
},
"inputs": {
"document": {
"connections": [
{
"node": "eec47f3f5ee010c6",
"output": "result",
"data": {}
}
]
}
},
"position": [
1188.0355897483525,
362.60328664485473
]
},
"eec47f3f5ee010c6": {
"id": "eec47f3f5ee010c6",
"name": "bitbybit.occt.assembly.manager.loadStepToDoc",
"customName": "load step to doc",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"stepData": {
"connections": [
{
"node": "e0e94797745b9499",
"output": "result",
"data": {}
}
]
}
},
"position": [
814.4055721184509,
361.15777915160345
]
}
}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="stepData">stepData</variable><variable id="document">document</variable><variable id="gltf">gltf</variable></variables><block type="variables_set" id="fetchStep" x="-562" y="-36"><field name="VAR" id="stepData">stepData</field><value name="VALUE"><block type="bitbybit.asset.fetchFile" id="fetchFile"><value name="Url"><block type="text" id="urlText"><field name="TEXT">https://learn.bitbybit.dev/files/3d/Soil-Sensor.stpZ</field></block></value></block></value><next><block type="variables_set" id="loadDoc"><field name="VAR" id="document">document</field><value name="VALUE"><block type="bitbybit.occt.assembly.manager.loadStepToDoc" id="loadStepToDoc"><value name="StepData"><block type="variables_get" id="getStepData"><field name="VAR" id="stepData">stepData</field></block></value></block></value><next><block type="variables_set" id="exportGltf"><field name="VAR" id="gltf">gltf</field><value name="VALUE"><block type="bitbybit.occt.assembly.manager.exportDocumentToGltf" id="exportDoc"><value name="Document"><block type="variables_get" id="getDoc"><field name="VAR" id="document">document</field></block></value><value name="MeshDeflection"><block type="math_number" id="meshDeflection"><field name="NUM">0.05</field></block></value><value name="MeshAngle"><block type="math_number" id="meshAngle"><field name="NUM">0.5</field></block></value><value name="MergeFaces"><block type="logic_boolean" id="mergeFaces"><field name="BOOL">FALSE</field></block></value><value name="ForceUVExport"><block type="logic_boolean" id="forceUV"><field name="BOOL">TRUE</field></block></value><value name="FileName"><block type="text" id="fileName"><field name="TEXT">assembly.glb</field></block></value><value name="TryDownload"><block type="logic_boolean" id="tryDownload"><field name="BOOL">TRUE</field></block></value></block></value></block></next></block></next></block></xml>
// Import required DTOs for assembly operations
const { LoadStepToDocDto, ExportDocumentToGltfDto } = Bit.Inputs.OCCT;
type TDocStdDocumentPointer = Bit.Inputs.OCCT.TDocStdDocumentPointer;
// Get access to modules
const { asset } = bitbybit;
const { manager } = bitbybit.occt.assembly;
const start = async () => {
// Fetch the STEP file from URL
const stepData = await asset.fetchFile({
url: "https://learn.bitbybit.dev/files/3d/Soil-Sensor.stpZ"
});
// Load STEP data into an OCCT document
const loadDocOpt = new LoadStepToDocDto();
loadDocOpt.stepData = stepData;
const document = await manager.loadStepToDoc(loadDocOpt);
// Export the document to GLTF (binary GLB format)
const exportOpt = new ExportDocumentToGltfDto<TDocStdDocumentPointer>();
exportOpt.document = document;
exportOpt.meshDeflection = 0.05;
exportOpt.meshAngle = 0.5;
exportOpt.mergeFaces = false;
exportOpt.forceUVExport = true;
exportOpt.fileName = "assembly.glb";
exportOpt.tryDownload = true;
const gltfData = await manager.exportDocumentToGltf(exportOpt);
console.log("GLTF exported successfully!", gltfData);
}
// Execute the main function
start();
What Happens After Export?
When you run these examples with tryDownload: true, your browser will automatically download the GLB file. You can then:
- View it in any GLTF viewer (like gltf-viewer.donmccurdy.com)
- Use it in game engines like Unity, Unreal, or Godot
- Embed it in websites using Three.js, BabylonJS, or model-viewer
- Share it with clients who don't have CAD software
Conclusion
You've learned how to convert STEP files to GLTF directly in the browser - no server or desktop software required! This opens up powerful possibilities for CAD visualization, e-commerce product displays, and engineering documentation.
The key takeaway: Bitbybit brings industrial-grade CAD processing to the web, making it easy to bridge the gap between engineering data and modern 3D experiences.



