The following transformations are available to modify the scope of the current shape:
- t(tx, ty, tz) — translates the scope's position along the scope axes.
- r(rx, ry, rz) — rotates the scope around its origin by adding rx, ry and rz to the scope's rotation vector scope.r. It is also possible to rotate around the scope center by writing r(scopeCenter, rx, ry, rz).
- s(sx, sy, sz) — sets the scope's size to the values of sx, sy and sz. Hence, in contrast to the translate and rotate operations, the parameter values are not added but overwritten. Furthermore, note that the size operation sets the size in absolute values (e.g., meters or yards) and does not perform a relative scaling.
- center(axes) — translates the scope of the current shape such that its center corresponds to the center of the scope of the previous shape on the shape stack, according to the axes. The latter determines in which axis directions (of the previous shape on the shape stack) the translation is performed.
Relative operator
For the t() and s() operations it is possible to conveniently transform the absolute values tx,ty,tz or sx,sy,sz to values relative to the scope size using the operator '.
s('0.5, '1, '1)
t('2, 0, '3)
This is equal to:
s(0.5*scope.sx, 1*scope.sy, 1*scope.sz)
t(2*scope.sx, 0*scope.sy, 3*scope.sz)
Examples
Setting the size
The extruded Lot is set to an absolute size of 5 units in all three dimensions.
|
Relative resizing and center
The scope is first sized down by using the s() operation in conjunction with the relative operator ', then centered (relative to the scope of the Lot shape) and finally extruded to a 3D geometry.
|
Rotation and center
Each split shape is first rotated around its scope origin and then centered.
Using r(scopeCenter, 0, 360*split.index/split.total, 0)instead of the r() center() sequence gives the same result. |
Translate - Rotation concatenation
This is the shape we start with.
| |
First a translation of two units along the x-axis.
| |
Then a rotation of 30 degrees around the y-axis.
| |
And another translation of 2 units along the x-axis:
|
See the t operation, s operation, r operation, and center operation in the CGA reference for further detail.