Learning OpenSCAD Boolean and transformation operations
In this section, we will cover some of the basic Boolean and transformation operations. We will then use this knowledge to build a PVC pipe hook, as shown in Figure 4.3.
Let's start with Boolean operations.
OpenSCAD Boolean operations
There are three Boolean operations in OpenSCAD. These are as follows:
union()
– This operation joins shapes together. This can be used for 2D or 3D shapes (but not at the same time).difference()
– This operation subtracts the second and subsequent shapes from the first shape. This operation may also be used on 2D and 3D shapes, but not at the same time.intersection()
– This operation creates an intersection between shapes. Only the area in which the shapes overlap is retained. This may be used with 2D and 3D shapes as well, but not at the same time.
To demonstrate how each Boolean operation works, let's use a simple sketch. To do so...