OpenSCAD the Programmers Solid 3D CAD Modeller

172 points - last Tuesday at 9:22 PM

Source

Comments

erjiang yesterday at 6:11 PM
Be aware that the way OpenSCAD works (CSG) makes a lot of things difficult compared to "normal" CAD programs. A lot of common operations, such as arbitrary fillets on various edges, are simply hard to express or do.

The more powerful option is something built on the open-source Open Cascade geometry kernel: FreeCAD, cadquery, or build123d. This also gives you interop with the broader CAD ecosystem by enabling you to import and export STEP files. (Your favorite LLM can advise you on or drive these options as well.)

nayuki today at 1:38 AM
I use OpenSCAD as my primary design tool for 3D modeling. I get things done, but it isn't easy, and it's hard to recommend it to other people. OpenSCAD really requires the user to mathematics, trigonometry, mental visualization, and programming beforehand as prerequisites - unlike mainstream CAD programs which are more point-and-click friendly. Performing fillets and chamfers on corners is quite tedious, and describing a screw thread as a polyhedron is a nightmare, but I overcame these challenges.

On the plus side, I like these things about OpenSCAD:

* The software is open source, so price or pirating are not barriers, you can use it as much as you want on any computer you want for as long as you want, and it can never be taken away from you.

* The program is small and easy to download, not some multi-gigabyte sprawling software package.

* I think you learn to declare variables for parameters very early on, and it feels natural to make every design parametric from the start.

* The textual nature of 3D models means that I can use Git version control, diff between versions, and leverage similar developer-oriented tools that I use for general programming. I suspect that CAD programs that use binary file formats will have to come with their own diff tool and version control system.

* By reading source code, it's possible to follow the thought process of how a 3D model is constructed, and carefully make modifications in the middle of a chain of operations that later operations depend on. In point-and-click CAD, it's not clear to me if it's possible to change things in the middle of a chain.

* The Manifold renderer is so much faster than the old CGAL, resulting in reasonable human-interactive cycle times.

* I ended up writing my own library to cover a bunch of common shapes / use-cases. It does take some effort the first time, but then I keep reusing the results.

wren6991 yesterday at 9:23 PM
If you look at this and you think "wow, I love the idea of CAD-as-code but I wish it was a more sane language" then have a look at CadQuery: https://cadquery.readthedocs.io/en/latest/quickstart.html#qu...

(I recommend CQ-editor for an easy install: https://github.com/CadQuery/CQ-editor/releases/)

It's a similar idea to OpenSCAD, but embedded in Python and using a better geometry kernel. Want to fillet a box in OpenSCAD? Sure, either take the convex hull of 8 spheres, or the minkowski sum of a box and a sphere. Want to fillet a box in CadQuery? .edges().fillet()

Now I'm hearing some protests about Python, but consider this example OpenSCAD code:

    x = 1;
    echo(x);
    x = 2;
In most languages you would expect this to print "1". In OpenSCAD, the last assignment wins and it prints "2".
socializer today at 3:23 AM
There's a long history of programmers trying to reduce 3D design to programming. I still remember POV-Ray, which was a big thing in the 1990s. But in the end, it's just a very inconvenient way to iterate on shapes by editing code. Kinda like drawing a comic strip by writing SVG by hand. Effortless interactivity rules.

Many CAD programs incorporate parametric modeling, scripting languages, or Scratch-like "block programming" tools for when you actually need flexibility for a specific assembly. But that's where it belongs: an add-on for an interactive modeler. You don't need to write code draw a helix, but if you need a variable number of scaled copies, there's a parametric tool for that.

I guess these tools may be useful to LLMs because it's cheaper for them to generate a program than to perform computer-use tasks in a UI. But I wouldn't recommend humans to start with OpenSCAD.

jacquesm yesterday at 6:00 PM
The one you want is the experimental build, it is way faster to the point that 'preview mode' should be disabled. I use OpenSCAD a lot, it ties right into my workflow and plays nice with versioning and re-using modules from one project to another. Over time I've built up a nice library of parts that I can quickly customize for whatever it is that I'm building. Latest project: pick-and-place machine modification for Prusa MK3 3D printers (an interesting challenge, to put it mildly), now working on some robotics stuff.

The most important thing about OpenSCAD for programmers to remember is that it looks as if you are programming but really you are describing geometry and objects so things like variables and such do not quite work in the way you would expect from a programmers point of view.

YuechenLi yesterday at 6:47 PM
Oh, since this came up, for people who like code CAD and want to try something more powerful than OpenSCAD:

https://github.com/yuechen-li-dev/Aetheris/

Not an OpenCascade wrapper, it's based off my own experimental BREP geometry kernel. So, fillets/chamfers work, booleans works fairly robustly, surfacing, sheet metal, etc all works decently, it exports STEP AP242 by default.

Haven't had time to get the AIs to write a more up to date documentation and polish the language server. Not the easiest thing to use right now, so, using it through Codex/Claude Code or CLI is probably the easiest way to get started.

Still working on the webUI currently, in case someone want to DIY the UI. Note that the WASM compilation path is still unoptimized and way slower than the RyuJIT C# compilation though.

https://github.com/yuechen-li-dev/helioscad

btreecat today at 1:30 PM
I appreciate what OpenSCAD brought us, but there's not much value in it today.

If you want the same script support, but also have an actual tool that can take over when your model is no longer symmetrical, free CAD works v well.

You can enable OpenSCAD support, but I really don't think it's more efficient at getting me to my final geometry.

jeffbarr yesterday at 6:55 PM
I have been using OpenSCAD to create cool geometric designs for 3D printing on fabric, with great results. The functional model is likely unfamiliar to most developers, but I have found that I can be efficient and productive with it.

Check out my repos of OpenSCAD objects at https://github.com/jeffbarr/OpenSCADObjects and Truchet Tilings at https://github.com/jeffbarr/TruchetTilings .

My code kind of looks like the C that I wrote in the 1980s, with lots of braces and careful indenting -- not sure if that is a bug or a feature.

As another commenter noted, use the latest nightly build for best results.

maouida yesterday at 7:52 PM
Shamelss plug:

I have built FluidCAD[1] to overcome the issues of CAD by code, less mental effort to design by providing visual guidance. Slowly it became more of a hybrid CAD experience (mouse or code driven), almost all features now can be done by mouse and the code is generated for you. It'll pick the right selection filters for you.

https://github.com/Fluid-CAD/FluidCAD

https://fluidcad.io/

dgroshev today at 11:33 AM
This framing misses that "traditional" CAD is programming, too. It's declarative and implicit, but what's happening in Fusion or Shapr3d or Solidworks is you're building a DAG of operations and objects, with all the clicking around serving to just select the nodes and their arguments.

It's exactly the same as "regular" programming: you have ways to abstract things (projections, imported components, linked copied components), there needs to be a reasonable architecture (the way dimensions and constraints are flowing off each other), it's possible to write "tests" (driven dimensions are a kind of a test if you squint). It's just not explicit text, which throws people off.

gorgoiler today at 9:25 AM
There is lots of discussion here about OpenSCAD vs the OpenCascade family. I recently modeled a simple plaque with cadquery and was surprised how long the rendering took. A full 30+ seconds for a lathed part with text extrusion and a radial pattern of cutouts.

For me, modeling is just as much about figuring out the shape and features of an object as it is producing a STEP. I would love to model an object in a GUI then re-edit the file with code and re-render with a library, not the least reason being that GUI tools render multiple orders of magnitude faster.

looofooo0 yesterday at 5:52 PM
Yes, also have a look at build123d which has a vscode plugin.
dvh yesterday at 6:34 PM
I use openscad for all my kicad 3d models via scad->off->obj->(manually edit in mm3d to add colors)->wrl->kicad

It's not as bad as it looks, it's all automatic except adding colors which takes about 2 minutes.

jmpman today at 1:50 AM
I never learned Solidworks or any other "proper" CAD packages and have always hacked my way to success with OpenSCAD. Fundamentally there are tons of shortcomings, but where it's recently become a joy is with AI. I can have Claude design something in OpenSCAD, and then I'll copy and paste it over to OpenAI, asking for it to review. A few back and forth cycles and the resulting output is surprisingly solid. If there's something I don't like, I'll just make a few edits, and send it back to the AI to parameterize (and critique). Once I have a good first draft on OpenSCAD, I'd like the AIs to then convert it to a true CAD package to productionalize... haven't achieved that yet.
TGower yesterday at 5:48 PM
It would be interesting to see a head to head comparison of frontier LLMs building models with OpenSCAD, Blender scripting, and Fusion MCP. My intuition would be that blender winds up the best for the immediate result due to training data prevalence and RL tuning, but the concise nature of OpenSCAD could help.

I'll have to add this to my backlog of experiments to try when I have unused tokens near a reset...

Mazer23 today at 3:54 AM
I spent quite a bit of time using openscad which Claude code to try to build a capstan (rope driven) joint for robotics. It worked well but had some issues with agentic stuff and speed. In the end I ended up taking a detour and building my own agentic cad modeling harness based on some of the same open source libraries that openscad uses. Now I’m trying to turn that into its own standalone product. You can check it out at http://partforge.ai
IgorPartola yesterday at 11:05 PM
I have a love/hate relationship with OpenSCAD. The idea of coding up shapes is neat and for some things that’s the path of least resistance. On the other hand nothing in OpenSCAD really makes clean code the happy path. Sometimes it is just easier to hardcode a known value or to design a part in a way that is difficult to modify later. Yes you have modules but what a module is is arbitrary. The idea that by default things are positioned globally and you can’t attach two parts to each other is rough. The fact that it generates surfaces and not solids means you can’t export 3D models into other software if you use hull().

Yet I tried alternatives and found them way too complex with their UI. I have a FreeCAD tutorial bookmarked so when I find a dozen hours to learn it I will. In the meantime when I need something simple and quick, OpenSCAD gets me there.

WillAdams yesterday at 6:39 PM
One of my favourite tools.

As noted, use the Nightly builds from: https://openscad.org/downloads.html#snapshots

When working with kids, it's well worth keeping: https://www.blockscad3d.com/editor/ in mind, or for folks who like to draw connections: https://github.com/derkork/openscad-graph-editor

Eventually, someone will note that its programming model limits variables and so forth --- for folks who want a more traditional language choice there are a number of options, notably for Python:

https://pythonscad.org/

SoKamil today at 10:19 AM
Recently, whole Adobe suite was recreated with AI[1]. Is there such an initiative in CAD world?

[1]https://github.com/storytold/photocraft

arjie today at 4:48 AM
In practice, I have found better results with `build123d` than with OpenSCAD if one is using current agents with current models. It's a cool tool, yes, but something about the workflow makes it hard for present day agents to work with. Perhaps some kind of custom harness would do the trick, but `build123d` works with Opus 5.5 in more cases than OpenSCAD.
edg5000 today at 4:19 AM
I found Astra to be surprisingly good at writing Python that generates FreeCAD documents. Arguably this says more about Astra than the ergonomy of writing FreeCAD XML, but because of Python the resulting code is very clean, because it puts anything verbose into functions. What could also work is direct OCCT from Python, haven't tried that.
tylermarques yesterday at 7:16 PM
I've been using Opus 5.5 to write openscad models for me for the past week, with great success. I wanted to expand the project Open Source Watch Winder [0] to have 8 watches, with gears instead of pulleys, and in little back and forth I have a version I've started printing. [1]

[0] https://github.com/mwood77/osww [1] https://imgur.com/a/bWent0K

vjvjvjvjghv today at 2:04 AM
I like the idea but I really dislike the OpenSCAD language. There is such a thing as being too functional. I don't really want to have to rethink even the simplest algorithms to work with OpenSCAD because of its weird scoping rules. Add to that the lack of a debugger. On the other hand, it's super cool to be able to source control a CAD model.
RobotToaster yesterday at 6:30 PM
Note that the current release version is very old, I strongly recommend downloading the nightly version and turning on the manifold geometry solver in settings as it's much faster.
stateoff yesterday at 8:16 PM
I tried OpenSCAD but it ends up being too abstract and hard to maintain for me and like others it does not solve fillets/procedural selection well.

So here is my shameless plug "sograph": https://imgur.com/a/u1n2Grg

I should consider a Show HN instead, but it is too early to release yet.

bee_rider yesterday at 7:09 PM
How does OpenSCAD type stuff play with simulation, in general. (If at all?)

I’m thinking of something like finite element analysis… but, I guess since the shapes in OpenSCAD are defined through this constructive geometry system, can things be better/more mathematically defined general purpose “discretize the PDEs over my mesh” type solutions?

matthova yesterday at 6:16 PM
I love OpenSCAD. Have been a power user for years. It's so great asking LLMs to make 3d models in openscad.

I made a rust-implementation of openscad called openrscad (https://openrscad.com). It still has some rough edges, but runs quite fast both on desktop and in the browser

ildari yesterday at 10:18 PM
My first time experience with cad as a code was through browser implementation https://reopenscad.com. My agent used it through mcp and designed pretty complex model with surprisingly concise code
joewalnes yesterday at 5:55 PM
Wrote a tutorial:

https://github.com/joewalnes/toybrick

LLMs are excellent at building OpenSCAD models. The tutorial (written in the before-times) will help understanding of the key concepts of OpenSCAD: primitives, transformations, and constructive solid geometry.

kennywinker yesterday at 6:35 PM
If you want openscad without the abomination that is the openscad language - check out jscad
TacticalCoder yesterday at 6:11 PM
OpenSCAD is amazing for those who know nothing about 3D but know about programming.

I bought a 3D printer (which is basically simpler and more reliable than a 2D inkjet printer by now: it's send the file, put the filament, and 3D print and it just works) recently and already fixed shitload of stuff around the house with 3D printed parts.

I even did "print in place" pieces where you add a pause a a certain layer, insert "stuff" (like say a 3D metal angle) into your print, then finish your print. Effectively creating parts that are both plastic and metal.

Now the language itself in OpenSCAD is kinda really bad: you can define variables inside of other functions and then use them everywhere. You can redefine already defined variables and you'll get zero warning. The language itself is really pretty WTF.

But you get modelling for free as a programmer. And LLMs are okay'ish at it for simple stuff.

I'd recommend people to use the BOSL2 library for OpenSCAD:

https://github.com/BelfrySCAD/BOSL2/wiki

It's really not hard.

If you love programming and like to DIY stuff around the house, buying a 3D printer and learning some OpenSCAD is a no-brainer.

OpenSCAD ain't the only option: many people like Fusion (for example). But as I'm a dev, OpenSCAD just feels natural to me.

threethirtytwo today at 1:12 PM
All CAD is already programming language based. The fact that every GUI operation transforms into a programmatic operation on the CAD model and that all of those operations can be saved into a CAD file and reproduced on loading indicates this.

The only difference between that and openscad is human readability imo. Openscad may be more designed for humans to program and read while CAD save files are just hard to read.

Human readability is only a human problem though. Your LLM in theory if trained on enough CAD data should not have this problem.

timonoko yesterday at 9:17 PM
For these eternal Fillet-Whiners: Antigravity made simple Blender-tool that rounds all edges in STL-file. Sharp edges never look good in print and avoiding them feels often like too much extra work.

https://github.com/timonoko/OpenSCAD-rounding-in-Blender

aeonik yesterday at 7:04 PM
BOSL2 library combined with LLMs really make me fly with my creations.
ponyous today at 1:06 AM
As someone who’s been building AI for CAD[0] with OpenSCAD. I’m very thankful to OpenSCAD maintainers it’s been a life saver. Terse syntax, a lot of plugins and great CSG kernel.

People keep saying I should use other kernels for fillets and stuff, but from my testing AI is just not as good with, for example build123d as it is with OpenSCAD.

[0]: grandpacad.com

pdntspa yesterday at 5:45 PM
The nightly builds for this are so much better. When are they going to merge the nightlies into a new mainline release? The last one showing 2021 isn't the best look...
asmodeuslucifer yesterday at 6:45 PM
I barely know openscad (used Fusion 360 before autodesk enshitified it) but gemini is very good at creating code I can paste into openscad.
MattRix today at 4:43 AM
OpenSCAD is great and really not that hard to learn. I recently designed a 3D-printed version of my new mobile game to celebrate its launch: https://bsky.app/profile/owengoss.com/post/3mwr2mn5gw227
dboreham today at 4:36 AM
I've been using Claude Code to design buildings for me by generating OpenSCAD files. Claude told me about the tool when in the beginning I asked if there was a way to do "3D as code" in view of my total failure to learn how to use 3D CAD applications.
IshKebab today at 7:59 AM
Now that FreeCAD is actually kind of decent there's really zero reason to flagellate yourself with OpenSCAD. Stop suggesting it to people.
ramses0 yesterday at 8:23 PM
[dead]