Messing around with OpenSCAD
I recently wrangled access to a Makerbot, and/or a RepRap Mendel, both Arduino powered 3-d “printers”. The idea is, you feed a digital 3d model into the machine from a computer, and it melts and extrudes plastic, and deposits it in layers to slowly build up a physical manifestation of the digital 3d model.
This means, if you want something made of plastic, and you can make a 3d model of it on a computer, and meet some other constraints (e.g. you can’t deposit plastic onto thin air, so overhangs in the model can be a problem), you can just “print it out.”
So it seems like a lot of people use either Art of Illusion, a 3-d modeller written in Java, or Blender, another 3d modeller (the latter being used mostly for animation and for making computer game art assets.)
I tried to learn these, and got to where I was sort of half-assed proficient in Blender (but subsequently forgot most of it). But I always found these types of program to be very fiddly. Very hard to get various components lined up just right, oriented just right, and dimensioned just right.
This is where OpenSCAD shines. It has a very different way of doing things than Blender or Art of Illusion. You build up your design via a script which adds cubes (cuboids), cylinders, cones, spheres into the scene, adds and subtracts them from each other as your script directs, and builds up your model in this way. Getting things lined up, oriented, and properly dimensioned is, to my way of thinking, much easier this way.
It does appear to have some limitations. Reading the docs, the language design itself seems a bit twitchy (for example theres an intersection_for primitive because intersections inside for loops don’t work quite right for some reason, and variables should be thought of as immutable, yet, if you have two assignments, the last one is the only one that counts, apparently. Well, maybe this stuff will get smoothed out in time.)
Well, I made a little video:
Update: Jan 15, 2011: 2nd iteration of the design. I cut the key down, a bit so that the whole assembly can be smaller, and I got a bit better at OpenSCAD: