Will take the 2D shape and make
it height millimeters tall in the
z-direction. To use linear_extrude,
you first create a 2D shape and then
extrude it. Only the height argu-
ment is required. If you just use one
number in linear_extrude like
this:
linear_extrude(5)
circle(15);
that’s the height in the z direction.
The example just given will create
a circle 15mm in radius in the x-y
plane and 5mm thick in the z direc-
tion. Technically, the height variable
event isn’t required. It defaults to
100mm.
What about those other variables? If
center = true, the extrusion will
go half in the +z direction and half in
the -z direction. The variable twist
allows you to twist the extrusion
through that many degrees as it
goes up. If you set twist = 360, the extrusion will go through a full circle’s
worth of twist on its way up. Try this out with a square (Figure 3-9).
linear_extrude(height = 15, twist = 360) square(10);
The slices variable allows you to set how jagged or smooth the extrusion
is in the upward direction, sort of like a third dimension for $fn that we
discussed earlier in this chapter. This only matters if you are making your
extrusion have a twist. A higher number is smoother (Figure 3-10).
linear_extrude(height = 15, twist = 360, slices = 100)
sq u a r e(10);
The scale variable expands or contracts the top of your extrusion. The
bottom of your shape will have the given dimensions, and the shape will
FIGURE 39: Linear extrude with a twist
FIGURE 310: Linear extrude with a twist and more slices
46 Chapter 3: Simulating Geometry Make: Geometry 47
Geometry_Chapter10_v15.indd 47Geometry_Chapter10_v15.indd 47 6/23/2021 9:08:43 AM6/23/2021 9:08:43 AM