Composite Objects with frame

You can group objects together to make a composite object that can be moved and rotated as though it were a single object. Create a frame object, and associate objects with that frame:

f = frame()

cylinder(frame=f, pos=(0,0,0), radius=0.1, length=1, color=color.cyan)

sphere(frame=f, pos=(1,0,0), radius=0.2, color=color.red)

f.axis = (0,1,0)

f.pos = (-1,0,0)

By default, frame() has a position of (0,0,0) and axis in the x direction (1,0,0). The cylinder and sphere are created within the frame. When any of the frame attributes are changed (pos, x, y, z, axis, or up), the composite object is reoriented and repositioned.