Transforms: Translate

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.

The move operator

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:

  1. They are applied after the simple or complex shape they transform, so the whole transformation is easier to read.
  2. They avoid innecesary parenthesis and nesting when several transformations are applied to the same original shape.
  3. Both move, spin, size and loop are considered keywords, and they are highlighted by the code editor.

See also

Home | Small Instantiation Language overview | SILLY predefined shapes | Transforms | Rotate | Scale | CSG operations | Infinite surfaces