The sphere Object

Here is an example of how to make a sphere:

ball = sphere(pos=(1,2,1), radius=0.5)

This produces a sphere centered at location (1,2,1) with radius = 0.5, with the current foreground color.

The sphere object has attributes pos, x, y, z, axis, length, color, red, green, blue, and up like those for cylinders. As with cylinders, up has a subtle effect on the 3D appearance of a sphere. The axis attribute only affects the orientation of the sphere and has a subtle effect on appearance; the magnitude of the axis attribute is irrelevant. Additional sphere attributes:

radius Radius of the sphere

Note that the pos attribute for cylinder, arrow, and cone corresponds to one end of the object, whereas for a sphere it corresponds to the center of the object.

Originally there was a label attribute for the sphere object, but this has been superceded by the label object.