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.<p>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.)
That's because you are thinking in the way you would with conventional cad systems, you are doing your operations sequentially a bit like a sculptor would: take a blank and then remove bits piece by piece. The trick to working effectively with OpenSCAD is to <i>generate what you want</i>, not to iteratively chip away at something.
to be a bit tautological, openscad is nice but only for the things openscad is nice for. I prefer freecad for almost everything except highly parametric shapes. Plus you can do openscad inside of freecad.
The great thing about OpenSCAD is that it makes modeling using cubes, spheres, cylinders, and placing or stretching them mathematically easy.<p>The awful thing about OpenSCAD is that one's capabilities in it are bounded by one's fluency in using math to place or stretch cubes, spheres, and cylinders.
I suck at math but I can do pretty neat stuff with OpenSCAD that would take me 10x longer with 'the usual suspects' in CADland. It took me a while to get the hang of it though, I think the bigger issue with using OpenSCAD is a shift of perspective. From the outside it looks like solid modeling with primitives, but once you 'get it' the method changes completely, it is probably easier to explain with an example:<p>If you want to make a complex gear that has to mate with another gear you can do this in two ways: you can start with two discs intersecting at the right angle and then to chop out the teeth so the resulting object will be a gear and then you could subtract via a similar operation from the other disc to end up with two mating gears.<p>The - in my view much more effecient - alternative is to start off with just the supports as the discs and then to parametrically add the gear teeth onto the supports taking into account all of the clearances and the contact faces. This will get you much better gears because you are parametrically describing the surfaces that really matter and it will allow you to do nice things such as small fillets on everything to make the object far closer to what eventually will roll out of your manufacturing process (machining, 3D printing). It is a bit more work to define all of the parameters but the end result is much better and far less likely to have imperfections because you are generating what you want, not removing what you don't want. OpenSCAD <i>can</i> be used for sculpting, but that's not the best way of using it.
On the bright side it refreshed my knowledge of trigonometry...
i did ton of projects in open scad in the past (8+yrs ago), even having access to freecad and solidworks. I was even sending patches to some 2d features on freecad.<p>but what made me use scad was reliability. i knew the time i put writting in vim would translate (heh) into a viable stl file i could send to manufacturing. while with both other options half the time was dealing with bugs and crashes and bad exports.<p>but how did i miss some convenience tools indeed. most could be solved with opensource methods (e.g. bevel, joiners with easing, threads)
To be fair, arbitrary fillets/blends on edges is a hard problem in general for Parasolid/ACIS because you are trying to mutate arbitrary topology, essentially guessing vertices/edges/faces and trying to stitch the back together.
This is true, but in things like OnShape I can do it with two clicks whereas in OpenSCAD it's always at least 20 minutes of thinking and trying out.<p>OpenSCAD is super cool and my go-to for simple things, but for anything more involved than a cube or cylinder with some cutouts I tend to revert to "normal" CAD programs.
Concur. It's worth explaining this, as someone new to CAD would get the impression the various tools in CAD are on even ground, and may assume "I know programming, so OpenSCAD sounds like the right choice". I would love some day for programmatic and/or free/cheap CAD to be competitive, but we're not there. Solidworks, Fusion, Inventor etc still outclass FreeCAD, which outclasses OpenSCAD.
I agree with your ordering of the various programs out there but FreeCAD 26.3 is now available as a release candidate with a wonderful collection of improvements. I'd think for many people, FreeCAD is now "good enough" for a lot of things. I'm building a virtual pinball cabinet and the whole thing is modeled in FreeCAD.<p>Mango Jelly's overview of some of the biggest new features: <a href="https://www.youtube.com/watch?v=WdTyFHY-5r4" rel="nofollow">https://www.youtube.com/watch?v=WdTyFHY-5r4</a>
The mcp integration may be seen as both a blessing and a curse but tbh, it’s very interesting :) and hopefully as folks post and comment on more models that are generated with it, we can get a better training set.<p>I actually still use the freecad gui because it’s cheaper but I can totally see how someone new might just wanna use the MCP.
Ty! I will give it a shot. I last did 2 years ago.
> A lot of common operations, such as arbitrary fillets on various edges, are simply hard to express or do.<p>As a long-time OpenSCAD user, I don't disagree with you but would also point out that LLMs can now make it very easy to do a lot of this sort of thing while still using OpenSCAD.<p>I actually find Gemini/agy to be the best of the ones I've tried when it comes to working with OpenSCAD code. And I don't recommend trying to use LLMs to one-shot geometry of anything complicated, but they are great for things like "take this OpenSCAD code and generate a fillet along these edges, abstract the fillet into its own module and make it parametric so I can easily modify the radius".<p>Granted, selecting a few faces or edges in a GUI CAD program and clicking a button is even easier than that, but only once you've spent a lot of time learning how to use the CAD GUI (which, IMO, are nearly universally very unintuitive until you've spent a lot of time working with them).
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: <a href="https://cadquery.readthedocs.io/en/latest/quickstart.html#quickstart" rel="nofollow">https://cadquery.readthedocs.io/en/latest/quickstart.html#qu...</a><p>(I recommend CQ-editor for an easy install: <a href="https://github.com/CadQuery/CQ-editor/releases/" rel="nofollow">https://github.com/CadQuery/CQ-editor/releases/</a>)<p>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()<p>Now I'm hearing some protests about Python, but consider this example OpenSCAD code:<p><pre><code> x = 1;
echo(x);
x = 2;
</code></pre>
In most languages you would expect this to print "1". In OpenSCAD, <i>the last assignment wins</i> and it prints "2".
I certainly have my complaints about openscad (mostly that the geometry isn't something you can operate on), but as far as I'm concerned a declarative language is perfect for describing an object. I don't want your example to do what you expect. I would have preferred if it didn't compile
Oh, since this came up, for people who like code CAD and want to try something more powerful than OpenSCAD:<p><a href="https://github.com/yuechen-li-dev/Aetheris/" rel="nofollow">https://github.com/yuechen-li-dev/Aetheris/</a><p>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.<p>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.<p>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.<p><a href="https://github.com/yuechen-li-dev/helioscad" rel="nofollow">https://github.com/yuechen-li-dev/helioscad</a>
Not even two years ago writing your own BREP kernel was considered to be out of reach for even the most determined dedicated hardcore engineering teams that weren't extremely well funded. Now, it seems tractable and may finally get us out of the dependence on proprietary kernels that has plagued this industry for decades.
Yeah, I know. I started this project earlier this year because of my own frustration with the software ecosystem and that the major CAD vendors is charging thousands of dollar to add STEP 242 support and because of proprietary lock-in and locking everything behind cloud, and was trying to see if I can accomplish this with AI.<p>I'm not going to pretend this is easy: I actually quit multiple times for this project because I ran into the same walls that everyone else ran to: arbitrary 3D boolean operations is HARD,(Surprisingly, I actually didn't have that much trouble with fillets/chamfers because I kept them pretty bounded) and the approach I've finally taken to solve it is pretty insane. Essentially, the final architecture is more like "LLVM for 3D objects" compiler stack than it is traditional BREP kernel. Would love to talk about the technical deep dives if people want to hear it.<p>Also, feel free to write UI wrappers around it, because I'm pretty bad at UI design myself.
What is wrong with OpenCascade? Why not use that?
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.<p>The most important thing about OpenSCAD for programmers to remember is that it <i>looks</i> 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.
> 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.<p>To put it another way, it's a purely functional language in a very strict way that takes some getting used to.
> things like variables and such do not quite work in the way you would expect from a programmers point of view.<p>I'm a novice at OpenSCAD still despite doing a bunch of small projects with it recently. Can you give an example of this happening? Most of the confusing stuff so far has been geometry breaking my brain and not some kind of scope issue.
Well, you could be forgiven to think that if you wrote i=5; some code and then i=12; that 'some code' is executing with i set to 5. Instead all code is run with i=12 because there is only one value for a variable <i>per scope</i>.<p>This can lead to extremely annoying bugs because your brain is wired to read and understand this stuff sequentially rather than all at once. I've stared at some page of OpenSCAD code for a long time before realizing that it was yet another one of those footguns.
Look into OpenPNP. Most of the PnP work is already done (vision, motion, feeders, etc). Just a matter of making the Prusa frame react to the commands.
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.<p>Check out my repos of OpenSCAD objects at <a href="https://github.com/jeffbarr/OpenSCADObjects" rel="nofollow">https://github.com/jeffbarr/OpenSCADObjects</a> and Truchet Tilings at <a href="https://github.com/jeffbarr/TruchetTilings" rel="nofollow">https://github.com/jeffbarr/TruchetTilings</a> .<p>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.<p>As another commenter noted, use the latest nightly build for best results.
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().<p>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.
My first time experience with cad as a code was through browser implementation <a href="https://reopenscad.com" rel="nofollow">https://reopenscad.com</a>. My agent used it through mcp and designed pretty complex model with surprisingly concise code
Shamelss plug:<p>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.<p><a href="https://github.com/Fluid-CAD/FluidCAD" rel="nofollow">https://github.com/Fluid-CAD/FluidCAD</a><p><a href="https://fluidcad.io/" rel="nofollow">https://fluidcad.io/</a>
Yes, also have a look at build123d which has a vscode plugin.
One of my favourite tools.<p>As noted, use the Nightly builds from: <a href="https://openscad.org/downloads.html#snapshots" rel="nofollow">https://openscad.org/downloads.html#snapshots</a><p>When working with kids, it's well worth keeping: <a href="https://www.blockscad3d.com/editor/" rel="nofollow">https://www.blockscad3d.com/editor/</a> in mind, or for folks who like to draw connections: <a href="https://github.com/derkork/openscad-graph-editor" rel="nofollow">https://github.com/derkork/openscad-graph-editor</a><p>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:<p><a href="https://pythonscad.org/" rel="nofollow">https://pythonscad.org/</a>
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.<p>I'll have to add this to my backlog of experiments to try when I have unused tokens near a reset...
Blender gives you a mesh that isn't parameterized. Not particularly useful for making dimensional changes outside of eyeballing everything. An LLM isn't going to reliably hit your dimension targets so tweaks will be necessary.
Yeah, that's what I meant by "immediate result", if you need to edit the generated model by hand it will be hard to beat having the model and timeline available in Fusion after using Fusion MCP.<p>If you just need to tweak the dimensions in the script, or are satisfied with describing the changes to the LLM and having it modify the script, there isn't much difference in practice between a generated OpenSCAD script and a Blender python script.
I created an (unpublished) MCP for a CAD that didn’t have one before and LLMs are just fine at it. It looks like they can apply their higher level training across interfaces.
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.<p>So here is my shameless plug "sograph":
<a href="https://imgur.com/a/u1n2Grg" rel="nofollow">https://imgur.com/a/u1n2Grg</a><p>I should consider a Show HN instead, but it is too early to release yet.
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]<p>[0] <a href="https://github.com/mwood77/osww" rel="nofollow">https://github.com/mwood77/osww</a>
[1] <a href="https://imgur.com/a/bWent0K" rel="nofollow">https://imgur.com/a/bWent0K</a>
I use openscad for all my kicad 3d models via scad->off->obj->(manually edit in mm3d to add colors)->wrl->kicad<p>It's not as bad as it looks, it's all automatic except adding colors which takes about 2 minutes.
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.
How does OpenSCAD type stuff play with simulation, in general. (If at all?)<p>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?
Normal finite elemts does not care. The mesh ist just put on your 3d body that can be an stl or a step or whatever. The FEM only knows the nodes and nothing else. The mesh geometry is completely separate from the CAD file.<p>Now there is a method called Isogeometric Analysis (IGA) that was meant to improve this. It uses NURBS functions (just like CAD) for the shape functions of traditional FEM. The idea was that now, if you have NURBS describing the CAD geometry you can skip meshing and just directly calculate on the real geometry.
But it did not catch on. The reason being basically, as far as I remember, was that most CAD geometries of interest are not pure NURBS. But they are operations of NURBS (think cube minus some other cube - trimmed surfaces). And IGA has problems with that.<p>This is a problem that openSCAD will probably also not be able to overcome. Maybe at times it might be easier to create NURBS geometries without trimmed surfaces. But most probably that cannot be done in most cases of real world significance.
Ah, that makes sense. I think Isogeometric Analysis was the idea I was circling (the though process being “of course you can always export to a mesh, but the OpenSCAD model seems to encode more designer intent so why not use that for simulations directly”). I’ll have to read up on what was tried and why it didn’t catch on. Thanks!
I love OpenSCAD. Have been a power user for years. It's so great asking LLMs to make 3d models in openscad.<p>I made a rust-implementation of openscad called openrscad (<a href="https://openrscad.com" rel="nofollow">https://openrscad.com</a>). It still has some rough edges, but runs quite fast both on desktop and in the browser
Does it have rust versions of the full stack of libraries like Agnis Johnson's Clipper, etc? How compatible is the kernel with CGAL Rational?
Seconded. OpenSCAD is a bit tedious to use from scratch but claude is pretty decent at generating the code. It can't render the script though so it tends to make silly mistakes
Wrote a tutorial:<p><a href="https://github.com/joewalnes/toybrick" rel="nofollow">https://github.com/joewalnes/toybrick</a><p>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.
If you want openscad without the abomination that is the openscad language - check out jscad
BOSL2 library combined with LLMs really make me fly with my creations.
OpenSCAD is amazing for those who know nothing about 3D but know about programming.<p>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.<p>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.<p>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.<p><i>But</i> you get modelling for free as a programmer. And LLMs are okay'ish at it for simple stuff.<p>I'd recommend people to use the BOSL2 library for OpenSCAD:<p><a href="https://github.com/BelfrySCAD/BOSL2/wiki" rel="nofollow">https://github.com/BelfrySCAD/BOSL2/wiki</a><p>It's really not hard.<p>If you love programming and like to DIY stuff around the house, buying a 3D printer and learning some OpenSCAD is a no-brainer.<p>OpenSCAD ain't the only option: many people like Fusion (for example). But as I'm a dev, OpenSCAD just feels natural to me.
For these eternal <i>Fillet-Whiners</i>: 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.<p><a href="https://github.com/timonoko/OpenSCAD-rounding-in-Blender" rel="nofollow">https://github.com/timonoko/OpenSCAD-rounding-in-Blender</a>
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...
When all the blockers are resolved:<p><a href="https://github.com/openscad/openscad/issues/3640" rel="nofollow">https://github.com/openscad/openscad/issues/3640</a>
This problem has made me search for other solutions. I need tools that ship.
I barely know openscad (used Fusion 360 before autodesk enshitified it) but gemini is very good at creating code I can paste into openscad.
[dead]