Convert STEP to STL (Stereo Lithography File)
This sample program creates STL descriptions for STEP CAD data. The STL description can be passed to an additive manufacturing system or other software.
It finds the assemblies in a file and creates meshes for all component geometry. Next, it prints the mesh data in the STL format. The STL format has no notion of assembly structure, so each mesh must be transformed into the proper place in the assembly.
The program cretes the STL shown below from a sample STEP assembly, but you can adapt it to your own input sources or output destinations as needed. The code can write either ASCII text STL or binary STL. By default, it writes text, but you can change the "do_binary" flag in the main() if you would prefer binary output.