To create a cylinder, you need to specify both the height of the cylinder
and the radii for the top and bottom circles of that make up the shape of
the cylinder. In this case both of the radii are the same.
Type the following code into the pane on the left:
Compile the code
Now, compile the code by pressing F5 (fn + F5 if you are on a Mac laptop).
You should now see a cylinder, as shown in Figure C-2 .
Figure C-2. Create a cylinder
Subtract the inside from the outside
Next you need to remove a cylinder from the inside of the ring band, so
that you can put it on your finger. Removal of one object from another in
OpenSCAD is done using the Boolean operation difference .
You will take the first cylinder and then create a cylinder that is 2mm
smaller and double the height inside it, removing the space occupied by
the first cylinder using difference.
Using difference to subtract one shape from another is just like setting
up a subtraction problem. You are subtracting the second object listed
from the first object listed. Type the following code into OpenSCAD, re-
placing the code you just ran, then press F5 to compile and display your
cylinder(h=6,r=18); // outside of ring
cylinder(h=20,r=16); // inside of ring