logoalt Hacker News

OpenSCAD the Programmers Solid 3D CAD Modeller

76 points • by b-man • last Tuesday at 9:22 PM • 67 comments • view on HN

Comments

ildari • today 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

wren6991 • today 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".
➕ show 1 reply
erjiang • today 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.)

➕ show 1 reply
YuechenLi • today 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

➕ show 1 reply
jeffbarr • today 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.

jacquesm • today 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.

maouida • today 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/

looofooo0 • today at 5:52 PM

Yes, also have a look at build123d which has a vscode plugin.

➕ show 1 reply
WillAdams • today 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/

stateoff • today 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.

➕ show 1 reply
TGower • today 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...

➕ show 1 reply
tylermarques • today 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

dvh • today 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.

RobotToaster • today 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.

bee_rider • today 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?

➕ show 1 reply
matthova • today 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

joewalnes • today 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 • today at 6:35 PM

If you want openscad without the abomination that is the openscad language - check out jscad

aeonik • today at 7:04 PM

BOSL2 library combined with LLMs really make me fly with my creations.

➕ show 1 reply
TacticalCoder • today 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.

➕ show 1 reply
timonoko • today 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

pdntspa • today 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 • today 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.

ramses0 • today at 8:23 PM

[dead]