cylinder();
First to make it a little easier on the eyes type in this command:
$fn=25
This will result in all the cylinders you draw to have 25 “faces”. Cylinders are rendered in OpenSCAD by drawing many faces rotated around a center. The larger the number in the variable $fn, the smoother the cylinder will appear.
The cylinder command in its basic form
cylinder();
This will draw a single cylinder with a comman radius of 1 and height of 1.
We can extend the basic command by adding a value
cylinder(10);
will draw a single cylinder with a common radius of 1 and height of 10.
To change the radius we must move to the second form
cylinder(10,5);
will draw a cone shaped cylinder with a height of 10 and a bottom radius of 5.
We can turn this cone into a cylinder by adding a second radius
cylinder (10,5,5);
Now we have a cylinder 10 units tall with a common radius.
There is a more expicit way of denoting the parameters we can assign values to Hieght and Radius explicitly.
cylinder ( h=7, r=7 );
cylinder ( r=7, h=7 );
both yield a cylinder 7 untis high and 7 units in radius.
If we want a second radius we can add it as such
cylinder ( h=7, r1=7,r2=10 );
We can also provide diameter instead of radius
cylinder ( h=7, d1=7,d2=10 );
Finally if we can move the origin of the cylinder to the very center ( Height and Radius ) we can use the center keyowrd.
cylinder ( h=7, r1=7,r2=10 , center = true);
Normally the origin of the cylinder is at the base of the unit.