The great thing about OpenSCAD is that it makes it easy to 3D model things which may be described using spheres, cylinders, and cubes which are stretch, and/or rotated, and arranged in 3D space.
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:
> The great thing about OpenSCAD is that it makes it easy to 3D model things which may be described using spheres, cylinders, and cubes which are stretch, and/or rotated, and arranged in 3D space.
It also has hulls and minkowski sums, which are powerful once you understand them.
There's also OpenJSCAD. Which, being JavaScript ofc, can run in the browser
I think people should also give Bowler Studio a shot. It has a pretty decent Java-based CAD thing, and it even has built in Clojure support, with physics simulation support and everything. I really like it.
You can also make more complex shapes if you're willing to define points, even on a 2D plane that you can then extrude. Downside is that it's basically a MENSA test to define all of the points in the correct order. I've done it a few times, but it's never fun.
Also you can use the new backend by writing C++: https://github.com/elalish/manifold
Which avoids using the OpenSCAD language, but also means you can't use BOSL2. Might as well use FreeCAD.
Another interesting option is FreeCAD, which is scriptable in Python but its primary interface is a GUI. So you can use a script to create things programmatically, edit graphically, or both.
I've had really good luck with https://github.com/SolidCode/SolidPython
I ended up adding the https://github.com/BelfrySCAD/BOSL2 library to OpenSCAD and it had some reasonable options for some gear and rack-and-pinion modeling that I needed to do.
(3D printing a sacrificial gear for a seat position adjustment mechanism)
Or perhaps take a look at cadquery? It’s also pretty neat - http://cadquery.readthedocs.io/
Thanks for this, didn't know about it.
How does that compare to solid python 2?
> 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.
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.
Not just that but it also positions everything in absolute coordinates and does not have the ability to reason about solids, just surfaces. Basically if you want to model something like a bolt you need to create a cylinder for the shaft, a separate head of the bolt, and then a thread profile you can rotate around the cylinder. You must ensure there is enough overlap between these three separate parts so the resultant object is a single surface and not three separate ones.
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.