meta data for this page
This is an old revision of the document!
Cylinder
A three dimensional shape with two flat ends that are circular. The cylinder has the same cross-section from one end to the other, extending about the Z axis.
Learn about cylinders at MathIsFun.com
The radius specifies the circular size about the Z axis, while the height specifies the size. Cylinders can be created at a requested center. The segments specify the number of segments to create per full rotation.
Defaults:
- radius : 1
- height : 2
- center : [0, 0, 0]
- segments : 32
const myshape = cylinder({radius: 5, height: 10}) const myshape = cylinder({radius: 5, height: 10, center: [5, 5, 5], segments: 64})
Elliptical Cylinder
Various cylindrical shapes can be created using the elliptical cylinder, including cylinders with changing radius (cones).
Defaults:
- radius : 1
- height : 2
- startRadius: [1, 1]
- endRadius: [1, 1]
- center : [0, 0, 0]
- segments : 32
- startAngle: 0
- endAngle: PI * 2
let myshape = cylinderElliptic({height: 2, startRadius: [10, 5], endRadius: [8, 3]})
Rounded Cylinder
Cylinders can be created with rounded ends by specifying roundRadius.
Defaults:
- radius : 1
- height : 2
- roundRadius: 0.5
- center : [0, 0, 0]
- segments : 32
const myshape = roundedCylinder({radius: 5, height: 10, roundRadius: 0.5}) const myshape = roundedCylinder({radius: 5, height: 10, roundRadius: 0.5, center: [5, 5, 5], segments: 64})