M0UNTAIN 0F C0DE

3D Modeling For Developers

3D Modeling OpenSCAD

When I first got a 3D printer I was excited about being able to create all kinds of custom parts for my projects. Initially I was content with downloading and printing cool tat from Thingiverse but that didn't last long, I wanted to make my own stuff.

Searching for 3D modeling software compatible with Linux lead to FreeCAD, this was a few years ago there are many more options now. I watched a bunch of tutorials and read examples but it was such a steep learning curve. It felt like I was having to learn to use a 5-axis milling machine when all I wanted to do was make a straight cut in a piece of softwood.

I tried to push through and get over the initial hump but I just got more and more frustrated with it. It wasn't for me.

A week or two later while I was causally browsing HackerNews I happened to come across an article on OpenSCAD. At first I was sceptical, the FreeCAD frustration was still raw, it seemed very simple, too simple. What immediately clicked for me was that it was declarative, you write code to generate 3D models:

cube([20,20,10]);

translate([0,0,10]) cylinder(d=20, h=10);

OpenSCAD Example

This was perfect! I was immediately able to start designing things, code is how my brain works. It felt fairly limiting at first but reading through the official cheatsheet showed that it was really powerful. Beyond the simple primitives like cube and cylinder there is logical flow control, loops, functions, modules, etc.

It also fit really nicely with workflows I was already using like Git! I've since designed a bunch of useful parts, I created a repo which has most of them in.