In Chapter 2, we introduced the basic mechanics of OpenSCAD. In this chapter, we will first introduce
some concepts you’ll need as we start talking about more complicated shapes. Then, we’ll introduce
our first real model, and talk through what it does and how to modify it.
Then, we’ll jump into using OpenSCAD to simulate some of the basic ideas in geometry. If you were to
compare the table of contents of a geometry book and the list of commands in OpenSCAD, you would
notice a lot of overlap. This is, after all, why this category of CAD programs is called “Constructive Solid
Geometry.”
We highly recommend that as we walk through the chapter, you actually type the short models into
OpenSCAD as we discuss them. As you do this, you should mess with the numbers, change things, and
see what happens.
In this chapter, we’ll also introduce a few of the more sophisticated coding constructs and OpenSCAD
features that we use in upcoming models. If you
aren’t interested in learning to make models
yourself you can skip some of this detail, but we
hope that you are inspired to take the program out
for a spin too. In some cases, you’ll need material
from later in the book to fully appreciate what is
going on. In those cases, we will note where the
material is explored later in the book, but intro-
duce the OpenSCAD capability here. That way, the
OpenSCAD-focused (versus geometry-focused)
material is in one place for you as a reference.
We will walk you through using one of the models
to create Platonic solids, which are objects whose
faces are all regular polygons, all of which meet
at equal angles. This will give you some practice
with using a model from the repository and mod-
ifying it.
We’ll guide you through a model that makes a
simple (but very extensible) castle, to tie together
OpenSCAD and geometrical concepts and give
you some experience with going step-by-step
through a model. Finally, we’ll also briefly discuss
Tinkercad, a simpler CAD program that can do
some of this simulation as well.
3D Printable Models Used in
this Chapter
The following models are discussed in this
chapter. See Chapter 2 for directions on how to
download them. There are also quite a few model
fragments scattered in this chapter. Be sure to
type them in and try them out.
platonicSolids.scad
Prints one of each of the five Platonic solids. This
model scales all five so they are the same height
as each other on the print bed.
edge_platonic_solids.scad
Prints one or more Platonic solids, scaled by the
user input length of one edge.
castle.scad
Prints a castle, developed as an exercise in the
various moving and scaling functions in this
chapter.
30 Chapter 3: Simulating Geometry Make: Geometry 31
Geometry_Chapter10_v15.indd 31Geometry_Chapter10_v15.indd 31 6/23/2021 9:08:39 AM6/23/2021 9:08:39 AM