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();
![](https://www.openscad.info/wp-content/uploads/2020/05/Selection_579.png)
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.
![](https://www.openscad.info/wp-content/uploads/2020/05/Selection_580.png)
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.
![](https://www.openscad.info/wp-content/uploads/2020/05/Selection_581.png)
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.
![](https://www.openscad.info/wp-content/uploads/2020/05/Selection_582.png)
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.
![](https://www.openscad.info/wp-content/uploads/2020/05/Selection_583.png)
If we want a second radius we can add it as such
cylinder ( h=7, r1=7,r2=10 );
![](https://www.openscad.info/wp-content/uploads/2020/05/Selection_584.png)
We can also provide diameter instead of radius
cylinder ( h=7, d1=7,d2=10 );
![](https://www.openscad.info/wp-content/uploads/2020/05/Selection_585.png)
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);
![](https://www.openscad.info/wp-content/uploads/2020/05/Selection_586.png)
Normally the origin of the cylinder is at the base of the unit.