-
Notifications
You must be signed in to change notification settings - Fork 76
Pi3D createMergeShape
This object can merge together any of the created shapes including other merge shapes into one single 'shape' object. This is much faster to render than rendering lots of individual shapes.
The MergeShape has special features such as 'radialCopy' and 'cluster' which allows copies of a single shape to be merged through a series of rotations or scattering. 'ForestWalk.py' is a great example of 'cluster' merging.
Example code:
mycube = pi3d.createCuboid(1,2,1)
mymergeshape = pi3d.createMergeShape("two cubes")
mymergeshape.add(mycube, -2,0,-2)
mymergeshape.add(mycube, 2,0,-2)
Or,
mycube = pi3d.createCuboid(1,1,1)
mymergeshape = pi3d.createMergeShape("turret")
mymergeshape.radialCopy(mycube,0,0,0, 3,3, 0,360, 12)
... creates a ring of 12 cubes in a circle around the Y axis