cylinder¶
- cylinder(pos=vec(0, 0, 0), axis=vec(3, 0, 0), color=color.red)¶
- Parameters:
pos (vector) – Position of left end. Default <0,0,0>.
axis (vector) – Extends from pos to end. Default <1,0,0>.
color (vector) – Default color.white.
radius – Radius of the cylinder. Default is 1.
length (scalar) – Length of axis. Setting length sets magnitude of axis. Default is 1.
size (vector) – Length, height, width of a box surrounding the cylinder. Default is <1,1,1>.
By setting size appropriately one can make the cross-section of the cylinder elliptical instead of circular.
Attributes used less often:
- cylinder(opacity=0.5, shininess=0.2, texture=textures.wood, make_trail=True, canvas=mycanvas, emissive=False)
- Parameters:
opacity (scalar) – Default 1.0; Range 0-1.
shininess (scalar) – Default 0.6; Range 0-1.
emissive (boolean) – Default False. Object glows, losing all shading, if True.
texture (class element or path) – Default None.
visible (boolean) – If False, object is not displayed. Default: True
canvas (object) – Default is
scene
.make_trail (boolean) – If True, object leaves a trail when moved. See Attaching a Trail for more options.
up (vector) – A vector perpendicular to the axis.
group (object) – The group to which this object belongs.