3D Printing, Maker, Programming

OpenSCAD is Awesome

I’ve been getting into 3D printing, and until recently, I was using SketchUp to create all of the models for my 3D prints. However, whenever I needed to do anything even mildly involved, like align the center of a sphere with the center of the top of a cylinder (or even create a sphere in the first place), I found the limitations of visual modeling frustrating. I thought to myself, “Why can’t I just write a program or use something like SVG to describe the model I want?”

Of course, a solution already existed: OpenSCAD. OpenSCAD is a free and open-source scripted modeling program for solid CAD objects — instead of drawing the shapes you want, you write a program that describes them. Switching to it from SketchUp has been like being able to stretch my legs after a long cramped airplane flight. Consider my latest print:


It’s a replacement tray for this card shuffler I bought for $0.25 at a garage sale a decade ago:

It only required 33 lines of code. The total time I spent starting from when I created the file in OpenSCAD to when I exported it as an STL file was twenty-two minutes, and that included pausing to feed my one-year-old daughter some mashed bananas. To design the same model in SketchUp would have taken at least an hour without the bananas. (Here’s the OpenSCAD file with some additional comments and newlines.)


So if you’re a programmer that would like to create 3D models but you find visual CAD limiting or frustrating, consider OpenSCAD.


One comment on “OpenSCAD is Awesome

  1. I don’t own a 3d printer (although I’d like to someday if I can convince myself I’d use it enough), but I have also dabbled with OpenSCAD and had the same experience as you. I find using traditional 3d modeling tools frustrating because they don’t offer enough manual control, and feel like they’re targeted at artists, not designers. I’ve used AutoCAD at a past job and that’s a lot more satisfying, since that’s targeted at design where precision is important, but it’s also super expensive. OpenSCAD (while a bit tricky to get right) at least lets me approach 3d design as a programming problem, which I’m pretty good at. :) The only design of note that I’ve done (but never really finished) is this Raspberry Pi case:

Leave a Reply

Your email address will not be published.