|
| 1 | +--- |
| 2 | +slug: step-assembly-support-v1-rc1 |
| 3 | +title: "STEP Assembly Support: Load, Parse, and Export Professional CAD Files" |
| 4 | +authors: [ubarevicius] |
| 5 | +tags: [occt, assembly, step, gltf, cad, freecad] |
| 6 | +description: "Bitbybit v1.0.0-rc.1 introduces STEP assembly support - load complex CAD files, parse part hierarchies, extract components, preserve colors, and export to GLTF or STEP formats." |
| 7 | +image: https://ik.imagekit.io/bitbybit/app/assets/blog/step-assembly-support/step-assembly-support-occt-bitbybit.webp |
| 8 | +--- |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +import Tabs from '@theme/Tabs'; |
| 13 | +import TabItem from '@theme/TabItem'; |
| 14 | + |
| 15 | +If you've ever tried to load, edit or create a complex STEP assembly in a web browser, you know how tricky it can be. STEP is the standard format engineers use to share CAD models, but browsers don't understand it natively. You usually need desktop software or a server to convert it. |
| 16 | + |
| 17 | +With **Bitbybit v1.0.0-rc.1**, that changes. You can now load STEP assemblies directly in the browser, explore their structure, extract individual parts, and export to web-friendly formats. Everything runs locally using Bitbybit OCCT WebAssembly. |
| 18 | + |
| 19 | +<!-- truncate --> |
| 20 | + |
| 21 | +## What Can You Do? |
| 22 | + |
| 23 | +You can load a STEP file and see its full assembly tree, just like you would in FreeCAD or SolidWorks. Each part has a label (something like `0:1:1:3`) that you can use to extract that specific piece. |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +Colors are parsed too. Regular STEP exports lose color data, but we use OCCT's XCAF format to embed colors into the assembly structure. This also works if users export a colored model from Bitbybit and open it in FreeCAD or other CAD software. |
| 29 | + |
| 30 | +You can also convert assemblies to GLTF/GLB format for use in games, web viewers, or AR applications. And since everything happens in your browser, your files never leave your computer. |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +## Parametric Scripts to STEP Assemblies |
| 35 | + |
| 36 | +This is where the workflow really shines. You can build parametric geometry in Bitbybit - using visual programming or TypeScript - and export it directly to STEP format with colors preserved. Change a parameter, re-run the script, and download a new STEP file ready for manufacturing or further CAD work. |
| 37 | + |
| 38 | +Imagine a product configurator where customers adjust dimensions, then download a professional CAD file they can send to a machine shop. Or a design tool that generates custom brackets based on user inputs. The geometry is created algorithmically, but the output is the same format that engineers use in SolidWorks or Fusion 360. |
| 39 | + |
| 40 | +Furthermore - part instances and colors are supported, so users of third party CAD applications will be able to load these optimized assets in efficient manner. |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +## Why Does This Matter? |
| 47 | + |
| 48 | +Real products aren't single shapes. A bicycle has wheels, a frame, handlebars. An electronic device has a case, buttons, internal components. Engineers design each part separately, then assemble them digitally. |
| 49 | + |
| 50 | +STEP files preserve this structure. When you load one, you get the full hierarchy of parts and sub-assemblies, along with names, colors, and positions. This is useful for building product configurators, design review tools, or documentation systems where you need to work with individual components. |
| 51 | + |
| 52 | +## The API |
| 53 | + |
| 54 | +There are two groups of methods. The **Manager** methods let you build and export assemblies: `createPart`, `createAssemblyNode`, `createInstanceNode`, `combineStructure`, `buildAssemblyDocument`, `exportDocumentToStep`, and `exportDocumentToGltf`. |
| 55 | + |
| 56 | +The **Query** methods let you inspect existing documents: `getDocumentParts`, `getAssemblyHierarchy`, `getShapeFromLabel`, `getLabelColor`, `getLabelTransform`, and `getLabelInfo`. |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +## Visual Programming |
| 61 | + |
| 62 | +If you use Rete or Blockly, we've added components for all of this. The hierarchy preview is especially handy - it shows the assembly tree and lets you click on any item to see its label, which you can then use to extract that part. |
| 63 | + |
| 64 | +## Your Files Stay Private |
| 65 | + |
| 66 | +Everything runs in your browser. OCCT is compiled to WebAssembly, so parsing and exporting happens locally. Your files are never uploaded anywhere. This matters if you're working with proprietary designs. |
| 67 | + |
| 68 | +:::warning Memory Note |
| 69 | +Large assemblies need memory. The standard build supports up to 2GB. For complex models, use the 64-bit version (up to 16GB). |
| 70 | +::: |
| 71 | + |
| 72 | +## Tutorials |
| 73 | + |
| 74 | +We have step-by-step tutorials to get you started: |
| 75 | + |
| 76 | +- [Introduction to Assemblies](/learn/code/common/occt/assembly/intro) - the basics |
| 77 | +- [Convert STEP to GLTF](/learn/code/common/occt/assembly/step-to-gltf) - for web viewing |
| 78 | +- [Parse Assembly Structure](/learn/code/common/occt/assembly/assembly-structure) - explore parts |
| 79 | +- [Build and Export Assemblies](/learn/code/common/occt/assembly/create-assembly) - create from scratch |
| 80 | +- [Export Shapes with Color](/learn/code/common/occt/assembly/shape-to-step-with-color-assembly) - preserve colors |
| 81 | + |
| 82 | +Each one has examples in Rete, Blockly, and TypeScript. |
| 83 | + |
| 84 | +## Example: Load and Display a STEP Assembly |
| 85 | + |
| 86 | +Here's the simplest workflow - load a STEP file and display it in the browser: |
| 87 | + |
| 88 | +```typescript |
| 89 | +// Fetch the STEP file |
| 90 | +const stepData = await bitbybit.asset.fetchFile({ |
| 91 | + url: "https://learn.bitbybit.dev/files/3d/Soil-Sensor.stpZ" |
| 92 | +}); |
| 93 | + |
| 94 | +// Convert to GLTF for display |
| 95 | +const glbData = await bitbybit.occt.io.convertStepToGltf({ |
| 96 | + stepData, |
| 97 | + meshPrecision: 0.05 |
| 98 | +}); |
| 99 | + |
| 100 | +// Load into the 3D scene |
| 101 | +await bitbybit.babylon.io.loadGlbFromArrayBuffer({ |
| 102 | + glbData, |
| 103 | + fileName: "model.glb" |
| 104 | +}); |
| 105 | +``` |
| 106 | + |
| 107 | +That's it - three function calls to go from a STEP file to 3D model in the browser. |
| 108 | + |
| 109 | +## What's Next? |
| 110 | + |
| 111 | +This is a release candidate. We're still adding features and improving coordinate system handling for different CAD conventions. If you find issues or have ideas, let us know on [Discord](https://discord.gg/GSe3VMe). |
| 112 | + |
| 113 | +## Credits |
| 114 | + |
| 115 | +The soil sensor model in our tutorials comes from [FarmBot](https://genesis.farm.bot/v1.5/Extras/cad.html), an open-source CNC farming robot. Their CAD files are public domain. |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +**Ready to try it?** Head to the [assembly tutorials](/learn/code/common/occt/assembly) and load your first STEP file. |
0 commit comments