A translation moves a simple or composite shape by a given distance. Of course, you could have defined the object at its final position. These two lines are equivalent:
translate(1, 2, 3, sphere(0, 0, 0, 1, plastic(red))); sphere(1, 2, 3, 1, plastic(red));
However, translations are useful when the translated object has been defined with a macro. If you need to place several instances of the same object at regular intervals, you should use Repeater instead.
Translations can be written using either the three translation components, or a vector for grouping these three values. In most cases, the scene optimizer is able to remove translations by applying then directly in the translated object.
As an alternative, you can use the move operator to simplify translations:
sphere(0, 0, 0, 1, plastic(red))) move [1, 2, 3];
The move, spin, size and loop are considered as operators with a precedence lower than additive operators. We have chosen four letter abbreviations for this operators both for consistency and to avoid excesive typing.
These special operators are the preferred way for transforming shapes for several reasons:
Home | Small Instantiation Language overview | SILLY predefined shapes | Transforms | Rotate | Scale | CSG operations | Infinite surfaces