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. You can also 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. In contrast to the translate and rotate operations, the parameter values are not added but overwritten. Note that the size operation sets the size in absolute values (for example, meters or yards) and does not perform a relative scaling.
- center(axes)—Translates the scope of the current shape so 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 direction (of the previous shape on the shape stack) the translation is performed.
Relative operator
For the t() and s() operations, you can 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 the following:
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 ', and 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 you 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 topics in the CGA reference for more details.