OpenSCAD

OpenSCAD is a programming language for solid CAD objects.

OpenSCAD is free software for GNU/Linux, MS Windows and Mac OSX. It provides two main modeling techniques: First, constructive solid geometry (CSG) and second, extrusion of 2D outlines. Autocad DXF files are used as the data exchange format for the 2D outlines. In addition to reading DXF files, OpenSCAD can also read and create 3D models in the STL file format, which is commonly used for 3D printing. It is also possible to read design parameters from text files.

OpenSCAD is a completely text-based programming environment which is free, powerful, and open-source. However, it can be very slow to render complex objects, and some aspects of the language are unusual (such as the assignment of variables at compile time).

Getting Started with OpenSCAD:

  • Go to http://www.openscad.org/ and download OpenSCAD for your operating system. In MacOSX, you may need to right-click on the application, in order to open it, as the executable is not signed. (Check out this link for the most up-to-date development version, which dates from 12/31/2014; note that Animation frame exporting seems to be broken for that version.)
  • Copy-paste the following program for an “iterative form” into the white “Editor” area on the left half of the UI:
    for ( i = [-2 : 2] ){
        translate ([i*10, 0, 0]){
            cylinder(h = 20, r1 = 8, r2 = 4);
            translate ([0,0, 20]){ 
                sphere (r = 6+i);
            }
        }
    }
    
  • From the OpenSCAD menu, select Design > Render. Wait a few moments. You should see this appear in the yellow area:

Screen Shot 2015-01-04 at 3.59.38 AM

It’s also possible to use OpenSCAD to create 4D animations. In the OpenSCAD menu system, select View > Animate. Now in the lower right part of the UI, you will see an interface that allows you to specify the number of animation steps and the desired frames per second:

Screen Shot 2015-01-04 at 4.28.45 AM

Now Change the code so that it uses the special “animation” variable, $t, which is swept from 0….1. You will now see an animation.

for ( i = [-2 : 2] ){
    translate ([i*10, 0, 0]){
        cylinder(h = 20, r1 = 1+8*$t, r2 = 4);
        translate ([0,0, 20]){ 
            sphere (r = 6+i);
        }
    }
}

An “Dump Pictures” checkbox allows you to export frames of this animation, which you can compile (in Photoshop etc.) to create an animated GIF:

scadtest

Incidentally, another advantage of OpenSCAD is that it can “stub out” control parameters for end-user manipulation and exploration in external applications like the Thingiverse Customizer. The Customizer tool creates slider interfaces for select program variables exposed by the OpenSCAD programmer. An example of this can be seen in these Fraction Blocks (by Bitcraft Lab): http://www.thingiverse.com/thing:218491.

fraction-bars-customizer


Tutorials to Follow:

Key Resources for the OpenSCAD Language:

Also Noteworthy:
OpenSCAD has some particularly powerful functions that deserve your attention:

Browser-Based Versions of OpenSCAD:
If you prefer not to install new software on your computer, alternatives exist which allow you, to a greater or lesser extent, to use OpenSCAD in your browser. Your mileage may vary, but if you wish, you may try the following: http://openscad.net | http://openjscad.org/.