A new open-source converter evaluates OpenSCAD files and rebuilds them as exact solid geometry, so a cylinder arrives at the machine shop as a circle. It went live on GitHub and npm on November 24.

If you design in OpenSCAD, you already know the dead end. You write code, you get a clean parametric model, and the moment you need to hand that model to a machine shop, a mold maker, or anyone living in SolidWorks or Fusion, your cylinder stops being a cylinder. It becomes a few thousand flat facets wearing a cylinder costume. STEP files made from meshes are worse than useless to anyone who needs to measure or edit them, which is why so many OpenSCAD projects die at the STL boundary.

On November 24, a company called Forgent3D released a tool that attacks exactly this problem. It is called openscad-to-step, it is published on npm and on GitHub, and the claim in its first line is simple: convert OpenSCAD files to STEP with real curved surfaces, not triangles.

How it works under the hood

The approach is smarter than a geometry hack. The tool runs the real thing. Forgent3D maintains a fork of OpenSCAD, compiled to WebAssembly, that evaluates your file exactly as the desktop app would: modules, loops, include and use statements, functions, and Customizer parameters all behave normally. The fork adds one capability, exporting the evaluated tree at full precision. Stock OpenSCAD's own .csg export keeps six significant digits, which is one reason naive mesh-to-STEP conversions have always looked sad.

From the evaluated tree, the converter writes a Python model in the build123d library, one line per primitive, transform, and boolean, each annotated with a comment pointing back to the .scad call that produced it. That is genuinely nice for debugging. Then an OCCT-based engine, shipped as the closed-source but free-to-use package @forgent3d/cad-build, builds the model as exact boundary representation and writes the STEP. Everything runs locally as WebAssembly, and nothing is uploaded to a server, which matters more than Forgent3D probably gives itself credit for.

What comes out exact, and what does not

The interesting part is how carefully the edge cases were thought through. Circles are true circles regardless of your $fn setting, with one clever exception: if $fn is 12 or lower, the tool reads it as a deliberate polygon, so a hex nut you modeled as a 6-sided prism stays a hex nut instead of becoming a suspiciously round one. text() uses OpenSCAD's own glyph outlines. hull() and minkowski() come out exact for the common cases like rounded boxes and slots, and fall back to facets for exotic combinations. BOSL2 is built in, and its cuboid, cyl, spheroid, prismoid and spur gear shapes with roundings are rebuilt as real surfaces. MCAD and Write.scad ship with it.

Some things stay faceted, and the list is honest: twisted linear_extrude, imported STL, OFF and 3MF files, surface(), roof(), and projection with cut disabled. The part I respect most: whenever the STEP is less exact than your source, the tool prints a warning with the .scad line number. It never substitutes facets silently. Every CAD converter I have ever fought with has lied to me by omission; this one refuses to.

Practical notes: it needs Node.js 20 or later, and the first run downloads about 30 MB, 60 MB installed, for the engines. The converter is AGPL-3.0 with a commercial license available if your company chokes on that. There is a library API and a --model-py flag if you want the generated build123d source as a bonus artifact.

My take

This repo is three days old and has seven stars, so calibrate accordingly. It is not production CAD and the closed-source engine is a dependency you would want to keep an eye on. But STEP is the language machine shops, contract manufacturers, and injection molders actually speak, and OpenSCAD has been second-class in that conversation for its entire existence because of a format limitation, not a modeling one. Whoever forked OpenSCAD for this deserves credit too; the modified fork is under GPL.

If you maintain any OpenSCAD project that ever gets quoted by a CNC shop, this is worth a Friday afternoon. Try your nastiest file, post the failures to the issue tracker, and give it a few releases. The maintainers say the most useful contribution is simply .scad files that break it. Mine will be a BOSL2 bracket with threaded inserts.

Disclosure: Some links are affiliate links. We may earn a small commission at no extra cost to you.

Comments (0)

No comments yet. Be the first!

Leave a Comment