I have a 3D printer. It’s a lot of work, but is also a lot of fun. It’s fun because turning 3D models into actual, tangible objects is cool. It’s work, because it requires a lot of tinkering to get it right. You need to churn out a lot of small objects to make sure the printer is calibrated correctly. The object should be simple enough that you can measure how much you need to tweak for the next print.
I figured early on in my printing career that I’d print something that people would like to have, even if the print quality wasn’t perfect. And what’s a better thing to print, both in terms of calibration and in terms of being neat to have, than Ralph, thoughtbot’s lovable mascot.
I’ve made quite a few so far.
Thing is, Ralph started as an image, not a 3D model. But if we have a few pieces of software (and a 3D printer), we can turn an image like Ralph into solid chunk of plastic.
I used an Open Source vector drawing program called Inkscape to modify a vector image of Ralph that our designers made. But because I didn’t want the eyes and brainwaves to fall over, I needed a backing to hold it all together. Once I modified the vector drawing to close up all the gaps, I had all the pieces ready to make the jump into 3D.
The Third Dimension
Taking the front and back vector images and turning them into a 3D object required another program, OpenSCAD. This is an Open Source 3D modeler that builds objects via code, rather than clicking, pushing, and pulling graphically. I imported the vectors and extruded them on top of one another and ended up with the object you can see above. This is an STL file. There are a number of other ways to do this, like using OpenJSCAD or TinkerCad, or directly via Inkscape.
STL files are the standard format for printable 3D models. GitHub can display them and even perform diffs on them, which is really useful if you ever need it. There are also a number of sites like Thingiverse that contain multitudes of objects ready for the printing. Some even come with OpenSCAD source so you can easily modify them to suit your needs.
Here’s what Ralph looks like on GitHub’s STL viewer:
Cutting it up
Once you have a 3D model in STL format, you need to turn it into instructions for the printer to follow. We give it to a program called a slicer, which compiles the 3D model to printer machine code. The program turns the 3D model into horizontal slices that the printer can use to build the object up, layer by layer. I use a program called Slic3r, which is also Open Source and fairly easy to use. These Ralphs were to be printed two at a time, so I scaled down the model and arranged two on the print surface.
All the physical calculations happen during slicing: how fast the nozzle moves, how it gets to every single spot on the layer, how much plastic to put there, what pattern it’s going to use to fill everything in, how thick each layer will be, and so on.
The neat thing about this is that, because it did all these calculations, it knows how much plastic it needs to build the model. These two Ralphs need 4.7 meters of filament (for a total of 31.2 cubic centimeters of PLA plastic).
This is where the vast majority of software tweaking comes in to play, as these variables can make a print look awesome or terrible. Fortunately I’ve recalibrated my printer, so I was pretty optimistic that these would look good. Here are a few pictures of some older Ralph prints I made (on the left of each) compared to a print from this batch (on the right):
And the end result is a plastic Ralph (or 10) that can sit on your desk and cheer you on while you’re furiously coding away. 3D printing is still young, but it’s a really fun hobby to get into, especially if you’re the kind of person who loves to tinker.