OpenSCAD: how to create solid 3D objects

OpenSCAD-logo

OpenSCAD software

It is a free software application for creating solid 3D CAD objects and it is available for Windows, Linux and Mac OS X. You can download the last version directly from the official site.

It is not an interactive modeler, but rather a 3D-compiler, in fact the 3D models are developed writing a script code (and saved in .scad file) called OpenSCAD language. However OpenSCAD can also read and create 3D models in STL and OFF formats.

This makes the OpenSCAD a very easy and immediate application for creating 3D models without studying a lot of instruction as needed using other CAD applications.

openSCAD_software
Fig.1: The OpenSCAD software

Just for giving an idea, generally the steps to follows when you want to create a 3D object could be these:

Step 1: Choosing a 3D object to create. For example a pulley.

OpenSCAD-pulley

Step 2: Find in internet the 3D objects which are the most similar to our object (often on GitHub).

Step 3: Write or modify the SCAD code in the left panel, observing how these changes affected the 3D model shown in the right panel. (compile and show with the F5 key)

OpenSCAD-pulley02
OpenSCAD-pulley03

Step 4: Render the 3D model with CGAL rendering

OpenSCAD-pulley04

Step 5: Export it as STL file

Step 6: 3DPrint this file with a 3D Printer or send the file to a remote service providing the printing of 3D objects

OpenSCAD-pulley05
Fig.2: the pulley imported (as STL file) in the ThingInverse site

And if you print this pulley you obtain some plastic pulleys as the Fig.3 shows. The quality of the printing depends on the quality of the 3D printer.

OpenSCAD-pulley06
Fig.3: some pulleys printed by a 3D printer

Renderers and Model Views

Previewing of models: OpenCSG View

Rendering a model with CGAL can sometimes take several minutes or hours, but the user needs to see how his changes affected the 3D model in real time. At this purpose, it is possible to see the model with a preview: the OpenCSG view. In fact, this method produces instantaneous results. It utilizes the open constructive solid geometry (CSG) library to generate the model view utilizing OpenGL, taking care of details such as intersections, differences and minkowsky sums.

Rendered models: CGAL View

OpenSCAD renders the 3D models with the Computational Geometry Algorithms Library (CGAL) After the rendering it is possible to visualize the model in two different ways:

  • CGAL Surfaces
  • CGAL Wireframes

With the CGAL surfaces the model is shown in a very similar ways as it was shown with OpenCSG preview. With CGAL wireframes the model is shown with the “scaffolding” beneath the surface.

openSCAD_grid
Fig.4: The pulley represented with CGAL wireframes

The difference between the CGAL and OpenSCAD views can be seen at the edges created by operations

OpenSCAD-rendering
Fig.5: the difference between the two renders is visible with the calculated vertices.

If you want to know more about this two type of rendering and about the libraries with which they are implemented, you can find further information in the two following links:

This article will continue in the second part:  First steps with the OpenSCAD language.

Leave a Reply