Type: Design with code
Platforms: Mac, Windows, Linux, Web Cost: Free
Type: Design with code
Platforms: Mac, Windows, Linux, Web Cost: Free
Write simple code to generate 3D printable designs that can include geometric objects, text, and modifiable dimensions.
OpenSCAD is great at making parametric designs — models represented by numbers that can be easily adjusted to change the size, shape, or any other aspect of a design. If you want to make models with precise measurements, specific tolerances, moving parts, or enclosed hinges, or ones that use mathematical or procedural information, then OpenSCAD is one of your best free design options.
That may sound complicated, but in fact OpenSCAD is easy to learn even if you’ve never written code before, you can learn how to use OpenSCAD fairly quickly, and there are a lot of resources and examples online. OpenSCAD is a great choice if you’ve already used Tinkercad or Sculptris and you’re looking to level up your design skills or if you’re interested in learning how to write basic code.
With OpenSCAD, you can define variables in your design that are modifiable at any point of the design process, as well as sets of variables that depend on other variables. For example, you could use OpenSCAD to design a hinged box where the length of each of the hinges depended on the length of the lid, and define a parameter so that you could easily modify the clearance inside each of the hinges just by changing one number in your code. OpenSCAD also has the ability to handle loops, conditional statements, mathematical equation and calculations, and other algorithmic information that allow you to easily make complex designs.
Every model that OpenSCAD exports will be a high quality, solid, watertight STL file that can be understood by 3D printer software like MakerBot Desktop or other model slicers. Unlike programs like Sculptris, OpenSCAD was written specifically to create 3D printable models, and therefore it never exports bad or broken geometry. Of course, it’s still possible create designs that are difficult for your 3D printer to print, but with OpenSCAD that won’t be the fault of an error in your STL file.
On top of all that, OpenSCAD powers every model in the Thingiverse Customizer. By just adding a few comments to your OpenSCAD code, you can convert your parametric 3D designs into customizable models that people can modify with sliders, dropdown menus, and text input. For example, you could design a name tag that allows Thingiverse users to type in their own name, or a phone case that a user could size to fit their make and model of phone without the user having to interact with OpenSCAD code. Being able to create 3D models in OpenSCAD opens up a whole new world of interactive design possibilities.
Get started right away: Download OpenSCAD and then use the
translate([x,y,z]); commands to make a simple snowman.
These are some of the best Customizers on Thingiverse. Customizer models on Thingiverse are generated from OpenSCAD code. Use the Customizers to create your own custom versions of each model, or click View Source to view the OpenSCAD code.
These Thingiverse designs were created with OpenSCAD and include downloadable code, modules, or libraries that you can modify yourself in OpenSCAD. Use the code from these models to learn how to create your own parametric designs with OpenSCAD.
Image converters, color tools, height maps, rulers, text editors, and other technical OpenSCAD resources. Many of these aren’t models to 3D print; instead they are code files and tools that help you get advanced functionality out of OpenSCAD.
To get started with OpenSCAD, download the most recent version and open the program. You’ll see a text Editor on the left side of the screen and a yellow Preview window on the right, with a Console log below for reporting compile and error messages. (You can also use OpenSCAD online, in your browser, but you’ll have somewhat limited functionality; we recommend downloading the free OpenSCAD software and working locally on your computer.) “OpenSCAD” is pronounced “open-ess-cad”, but lots of people choose to say “open-scad” instead; you’ll hear both in common usage.
In OpenSCAD, designs are created with code. Here’s a simple example: Type
sphere(20); into the Editor (don’t forget the semicolon), and press “F5” (or “function-F5” on some laptops). You should see a sphere appear in the Preview window. If you wanted to export this sphere for 3D printing, you could now press “F6” to render the geometry of your object, and then use File > Export > Export as STL to generate an STL file for 3D printing. This is how OpenSCAD works in general: first type code into the Editor, then press “F5” to see a Preview of what you’ve made, and when you are finished with your design press “F6” to render the geometry and then “Export” to obtain an STL for 3D printing.
OpenSCAD has excellent online documentation where you can learn about commands, options, and syntax. Check out the resources below.
To make simple designs in OpenSCAD, you only need to know a few commands. Here are links to documentation about the most basic of those commands.
cube()command by defining different values for length, width, and height, and you can make cones with the
cylinder()command by defining the top radius and the bottom radius separately. You can also make 2D shapes like
square(), although any 2D shapes will have to be thickened before you can 3D print them.
translation()modifier, and rotate objects by using the
rotate()command. You can also change an object’s size in any dimension with
scale(), or make reflected versions of objects with
difference()command; this command works by drawing an object and then removing from that object the space taken up by any subsequent objects that you list. For example, you could make a cube with a cylindrical hole through the center, or a cylinder with a series of half-sphere potholes in it. You can also group objects together with
unionor obtain the region where two or more objects intersect with
linear_extrude(). For even more interesting options, try extruding around an axis with the
text()command to include text in your designs for labels, nametags, or personalization. The text command works particularly well with
difference()to get embossed or stencil effects, or with
union()to obtain a raised effect.
$fnmodifier determines the number of facets used in circles, spheres, and cylinders. In other words,
$fncontrols the resolution of your design. Use low values of
$fnfor fast-compiling draft versions or an angular low-poly look, or raise
$fnto large values for smoother, final models. You can set
$fnglobally for your entire design, or insert it into individual circle, sphere, or cylinder commands to set resolution locally.
Patrick Conner has an excellent series of OpenSCAD tutorial videos on YouTube. He goes over the basics slowly and clearly, and offers great tips for organizing your code. Even if you're an absolute beginner to computer code, these videos can help you get started with OpenSCAD quickly and easily. Once you watch those, check out David Dobervich’s series of three OpenSCAD tutorial videos on YouTube, for another introduction to basic shapes, transformations, and modules.
For more introductory resources, including tutorials and 3D modeling walkthroughs for OpenSCAD, try the links below.
Thingiverse Customizer is an app on Thingiverse that allows designers to add user-friendly sliders and controls to their OpenSCAD designs. Customizable Things make up a large portion of the popular content on Thingiverse, because users can personalize and modify Customizable things to fit their needs before 3D printing.
OpenSCAD is easy to learn and can produce nice models with nothing but simple code, but it also has a lot of design power under the hood. When you’re ready to move beyond basic transformations of basic and extruded forms, try exploring the commands below.
polygon()command, or construct 3D forms face by face with
polyhedron(). In each of these commands, you define the vertices of your object and then list the paths or triangular faces that should connect those vertices.
offsetcommand, or obtain the convex hull of a collection of objects with
hull. If you’re feeling adventurous and don’t mind the slowdown from calculations, try creating “sums” of objects using the