Pro tip: Use the latest nightly build and switch to the Manifold backend in preferences. Render times drop from minutes to seconds for complex models. The official 2021 release is painfully outdated.
Also, the BOSL2 library is essential - it adds proper filleting, rounding, and attachment operations that vanilla OpenSCAD lacks. Makes the difference between toy projects and actually useful designs.
The Git-friendliness is underrated too. Diffing .scad files is trivial compared to trying to understand what changed in a binary Fusion 360 file.
https://github.com/fogleman/sdf
One big plus to doing it this way is that it's "just" Python and you can use arbitrary logic to help construct your model.
You can even load an existing 3D mesh and operate on it as an SDF. Great for hollowing, chopping, eroding/dilating, etc. existing models.
I should probably do more with this project. I think there's a lot of interest in this space.
I recently also got annoyed with OpenSCAD and its limitations and therefore started experimenting with Build123d. I'm very much a beginner in the CAD space and would love to understand what inspired you to build sdf.
My basic understanding is that STL files are essentially like Bitmap images and store a list of triangles and their positions, whereas STEP files are more like Vector art where there is a list of instructions on how to build the model. Most CAD GUI programs also operate on a similar model to vector art where they record a list of operations one on top of another. It's why STEP files are a standardized format and can be imported / exported from most GUI based CAD builders. I think.
Given that SDF also seems like it builds only STL files (I could be wrong), wouldn't learning build123d or CadQuery work better if one cares about compatibility with existing GUI based CAD modeling software?
Additionally, atleast build123d offers a similar conceptual model to using Fusion360 and FreeCad - I have limited experience here - but essentially you sketch something in 2D on a particular plane, and then apply some operations to convert it to 3d in a particular manner - the simplest being extruding. This means the mental modeling of how to construct something is very similar across both GUI based CAD programs and Build123d, and that makes it easier for me to jump between GUI based and code based CAD modelling.
I'd love to understand your point of view, and learn more.
Like most of my projects, this was just for fun and I mainly made it for myself. I'm a DIY kind of guy when it comes to software. I just throw things up on GitHub in case anyone else can get some use or inspiration out of it.
Honestly I was about to ask the same questions as the parent comment. Whenever I'm interested in something I usually look at what available tools exists out there already; seeing a new tool mentioned that I've never heard of before, my reflex is to ask "oh neat, what makes it different than the existing tools?". I don't think the question was ill-intended, just genuine curiosity; assuming that you wrote your library because you had no idea build123d existed rather than because you were unsatisfied with it and wanted to tackle the problem differently is a bit of a leap.
https://pythonscad.org/examples.php
(search for "sdf" about halfway down the page)
This has my instant interest. Multiple times I have wanted to take an existing .STL file and cut a hole on it or add another object to it and have never had success.
I've tried things like Meshlab, but while the interface has what appears to be a hundred different functions, attempting to use anything returns some error code that requires a PhD to understand and none of the "repair" functions seem to help.
I mean seriously: Mesh inputs must induce a piecewise constant winding number field.
How the hell am I supposed to accomplish that on a STL file?
In freecad you first just open the stl file, then Part -> Create part from mesh, then you have a solid you can modify.
intersection() { import("3DBenchy.stl"); sphere(30); }
If you have the paid version of Fusion, you can run "feature detection" to turn things like holes, fillets, extrusions etc. into dedicated features which are even easier to edit. [2]
[1] https://www.autodesk.com/learn/ondemand/curated/direct-model...
[2] https://www.autodesk.com/learn/ondemand/curated/direct-model...
https://github.com/fogleman/sdf/blob/main/examples/mesh.py
You basically just say:
f = Mesh.from_file(path).sdf(voxel_size=0.25, half_width=1)
Then you can operate on `f`.
Removing faces from an STL and adding other objects is quite straightforward. Previously, Autodesk had Meshmixer and 123D, I guess Meshmixer is still available: https://meshmixer.org/ and I found it to be great for quick editing of the type you're describing.
What do you use for sdf meshing? I never really got the perf where I wanted it.
> I should probably do more with this project.
I, for one, would be glad.
Something like two precisely interlocking gears with a tooth geometry with a profile that's the developed curve of the opposite tooth is a nightmare to build with SDFs
Or precise fillets.
Or hard intersections and differences.
Very useful for doing soft, squishy shapes, less so for hard CAD.
Also, a suggestion: in your project, please consider using Wavefront OBJ as an output format, it is a much, much better choice than STL (STL can't represent the actual topology of the object, it has to be reconstructed).
I would really recommend using the git master than the latest release though. The last release was 2021 but they are still actively working on it and it's much faster now.
I also have to recommend the BOSL2 library which means you don't have to implement all of those one million features from typical CAD software yourself. Its definitely got a bit of a learning curve but the fact that you can always default back to vanilla OpenSCAD and that you can actually see how stuff is implemented makes it much more satisfying to me to learn than learning what all the traditional CAD GUI buttons do.
I love OpenSCAD. I've been 3D printing for a while, but I never really got to a place where I could design interesting parts until I started to get the precision of doing models in code. Sometimes it is slower, for sure.
Every time I've used as a CAD GUI program I would get to this point where I would need to alter a single dimension by 0.25mm and realize that _all_ of my fastener holes, cutouts, etc have to be nudged with the keyboard or mouse to accommodate it. The input devices lack precision for that kind of task, and having to repeat the operation dozens of times (or bulk select) gave me a terrible sinking feeling, and I'd often just step away and give up on the design at that point out of frustration. I try to approach everything in OpensSCAD in a way that means I never have to experience that feeling again.
I will also say that doing everything from scratch in OpenSCAD would be it's own special kind of hell. Libraries like [BOSL2](https://github.com/BelfrySCAD/BOSL2) provide a good set of core ideas and preferences that help set you on a good path. A good example: BOSL2 shapes tend to have a "center origin" by default, which is different than the OpenSCAD default, but makes doing transforms later way easier.
Anyway, happy to see OpenSCAD getting some attention here :)
There seems to be some fundamental misunderstanding of CAD here. I can't imagine how you could even design something in CAD in a way that you would end up in this situation.
When I'm doing something more sophisticated I use SolveSpace, but I'm a lot slower with that.
SolveSpace is open source and has parametric capabilities. It's much more limited in scope (e.g. you can't do filets) but good enough for my purposes.
I've not explored the commercial options beyond TinkerCAD, and that's not parametric. Super easy to bodge something together though :)
What.
This makes no sense. This isn't PowerPoint; your holes and cutouts are supposed to be parameterized. How are they even supposed to be at the proper position in the first place?
As a CAD user, this is like e.g. a coder seeing someone write code with global variables everywhere.
I'm not doing complex character model designs, I'm usually building functional prints like enclosures or cases. It certainly sounds like there are features of better CAD software that makes parametric the default?
At least you've inspired me to try it and see if it's "worth writing home about"
I often switch between FreeCad and Dune3d now, Freecad for things I know how to design properly and Dune when I'm in 'claying' mode. E.g. export a .step part when I get stuck in FreeCad, import it into Dune, make some progress and vice versa so I don't walk away from the project
For example, if you put a hole in a box, do you want to reference the center of the sides of the hole? And do you want to place them relative to the left side or right side, and front or back? You never say "it's x mm from the left and y mm from the right and my box is w mm wide" - because the relationship x+y=w is always here! You only define 2 out of 3. But it may happen that you picked the wrong 2 - and a parametric CAD makes it very easy to do so in a few clicks, while a programmatic CAD like OpenSCAD is a large rewrite with calculation you have to do yourself on the side.
My example is silly but start doing big designs, large assemblies, and you "chains of cotations" may need to be redone again and again - especially when tolerances begin to add up.
But OpenSCAD isn't really parametric CAD. It's a programming language; it's parametric for that reason. But it's not really CAD, at another level, in the sense that it does nothing to "aid" your design work. It has no interim abstraction for generated geometry; everything must be explicitly described.
FreeCAD, though, is profoundly parametric, through and through, and really always has been. Indeed the parametric aspects are the main thing that made it workable before the TNP mitigations were added. It is not a limited CAD package, by any means. It's just a somewhat unfriendly one with a CAD kernel that has some limitations. Really it's almost better understood as a 3D IDE with some workflow affordances.
If you are stuck trying to get your head into how FreeCAD works, there are now three really good ways on Youtube: the Mango Jelly Solutions videos are incredible, the Shawn Hymnel/Digikey FreeCAD and 3D Printing course is good, and there are great recent videos by Deltahedra.
But what you will be able to make with it, once you get your head into it, is night and day different to what is possible with OpenSCAD. Because your parametric work in FreeCAD (or other CAD packages) can operate on the geometry of the result of previous operations.
Give it a try in the New Year with FreeCAD 1.1 when it is released.
If you want another stepping stone from OpenSCAD to FreeCAD or any other package, I really recommend you look at CadQuery/Build123D. This will give you a similar coding approach but it will introduce you to operations on the true faces, edges and vertexes of the output of other operations.
(FWIW I would not say that Sketchup is not high end, either. It's not to my tastes but it is quite powerful)
Maybe this is pedantic, but why wouldn't OpenSCAD qualify as CAD exactly? It's still "Computer-Aided Design"? Sure, the UI/UX is different, but is there some qualifier to CAD around the UI/UX?.
CAD is software to help people make complex things without having to do complex geometry/trig/general maths.
OpenSCAD doesn't really "aid" you much with this. It's a 2D/3D shape generator with boolean operations, but because it doesn't let you do constraint operations on 2D geometry, and it doesn't let you do further operations on the fundamental geometry (faces, edges, vertices) of the generated 3D solids either, it never liberates you from most of the difficult work.
I'm not even sure how much it aids you with "design": it doesn't support chamfers or fillets, it offers no tools for adding drafts or making truly uniform thicknesses. And it only generates meshes.
OpenSCAD is useful. I'm not saying it's not. But it is useful mostly for drawing strongly geometric or mathematically-derived solids and producing a mesh from it.
Dune 3D seemed quite promising, but very limited --- is there a set of options for the UI in FreeCAD which will create a similar interface?
Now, if the random crashing were fixed, that would make a real difference for me...
That mode works OK on touchscreens, in the sense that any app with tiny buttons to click does. I have tried using a tablet with a pen but it is a heavily modal UI so it feels a little bit like old fashioned light pen territory, as much CAD does. Not like an iPad app; they need designing differently.
Quite a lot of progress on macOS FreeCAD crashes because they changed an exception handling strategy for exceptions outside the Qt loop, if I remember right. Some crashing in 1.1RC that is being fixed. In general it crashes a whole lot less than it did in 0.20, say. But if you can reproduce them, definitely report them.
(Which is not to say that I am not pleased to see more open source CAD packages taking different approaches. Dune3D is interesting, Blobfish's Cadseer is very interesting to a coder I'd have thought, and SALOME has obvious value)
The one small tweak I would suggest for FreeCAD is to use the tab bar workbench selector rather than the dropdown version. It’s such a small change but it helps flow between things in a way that feels like the various functions are more closely integrated. That, combined with custom panels if you want them, makes it more fluid.
(I am not making any particular claims for FreeCAD's usability; I do though think it is much better and much more learnable than the average HN perspective of it, which seems to often come across more as TUI-exceptionalism or "but I don't wannnnnaaa learn a guuuuuuuiiii". GUI CAD isn't intrinsically some inferior, imprecise, unformalised thing.)
I had the change the height of an entire enclosure to accommodate a taller than anticipated PCB, and simply edited the sketch at the top of my design tree that defined the overall dimensions.
It took about 5 minutes to adjust the odd broken fillet and change some mates in assembly and it was done. No fidgety mouse movements. I actually do a lot of mech design on a laptop with a trackpad, arrow keys for view changes and numeric dimensioning for 95% of everything else.
I am just starting to learn CAD and FreeCAD - also dabbled a bit in OpenSCAD. But I do know that FreeCAD has Spreadsheets [1] and Configuration Tables [2] which allows you to define your model parameterically and changes values as needed.
How good this is, I don't know yet.
[1] https://wiki.freecad.org/Spreadsheet_Workbench [2] https://wiki.freecad.org/Configuration_Tables
The little-known Configuration Tables aspect of Spreadsheets is absolutely worth using, though, and has no equivalent in the VarSets scheme at this point. Once you get that set up it is great fun.
As an example, consider a bar with a constrained length, e.g. 1000mm. I want holes in the bar every 100mm (not a strange requirement). Now I change the length constraint to 800mm. Consequently, the number of holes should change. But this seems not possible in a "parametric" modeler. Maybe I'm missing something, though.
I can see how you would end up in that position
You need to add constraints to your sketches. In other words tell it that the hole needs to be x distance from certain lines.
If you don't do that what you get is the equivalent of hard coding a hole location in OpenSCAD. I guess OpenSCAD just forces you to think parametrically.
Also in fusion 360 make sure timeline editing is on.
Thats surprising! Last time I used software like this (Inventor, back in ~2005-2006) constraints meant that I didn't need to do this at all
This. The master version is so much further ahead of the last tagged version. The render time can be orders of magnitude faster for more complex models.
or with Homebrew you can do `brew install --cask openscad@snapshot` to install the latest snapshot version.
Or, browse all the snapshot builds here: https://files.openscad.org/snapshots/
(as of this comment, the last snapshot build is from yesterday)
https://openscad.org/cheatsheet/
Note that updating it is one of the blockers for a new release, so it doesn't include some newer features/syntax
There is also:
https://cubehero.com/2013/11/19/know-only-10-things-to-be-da...
FWIW, when I need to rough something out in OpenSCAD, I usually use:
It is a useful tool for programmatically describing either very simple or heavily geometric objects. For everything else it's the wrong tool.
OpenSCAD clearly qualifies because it creates precise 2D/3D models; supports parametric modification; enables reproducible designs; produces manufacturable geometry (STL, DXF, etc.). The fact that it is code-based does not disqualify it. By the same logic, CadQuery, SolidPython, or FeatureScript would also not be CAD - which is not a position held in engineering practice.
CadQuery, Build123D, Featurescript etc. all have something OpenSCAD does not have: they all have facilities to operate on generated geometry such as edges, faces and vertices. So they have generalisable operations, and they can output pure geometry representations as STEP/IGES. Featurescript presumably also allows access to sketch constraints. (Build123D is beginning to add those I think.)
These are the things I think are necessary to “aid” design, because they are the things that begin to abstract away the mathematics. OpenSCAD never does. So it “aids” design little more than any pixel graphics library aids 3D software developers.
And it does not, in fact, create precise 3D models! It produces mesh representations of them. So it cannot, by definition, produce a precise representation of a cylinder, sphere, cone or curve.
The 3D models from OpenSCAD are not highly manufacturable at all, except with additive production techniques. STLs do not make good inputs for a CNC (nobody will tell you that is good engineering practice).
https://www.cnccookbook.com/meshcam-great-ease-of-use-in-a-3...
But I think we agree that mesh formats don't make good engineering interchange outside additive manufacturing.
Personally I think they often make a bad format even in additive manufacturing. They are the right format for medical/dental, and yes, slicers make internal STL-ish mesh representations of STEP etc. before slicing, but they are much harder to modify precisely than STEP.
The awful thing about OpenSCAD is that what one can model in 3D is limited by one's ability to mathematically stretch, rotate, and/or arrange spheres, cylinders, and cubes in 3D.
For folks who want "real" (read mutable in normal terms of scope) variables there is a Python-enabled fork (which should become part of the main release presently:
You can use modules to create a semblance of relative measurements but you still cannot do things like “attach this surface of object A to that surface of object B)”. In practice this means that if you want to create something like a spacer or a bracket you can do that easily enough. But if you want to make a part that matches some real world design you are stuck doing a lot of caliper measurements and math to try to create a part that lines up correctly. The you 3D print it and find that you positioned some hole based on its edge and not center and so nothing quite fits.
OpenSCAD is easy to start but difficult to scale because of these limitations and because once you hard-code any measurement you are stuck with it. The “proper” way to do this is to give everything a variable but honestly that makes reasoning about how to line things up even more difficult. “Does base_width include the width of the vertical walls? What about the margin to make the parts fit together?”
I have never been able to understand how things like FreeCAD lay out their UI. TinkerCAD is relatively simple but clearly a lot less powerful. I did try cadquery which solved a lot of OpenSCAD’s issues by having all offsets be relative by default but also introduces a few issues of its own.
One tip I will give about OS: grab a copy of the latest beta/dev release. The renderer is several orders of magnitude faster.
(Post author here.)
This was a very weird thing to me I ran into and have thus far just sort of... accepted.
In Fusion, and other CAD software, if I have two faces end at the same point, unless I've specifically said to create them as separate bodies, they are joined, because they share a plane.
In OpenSCAD, in the tutorial, it has you extend an object 0.001 to ensure they overlap. To quote:
> In the example above, the second cube sits exactly on top of the first cube. This is something that should be avoided, as it’s not clear to OpenSCAD whether the two cubes form one object together. This issue can be easily solved by always maintaining a small overlap of about 0.001 - 0.002 between the corresponding objects. One way to do so is by decreasing the amount of translation along the Z axis from 10 unit to 9.999 units.
This struck me when making the example in my post. In line 47 I specifically add 1 to heightCompartment to ensure the opening extends past the top of the main body. If I didn't do that, this happens during preview: https://imgur.com/a/Amc1dK6 (That's an exported image from the latest nightly of OpenSCAD.)
But it doesn't happen during the actual render?
Still, that just feels... like there's something going on with a floating point value or something which, programatically, is probably correct... But from the perspective of someone trying to design something feels Very Wrong. Because I have a 20mm high box, I subtract a 19mm high box from it, starting 1mm up from the base. Why shouldn't the top be open? Why is it acceptable for it to be maybe kinda open but broken by design?
I still don't /like/ it because it seems I'll need to add in some sort of 0.001mm overlap into the code if I want to ensure this doesn't become a problem. And this feels like a messy way to go about it.
Sure you can, but openscad is an imperative language so you need to do it in an imperative manner.
a_cube_loc = [10, 5, 5];
a_cube_size = [2, 4, 1];
b_cube_loc = [a_cube_loc[0], a_cube_loc[1] + a_cube_size[1], a_cube_loc[2] ];
b_cube_size = [2, 4, 1];
translate(a_cube_loc) cube(a_cube_size);
translate(b_cube_loc) cube(b_cube_size);
It would be nice to have more declarative constraints. The solvespace file format is plain text and it almost feels like you could write it by hand, but that would be a lot of manual record keeping. and you would loose all that imperative goodness. Perhaps you could have an imperative layer(say python or lisp or forth) that outputs the declarative layer(solvespace) and then solvespace renders(picture or stl) the declarative layer.Manifold backend also eliminates the need to avoid coincident faces.
I'm 100% with you there. One of the most utterly confusing UI I've had to deal with.
And I suspect the answer is : the FreeCAD devs don't either.
It also has hulls and minkowski sums, which are powerful once you understand them.
So, spheres and cylinders and cubes placed, rotated, stretched and placed mathematically.
If you wish to use Rust for 3D modeling directly there is:
(the developer of which is actually working on a BREP kernel)
Which avoids using the OpenSCAD language, but also means you can't use BOSL2. Might as well use FreeCAD.
It's _not_ something which was designed for ease of use, or rational semantics, or to facilitate expression.
If you are coming from SolidWorks, Fusion360, Inventor, or OnShape, it won’t take long before you start finding that there are a lot of things missing from it.
There is a problem though - sometimes what you want requires deep understanding. It's less user friendly, polished, and documented. That's also relevant to the performance - it's easy to cause performance issues. But I remember the same was also applicable to Fusion.
(3D printing a sacrificial gear for a seat position adjustment mechanism)
Thanks for this, didn't know about it.
How does that compare to solid python 2?
Rather then adding an additional compile cycle:
- run Python code to generate OpenSCAD code
- render OpenSCAD code to see output
OpenPythonSCAD creates a .py code window in the OpenSCAD interface which one interacts with in the same way as a .scad code window (there's even basic support for the Customizer).
I suspect it would be really easy to port SolidPython to work w/in OpenPythonSCAD (if it hasn't already been done)
Not at all. You can build any polyhedron you want using the polyhedron command.
Which would be an enormous pain to write out by hand every time, but I wrote a function once upon a time to generate a polyhedron from a stack of layers, each of which is a list of points, and haven't had to mess with old cubes and spheres since.
One annoying thing is that the default way of writing programs in OpenSCAD uses 'modules', which are a bit limited compared to functions (you can't store them as values to to functions or other modules). I worked around that by writing a module that interprets arrays (think S-expressions) that representing the shape, and then just build up that S-expression-like thing with functions and whatever.
Once you've built your own programming language inside OpenSCAD it's perfectly usable. :-)
This might sound like sarcasm but I actually do prefer this to dealing with Python's mutable state jungle / package management nightmare.
This sounds _fascinating_ have you posted your code or written this up in a math journal? Link?
I don't touch polyhedrons in OpenSCAD because the logic of point placement mystifies me --- a tool such as you describe would make life a lot easier for a lot of folks, esp. if there was a way to use it to import a series of SVG files which could be used to define the points interactively.
I sometimes wonder if the key to future computer usage would be a series of Domain Specific Languages each intended for a given task:
- 3D == OpenSCAD
- 2D == METAPOST
- SQL == databases
- TeX == text/page composition
- sed == text
(and yes, I know this is the Unix ideal)
but such languages seem to be most successful and most approachable to typical users when they are paired with a front-end which affords editing, previewing, and, direct interaction.
I'm actually nuking my Python install right now, because I got it into a state where I couldn't get Fullcontrol G-code to run, so I agree that the state of Python package population is pitiful, hence of course, the XKCD:
I wrote about the approach a little bit in this Reddit post: https://www.reddit.com/r/openscad/comments/186b54r/interpret...
The interpreter itself is just a single module: https://github.com/TOGoS/OpenSCADDesigns/blob/master/2023/li...
Instead it's basically like graphics programming, with a couple of basic primitives, some linear transformations and a bit of set theory. When I do a model a month and get back to previous work, I read a few lines of code and know exactly how I achieved the result.
I also have the opposite experience about understanding previous scripts. Unless it's dead simple I'm usually thinking why the hell did I multiply this thingy by sqrt(3)/2 plus this other thing. Maybe a documentation problem, but it's inescapable that sometimes you need a lot of math for what are trivial constraints in an interactive sketch. A real CAD program will let you roll back to any feature to figure out how it's constructed step by step so there's really nothing to decipher.
I know this is not typical, and nothing against folks who see it the other way. But OpenSCAD fits the way I think and want to work better than the more “normal” tools.
I tried using Build123d, a Python library that lets you use all of the features of Python. And it's supposed to allow specifically things like box1.width, but it's always 0. Lots of other issues/bugs too, and severely lacking in ddocumentation.Maybe it'll get there some day.
While it was very handy for my programmer brain to create a few 3D printed things, when I wanted to create a drawing for something I'd make myself, adding dimensions seemed very unwieldly. I used a different CAD program for those projects (maybe Autodesk Inventor?).
The same model in freecad is like 6 megs of zipped xml and realistically not nearly as usefully parametric.
That couple-k of plain text is such a huge deal that it makes all the other difficulty worth it for mechanical/functional stuff.
Fusion is great for that as long as there's not too many parts. But sometimes I'll want a new variant or a series of new variants.
And reaching for python makes that easy.
I just wish it had operations for subtractively chamfering, rounding, etc. as doing minkowski() with cones and spheres to achieve that result can be unwieldy.
cuboid([20, 20, 30], chamfer=5);
https://cubehero.com/2013/11/19/know-only-10-things-to-be-da...
$fn = $preview ? 32 : 64;The power of parametric cad is such that I wouldn't be a 10th as productive using an interactive cad system. And because it is effectively software you are writing (even if it compiles into physical objects) you can use all of the goodies that you can use to manage software. Diff files, git, kompare, branching, merging. It is nothing short of amazing, it is like I have a design team and a prototype injection molding facility in one. And the turnaround time is something you'd have killed for in the 90's.
This sounds like parametric and interactive CAD are polar opposites. Normal CAD software is generally parametric too.
The other points about the advantage of text files still applies though.
There are cad packages that can do this but unlike OpenSCAD the main interaction there is the 3D window, not the text editor.
Though AutoCAD of course had this with AutoLISP since 1986.
Interestingly, I'm not sure which has the steeper learning curve, OpenSCAD or AutoLISP. OpenSCAD is really great once it clicks but most people give up long before then.
Two 3D CAD tools which seem to be focused on ease-of-use are:
- Dune 3D --- this has been discussed here a couple of times (I think I posted the two most active posts elsethread)
- Moment of Inspiration --- created by the developer who created the program Rhinoceros 3D was based on and who was the lead developer for that program for years, it focuses on ease of use and apparently started with the idea of making a CAD Program suited to use on a computer pen tablet --- there's a video series: https://www.youtube.com/playlist?list=PLUilfM8GEmrS3yRLygdFO... which makes it seem very approachable
Mathematica however is Lispy enough and has a lot of helpful geometry primatives and can export STL
I'm aware of Onshape having a git-like workflow as well, wonder how the two compare! A fully cloud-based suite would probably not work well for an open source project.
Currently I'm playing with a gear library which is part of BOSL2 (https://github.com/BelfrySCAD/BOSL2/wiki/gears.scad), to make something to rotate a polariser in my microscope.
OpenSCAD can automatically re-render a preview as soon as the external editor saves to disk
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_an_...
I recently started messing around with OpenSCAD too. I found these boxes that are great for storing the tiles for various 18xx railroad boardgames: https://www.printables.com/model/287297-parametric-18xx-tile...
Cool thing is that you can easily print them in whichever size you like, and the sizes in the supplied files are rather large, so I tried some smaller sizes, and discovered some details weren't actually centered properly, so I dove into the code, tweaking some bits here and there until I got it centered properly.
Then my dad asked me to print boxes for a game that had slightly larger tiles, so I needed to tweak the sizes, the thickness, and made everything just a bit more configurable.
I've got another idea I haven't tried yet: print the shape of the track on the tile on the spot its meant for. That's a whole new feature and not merely tweaking an existing one, so maybe it's time to finally learn how this format actually works.
Although I did see in the code that you create shapes through intersections and substractions with other shapes. And that's where I got stuck. Maybe it's time to pick it up again. It's a fun way of building shapes.
I wrote more about it here, although I only mentioned OpenSCAD briefly https://hackaday.io/project/202488-manhattan-subway-map/deta...
As it happens I wrote about this almost exactly a year ago
I went from OpenSCAD -> cadquery/build123d -> Zoo/KCL
It still is early days, and it needs some more helper functions but it's really nice having two-way capabilities (not just code -> model, but also the reverse).
Of course having Text-to-model as a first class citizen is also nice.
I know the ecosystem not-at-all (sum total knowledge of the CAD ecosystem is that my kids got a Bambu printer for Hanukkah) but it feels to me that current LLMs should be able to generate specs for something like https://partcad.readthedocs.io/en/latest/, which can then be sliced etc.
Curious to know what others think? I come at this from the position of zero interest in developing the fine design skills needed to master but wanting to be able to build and tweak basic functional designs.
Also with OpenSCAD, you can feed the documentation to your favorite LLM and ask it for a starter design of whatever you are building. (Or you can skip the documentation; it is in the trading data after all.) Maybe in the future that SVG Pelican on a bike test will be a 3D model in OpenSCAD.
I personally do better with CAD software such as fusion or freecad since my mind doesn't work in the code realm since I have more of a hardware mindset. Translating the picture in my head to code is more difficult than drawing it using the standard CAD set of tools.
My opinion on OpenSCAD is that it is a very useful piece of software which many have used to make some very interesting things. If you have a background in code I recommend giving it a go. I largely view it as "the coder's CAD".
That's not necessarily a bad thing; there's a clientele for it, especially here on HN. But as a mechanical engineer who's used quite a few industry standard CAD systems, I'm sorry to say I wouldn't touch it with a ten foot pole.
Funnily, just a few days ago I tried FreeCAD, and found it to be better than I had expected.
Freecad 1.0 is a gamechanger IMHO. It so far has suited all my needs as well as being significantly easier to use than the pre 1.0 versions.
There is no explicit iteration, so if you want to do flexible spacing for any reason, like distribute a feature evenly along a dynamic length, you need to use recursion.
https://github.com/rahulgarg123/openscad-mcp
It’s still strictly worse than what these models are capable of for general-purpose coding, but for simple tasks where precision isn't the bottleneck, it's surprisingly decent.The "aha" moment for me was an image-to-object workflow: found a geometric design on the web --> generated OpenSCAD to match the image --> 3D printed it. Going from seeing a JPEG to holding the physical object in a few hours.
The chatbots kept recommending I try using OpenSCAD but I resisted without even giving it a look. The results I had with just the Python script are quite adequate for the tasks I had. You can just ask the LLM to add a fillet to a vertical pin on a plane or to chamfer some edge and it is pretty good at doing it.
https://wiki.roshangeorge.dev/w/Blog/2025-12-01/Grounding_Yo... if you want to roughly see the workflow.
I'm going to try using OpenSCAD for things in the future. Does anyone else use exclusively an LLM with OpenSCAD (I used Claude Code and Codex) and if you do what did you do to make it more effective? The Python script wouldn't always generate printable meshes so I had to give it a check script to operate on.
If you don't need fancy features, have a look at FreeCAD as well.
And when something gets too trick, ChatGPT is amazing at writing in it. Often it nails the whole design in the first try, like https://bsky.app/profile/bradfitz.com/post/3maelwomyw22n to mask off certain Raspberry Pi pins to make reassembly of projects easier later.
Years later, I never actually got the hang of CadQuery, and I'm wondering if it was a mistake to write off OpenSCAD.
I am pretty new to CAD, so I don't actually know when I would run into OpenSCAD's limitations.
- functional programming model --- some folks find not having traditionally mutable variables limiting
- output is as an STL, or DXF using polylines
- native objects are spheres, cylinders, cubes, with functions for hull and Minkowski, so filleting and other traditional CAD operations can be difficult
My favorite thing I’ve printed is a little downsize coupler for the cool shirt system I built for my spec miata. It’s realllly silly & small thing, but it saved me!
It's neat that I can tell the computer what I want in words and then have that object come out of the 3D printer
Ok if you want to generate a couple of cubes, but if you want anything advanced the kernel quickly falls apart
Which you can also use directly instead by writing C++. Trivial operations are two orders of magnitude faster and complex ones every faster.
Assuming you make all the necessary adjustements in preferences.
total lack of interactivity.
https://youtu.be/eG5lhLYvihQ?si=ehet5COZhiNrcK9bI have not yet invented any other improvement.
I tried decimal points, but that was stupid, you just add "/100" if you want micrometer accuracy.
I use the latest version all the time. The newer renderer ("manifold", IIRC) is much faster, and there are newer facilities that make it possible to build 3MF files containing multiple objects for multi-color printing, though that takes a bit of thought to do correctly.
To do multi-color printing it’s pretty easy now, just turn on the poorly named feature in preferences called “lazy-unions”. This will make it so that each top level object in your file gets exported as a separate subobject in the 3mf file.
That said, there are often times software gets so stable that not having a new release for years is fine. Maybe this is one of them?
(I'm very new to OpenSCAD so I haven't run into bugs yet... But maybe it's pretty solid?)
And even if it’s not perfect it saves a lot of time looking up the documentation and generally gets the relationships between objects right.
https://makerworld.com/en/models/2040939-accessible-christma...
As many correctly pointed out, STL & DXF are not considered professional file-formats anymore by some people. Some fabricators will not respond to quote requests, as without a Step file they are literately self-confessed useless clowns without Onshape/Fusion true solids handling the ugly math.
It is partially a unofficial standards issue, but customers without Step files may have to look around for fabricators. YMMV =3
but it has real problems - the language is weird and unfortunate. not anything super fatal, just the obvious product of evolution that would be more cohesive if it were architected wholesale
epsilons are really unfortunate. you have to expect that after getting what you want in the whole, you're going to have to scan over the whole thing and look for cracks or collision where there shouldn't be
performance is quite sad. here you are happy going back and forth between the view and text windows, but as you go on, it starts taking .. minutes.. to update the view once you have a reasonably complicated geometry
high-level operators would also be nice. I made the mistake of using a thread library once, not only did that make my model unrenderable, there was so much noise in the model and the manufacturing process I had to make 3 expensive test prints in sintered nylon to get the fit right. (I'm thinking an annotation on a cylinder that says 'standard 1mm thread')I don't really see why that code is better, more logical, more readable or more robust than the equivalent quite trivial parametrics in more or less any GUI CAD program, and I think the geek discourse is really harmed by people who don't understand the value of the things that OpenSCAD can't ever offer.
This difference is profound, is the point I am getting at.
It also lacks any concept of constraints or constraint solving in 2D sketches, which makes some quite simple shapes extremely difficult to make without advanced maths.
So in both cases you never get away from the maths, and the maths complexity increases as your design complexity increases. You can see this reflected in the complexity of any large OpenSCAD codebase and in the number of functions in any large utility library.
CAD software should aid design. That’s its entire purpose. OpenSCAD just lets you plot 3D shapes and do some very limited operations to combine them.
The big distinction is that those work implicitly, while OpenSCAD requires you to be implicit.
I looked into alternatives and learned about OpenSCAD. The immediate visual feedback makes picking up the language a breeze. Within an hour of downloading I familiarized myself with the language and had manifested my idea into a 3d model
I think that's a perfect example of a use-case where OpenSCAD shines. It's extremely easy to pick up if you have programming experience and it might even be a good thing to learn before moving onto more professional CAD software. From a teaching perspective, being able to have almost immediately-useful output is priceless
https://www.blockscad3d.com/editor/
I just wish that they'd add the balance of the language/fix some bugs.
>It's extremely easy to pick up if you have programming experience and it might even be a good thing to learn before moving onto more professional CAD software.
No, it definitely is not. OpenSCAD makes you think exactly the wrong way about CAD, because it forces you to reason explicitly about your model, when that is something which you need to let the CAD Software do for you. Modern Parametric CAD works by the user defining constraints, which the Software uses to derive the shape of the model, this is not something which conceptually exists in OpenSCAD.
>From a teaching perspective, being able to have almost immediately-useful output is priceless
Which is something which modern CAD does just as well.
Some of the features I used:
* Attachment & align. I can attach things to faces and I can align things to edges as needed.I wasn't super clear on how it work in the class, but I found that doing a simple exercise of aligning objects around the face of a cube increase my knowledge how it all work and my confidence.
* Chamfer. I am aware of some sort of fillet feature or rounding features but I mostly stick to chamfering my design for now.
* Teardrop shape. Mostly because I need it due to the constraint in FDM 3D printing.
* Some simple shorthand like right, left, up, down for when I don't want to use translate([x,y,z]).
* Constants and directions such as FRONT, BACK, LEFT, RIGHT, and so on, which can be applied to basic shapes.
* Diff. It works differently than openscad's standard difference and as far as I can tell very powerful if you understand how it goes together. I have difficulty in the past in figuring out how to use it, but once it does work, it's very cool. I planned to do an exercise so that I can better understand how it all works.
BOLS2 as far as I can tell is a very deep library so there's lot to learn. I would love to start contributing to it.
Anyway, a lot of OpenSCAD's flaws could be attributed to a lack of library development. I handrolled my own library to use in different projects before I realized that BOLS2 did everything that I could do but better.
Now, in the course of using it, I have issues with these tools as well. A lot of it is just getting used to the interface and the overwhelming complexity. They are not intuitive at all to use. Messing up required debugging why I am in a particular state. It's hard to figure out where the things I need are located. I am fairly certain that I would be real good at it if I stick at it long enough, but I invested more time and energy into OpenSCAD.
I am uncertain as to what you mean by constraint based modeling. I know I used it in these programs, but I don't really need these features nor do I need to do a lot of math in OpenSCAD that I would have need to use without a library. Maybe BOLS2 does do a lot of constraint modeling for me, but the documentation never talked about that with me. All I know is that I don't need to do as much math as I used to.
Rather, my complaint about OpenSCAD is legibility of objects and barebone UI features. Sometime, I don't know which is the front or back of the object, or maybe I want to know certain parameters of the objects unless you do the work beforehand. I want to know something like object.x and object.y for example, or the final compounded object width. Being able to pass information from one object to another is useful but that is lacking in some aspect of the language.
Just being able to label things in OpenSCAD would be tremendously useful for me.
Now, you can program in OpenSCAD with python, which seems to be a gamechanger. However, I have no idea on how it would interact with BOLS2, so I am kind reluctant to try it, but it would make objects in OpenSCAD much more legible to use.
The functional nature of openscad felt like a straitjacket at time but it did force me to get very familiar with recursion and all sort of ways on how to manipulate arrays. So I credited OpenSCAD for stretching my capability as a programmer. I still don't like recursion.
That said, despite the challenge of learning how to use BOLS2 for OpenSCAD, I am loving it especially when I finally grasped how a part of the library work.
https://news.ycombinator.com/item?id=37979758
https://news.ycombinator.com/item?id=40228068
OpenSCAD "just works", even on quite limited hardware, and if one has trouble modeling something, well, arriving at a solution is just a matter of learning the appropriate mathematics.
I found that standard CAD to be no simpler than OpenSCAD. Really, the biggest disadvantages that OpenSCAD have is usability and a library which is fixed by using BOLS2.
BOLS2 has the same problem as standard CAD, it is overwhelmingly big. In some cases, I didn't know features were already in BOLS2 so I don't have to reinvent the wheel writing my own inferior library.
So, how to tackle it? Same thing as any learning projects. I just tackle it in bite size chunk.
>and if one has trouble modeling something, well, arriving at a solution is just a matter of learning the appropriate mathematics.
Which is the terrible thing about OpenSCAD. YOU need to derive the equations. In a modern CAD program you define the constraints on the object and the equations are derived for you.
However, there are a number of limitations that are truly and deeply frustrating.
1. The language is downright weird. Don't get me wrong, it's a very nice little exercise in implementing a functional-tasting scripting language. Someone obviously wanted to scratch a functional DSL design itch and he did, but the result is unfortunately extremely limiting. Creating a function that does not return geometry is barely possible (only bloody lambdas IIRC). He should have picked python instead (and yes, I know about SolidPython2)
2. From my POV: the main headache with OpenSCAD is there is no way to partially evaluate an object and use the result of that partial evaluation in the rest of the construction. For example, if you try to take two complex assemblies and place them tangent to one another ... very good luck to you sir, I pray and hope the 3D math is really strong with you.
Whereas: if you had a simple rayIntersect(csg_tree, line_in_3d_spce) that would return the first intersection and two normals ... something you can reuse in subsequent transforms and construction, man would life be simpler.
These days, with LLMs you can sort of build a scaffolding to work around this by asking the agent to break down the assembly in multiple stages and use external libraries to do the partial eval for you, but ... ugh ... what a mess.
3. Speed. The moment your CSG assembly gets complex (e.g. uses a ton of morpho ... hull, minkowski, etc...), OpenSCAD crawls to a halt.
4. NO FILLETS. The age-old, standard methodology of building things CSG style with cubes, spheres, cylinders, etc ... and then once the object is finished adding the rounding ... simply not possible with OpenSCAD. Adding fillets after the fact once you've built a complex CSG tree ... nightmare with OpenSCAD.
So, YMMV, but caveat emptor, if you get serious with the toole, you're bound to hit some very hard walls.
And then, you discover that those darn LLMs have absolutely no spatial intuition. None.
It is seriously frustrating: one the one hand you can just feel the raw potential of vibe coding complex geometries, and on the other, when you do, you keep seeing the agent making mistakes a 5 year old playing lego would never make.
Absolutely infuriating.