<p>Even though OpenSCAD can import a variety of formats, the file structure will not be accepted by Thingiverse in the manner presented by the OP.</p>

<p>OpenSCAD is a text-based description language. One creates parameters assigned to specific aspects of a model and implements those parameters to create the desired shapes/components by typing in a text editor. The native editor for OpenSCAD provides for some management, but notepad or equivalent would work just as well.</p>

<p>The file format of OpenSCAD is text. None of the CAD type modeling programs will provide equivalent text output.</p>

<p>For your objective, you'd have to learn the basics of OpenSCAD (not particularly difficult) and reference the parameters in the STEP files, then assign them to the appropriate labels in OpenSCAD.</p>

<p>If you have particularly complex designs, it can be a handful. It can also be rewarding when you change a parameter as a test and the complete model follows as expected.</p>

CC BY-SA 4.0
2020-03-27T18:40:02.223Z
I find pure text based input a PITA - and never worth the effort.
Trish
CC BY-SA 4.0
2020-03-28T01:00:12.960Z
I find anything I can't edit as pure text a PITA and never worth the effort - the effort ends up being all wasted when you want to change something and have to start over.
R.. GitHub STOP HELPING ICE
CC BY-SA 4.0
2020-03-28T01:02:03.007Z
WIth that said, though, I think there should be some reasonable way to automate conversion of these formats into clean, editable OpenSCAD source. It just might (or rather almost certainly will) take some programming (in whatever language you prefer) to do it.
R.. GitHub STOP HELPING ICE
CC BY-SA 4.0
2020-03-27T18:13:35.550Z
2020-03-27T18:13:35.550Z
fred_dot_u
<p>Actually there's a solution, albeit not directly from within openscad.
I've just found this:</p>
<p><a href="https://github.com/agordon/openscad-step-reader/tree/master" rel="nofollow noreferrer">https://github.com/agordon/openscad-step-reader/tree/master</a></p>
<p>You will need to install or build yourself opencascade, and then it's a matter of running a command line tool to convert a .step to a .scad file.</p>
<p>I've just done it to be able to import a Thorlabs designed optomechanical item into scad and it works swell.</p>
<pre><code>./openscad-step-reader --stl-scad RM1B-Step.step &gt; RM1B-Step.scad
</code></pre>
<p>Then open the converted .scad file.
If you want to try, the item can be seen <a href="https://www.thorlabs.com/thorproduct.cfm?partnumber=RM1B" rel="nofollow noreferrer">here</a>, get the step file from the list of document.</p>
<p>The result in openscad:</p>
<p><a href="https://i.sstatic.net/zvGP3.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/zvGP3.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2023-10-06T08:02:35.080Z
2023-10-06T08:02:35.080Z
calocedrus
<p>I managed to get openscad-step-reader to compile, but I had to jump through a few hoops:</p>
<ol>
<li><p>Run the <code>apt-get</code> install command from the beginning of the Makefile:<br />
<code>apt-get install libocct-data-exchange-dev libocct-draw-dev libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev libtbb-dev</code></p>
</li>
<li><p>Ignore anything to do with <code>cmake</code>. I can get <code>cmake</code> to work by creating a <code>CMakeLists.txt</code> file, but I couldn't get the <code>Makefile</code> it generates to work.</p>
</li>
<li><p>Edit <code>triangle.h</code> and replace</p>
<ul>
<li><code>ostream</code> with <code>std::ostream</code> [2 changes]</li>
<li><code>endl</code> with <code>std::endl</code> [3 changes]</li>
</ul>
</li>
<li><p>Edit <code>openscad-step-reader.cpp</code> and replace</p>
<ul>
<li><code>endl</code> with <code>std::endl</code> [1 change]</li>
</ul>
</li>
<li><p>Edit <code>explore-shape.cpp</code> and add</p>
<ul>
<li><code>#include &lt;GeomAbs_SurfaceType.hxx&gt;</code></li>
<li><code>#include &lt;BRepAdaptor_Surface.hxx&gt;</code></li>
</ul>
</li>
<li><p>Edit the <code>Makefile</code> and change</p>
<ul>
<li><code>7.3.0</code> to <code>7.5.2</code> [2 changes]
(I realise a better solution would be desirable for this!)</li>
</ul>
</li>
<li><p>Run <code>make</code>. The <code>.o</code> files should be created, but the <code>cc</code> command will fail (after a longish time), citing 'undefined reference' 783 times</p>
</li>
<li><p>Copy the <code>cc</code> command that was printed whilst running make, and put all the <code>.o</code> files before all the <code>-l</code> arguments, like this:</p>
</li>
</ol>
<pre><code>cc openscad-step-reader.o tessellation.o openscad-triangle-writer.o explore-shape.o -lTKSTL -lTKXDESTEP -lTKBinXCAF -lTKXmlXCAF -lTKXDEIGES -lTKXCAF -lTKIGES -lTKSTEP -lTKSTEP209 -lTKSTEPAttr -lTKSTEPBase -lTKXSBase -lTKStd -lTKStdL -lTKXml -lTKBin -lTKXmlL -lTKBinL -lTKCAF -lTKXCAF -lTKLCAF -lTKCDF -lTKMeshVS -lTKOpenGl -lTKV3d -lTKService -lTKXMesh -lTKMesh -lTKOffset -lTKFeat -lTKFillet -lTKHLR -lTKBool -lTKBO -lTKShHealing -lTKPrim -lTKTopAlgo -lTKGeomAlgo -lTKBRep -lTKGeomBase -lTKG3d -lTKG2d -lTKIGES -lTKSTEP -lTKSTEP209 -lTKSTEPAttr -lTKSTEPBase -lTKXSBase -lTKStd -lTKStdL -lTKXml -lTKBin -lTKXmlL -lTKBinL -lTKCAF -lTKLCAF -lTKCDF -lTKMeshVS -lTKOpenGl -lTKV3d -lTKService -lTKXMesh -lTKMesh -lTKOffset -lTKFeat -lTKFillet -lTKHLR -lTKBool -lTKBO -lTKShHealing -lTKPrim -lTKTopAlgo -lTKGeomAlgo -lTKBRep -lTKGeomBase -lTKG3d -lTKG2d /usr/lib/x86_64-linux-gnu/libTKMath.so.7.5.2 /usr/lib/x86_64-linux-gnu/libTKernel.so.7.5.2 -lfreetype -lpthread -lrt -lstdc++ -ldl -lm   -o openscad-step-reader
</code></pre>
<p>Now, for me, the program will compile. My system is running Ubuntu Focal Fossa 20.04.6 LTS. I contacted the author (Gordon Assaf) but he said he was no longer working on the project. For me, this has been a godsend, since it allows me to import .step files downloaded from the Swagelok website into my OpenSCAD design.</p>

CC BY-SA 4.0
2024-01-03T14:58:52.550Z
2024-01-03T15:06:20.267Z
2024-01-03T15:06:20.267Z
WJG
<p>I work with Fusion360 for designing lots of things. Recently I learned how to work with parameters that I can easily modify all at once, allowing to pretty much make easily customizable pieces.</p>

<p>Now, Thingiverse wants customizer pieces in the shape of <code>.SCAD</code> files, and some people just can't work with Fusion360 (<code>.F3D</code>) or proper <code>.STEP</code> files that can be imported by most CAD programs.</p>

<p>I have no experience with OpenSCAD. Can I import my <code>.STEP</code> into openSCAD, retain my parameters and export it as a <code>.SCAD</code>, and if yes, how?</p>

<file-formats><openscad><fusion360>
.STEP/.F3D to .SCAD file?
Trish
# .STEP/.F3D to .SCAD file?

(Asked by: username_0 on 2020-03-27)

I work with Fusion360 for designing lots of things. Recently I learned how to work with parameters that I can easily modify all at once, allowing to pretty much make easily customizable pieces.

Now, Thingiverse wants customizer pieces in the shape of `.SCAD` files, and some people just can't work with Fusion360 (`.F3D`) or proper `.STEP` files that can be imported by most CAD programs.

I have no experience with OpenSCAD. Can I import my `.STEP` into openSCAD, retain my parameters and export it as a `.SCAD`, and if yes, how?

**Tags:** file-formats, openscad, fusion360


---

## 3 answers

### Answer by username_1 on 2020-03-27. Score: 3 | Accepted answer

Even though OpenSCAD can import a variety of formats, the file structure will not be accepted by Thingiverse in the manner presented by the OP.

OpenSCAD is a text-based description language. One creates parameters assigned to specific aspects of a model and implements those parameters to create the desired shapes/components by typing in a text editor. The native editor for OpenSCAD provides for some management, but notepad or equivalent would work just as well.

The file format of OpenSCAD is text. None of the CAD type modeling programs will provide equivalent text output.

For your objective, you'd have to learn the basics of OpenSCAD (not particularly difficult) and reference the parameters in the STEP files, then assign them to the appropriate labels in OpenSCAD.

If you have particularly complex designs, it can be a handful. It can also be rewarding when you change a parameter as a test and the complete model follows as expected.

> **Comments:**
> **username_0**: I find pure text based input a PITA - and never worth the effort.  
> **username_2**: I find anything I can't edit as pure text a PITA and never worth the effort - the effort ends up being all wasted when you want to change something and have to start over.  
> **username_2**: WIth that said, though, I think there should be some reasonable way to automate conversion of these formats into clean, editable OpenSCAD source. It just might (or rather almost certainly will) take some programming (in whatever language you prefer) to do it.  

---

### Answer by username_3 on 2023-10-06. Score: 3

Actually there's a solution, albeit not directly from within openscad.
I've just found this:

<https://github.com/agordon/openscad-step-reader/tree/master>

You will need to install or build yourself opencascade, and then it's a matter of running a command line tool to convert a .step to a .scad file.

I've just done it to be able to import a Thorlabs designed optomechanical item into scad and it works swell.

```
./openscad-step-reader --stl-scad RM1B-Step.step > RM1B-Step.scad

```

Then open the converted .scad file.
If you want to try, the item can be seen [here](https://www.thorlabs.com/thorproduct.cfm?partnumber=RM1B), get the step file from the list of document.

The result in openscad:

[![enter image description here](https://i.sstatic.net/zvGP3.png)](https://i.sstatic.net/zvGP3.png)


---

### Answer by username_4 on 2024-01-03. Score: 2

I managed to get openscad-step-reader to compile, but I had to jump through a few hoops:

1. Run the `apt-get` install command from the beginning of the Makefile:  
   `apt-get install libocct-data-exchange-dev libocct-draw-dev libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev libtbb-dev`
2. Ignore anything to do with `cmake`. I can get `cmake` to work by creating a `CMakeLists.txt` file, but I couldn't get the `Makefile` it generates to work.
3. Edit `triangle.h` and replace

   * `ostream` with `std::ostream` [2 changes]
   * `endl` with `std::endl` [3 changes]
4. Edit `openscad-step-reader.cpp` and replace

   * `endl` with `std::endl` [1 change]
5. Edit `explore-shape.cpp` and add

   * `#include <GeomAbs_SurfaceType.hxx>`
   * `#include <BRepAdaptor_Surface.hxx>`
6. Edit the `Makefile` and change

   * `7.3.0` to `7.5.2` [2 changes]
     (I realise a better solution would be desirable for this!)
7. Run `make`. The `.o` files should be created, but the `cc` command will fail (after a longish time), citing 'undefined reference' 783 times
8. Copy the `cc` command that was printed whilst running make, and put all the `.o` files before all the `-l` arguments, like this:

```
cc openscad-step-reader.o tessellation.o openscad-triangle-writer.o explore-shape.o -lTKSTL -lTKXDESTEP -lTKBinXCAF -lTKXmlXCAF -lTKXDEIGES -lTKXCAF -lTKIGES -lTKSTEP -lTKSTEP209 -lTKSTEPAttr -lTKSTEPBase -lTKXSBase -lTKStd -lTKStdL -lTKXml -lTKBin -lTKXmlL -lTKBinL -lTKCAF -lTKXCAF -lTKLCAF -lTKCDF -lTKMeshVS -lTKOpenGl -lTKV3d -lTKService -lTKXMesh -lTKMesh -lTKOffset -lTKFeat -lTKFillet -lTKHLR -lTKBool -lTKBO -lTKShHealing -lTKPrim -lTKTopAlgo -lTKGeomAlgo -lTKBRep -lTKGeomBase -lTKG3d -lTKG2d -lTKIGES -lTKSTEP -lTKSTEP209 -lTKSTEPAttr -lTKSTEPBase -lTKXSBase -lTKStd -lTKStdL -lTKXml -lTKBin -lTKXmlL -lTKBinL -lTKCAF -lTKLCAF -lTKCDF -lTKMeshVS -lTKOpenGl -lTKV3d -lTKService -lTKXMesh -lTKMesh -lTKOffset -lTKFeat -lTKFillet -lTKHLR -lTKBool -lTKBO -lTKShHealing -lTKPrim -lTKTopAlgo -lTKGeomAlgo -lTKBRep -lTKGeomBase -lTKG3d -lTKG2d /usr/lib/x86_64-linux-gnu/libTKMath.so.7.5.2 /usr/lib/x86_64-linux-gnu/libTKernel.so.7.5.2 -lfreetype -lpthread -lrt -lstdc++ -ldl -lm   -o openscad-step-reader

```

Now, for me, the program will compile. My system is running Ubuntu Focal Fossa 20.04.6 LTS. I contacted the author (Gordon Assaf) but he said he was no longer working on the project. For me, this has been a godsend, since it allows me to import .step files downloaded from the Swagelok website into my OpenSCAD design.


---

