Cylinder
HC
Graphics
Drawing filled shapes
Cylinder
Cylinder length baseradius
(Cylinder length baseradius topradius startangle endangle scrunch slices)
command to draw the surface of a cylinder in 3D space. The top and bottom faces are not included currenty. The arguments should be all numbers. Using either baseradius=0 or topradius=0 will draw a cone. startangle and endangle are given in degrees, 360 being one whole circle. A partial cylinder can be drawn by using a smaller difference of endangle to startangle than 360 degrees. If you chose the difference between the angles much higher, you may get strange looking, folded shapes. scrunch is a factor usually in the range of 0..1..10, which is multiplied to the coordinate along the direction of the turtle heading. slices is the number of partial faces the Cylinder will have.
Examples:
cs perspective
setPenColor "red
Cylinder 200 100
fd 200
(Cylinder 200 100 0)
cs
(Cylinder 300 200 100 0 90)
cs
(Cylinder 300 200 100 0 360 2)
cs
(Cylinder 300 200 100 0 360 1 5)
|
Example:
References: