Transform

All visible elements in a structure (or document) are held by transforms. Transforms itself are not directly visible. However, the pivot of the Manipulation Tools indicates the location of a transform in the structure. Transforms in smile2 are responsible for placing elements in the structure [1].

Each transform can contain a leaf that holds the visible part of an object (in local coordinates), eg. a polygon. It can also contain references to other transforms as children. In this manner, the ‘visible’ part of smile2 documents are built up from a hierarchical structure of transform nodes.

Note

References of each transform can be placed as a child in more than one “parent* transform. Here care has to be taken that, a transform is not at the same time it’s parent and child, since this would lead to an infinite recursion. Therefore, mathematically spoken, transforms form a directed acyclic graph. A consequence of this, is that the absolute location of an element cannot be determined from a single transform, but only from a path of transforms.

../_images/transforms_ui.png

The Outliner displays the Transform hierarchy, the Attribute Editor the properties (plugs). If the selected Transform has a leaf (“leaf” = “shape”), then its properties can also accessed through the doc:/editor-attributes.

More about the working principle of transforms can be found in the plugs chapter.

Transforms have in total 6 (linearly independent) parameters to set the position, size, and orientation of an object [2]. Additionally, transforms node have an additional (relative) translation parameter, called origin.

The main output of a transform is a 3x3 matrix, computed in the following way:

../_images/math_trans.png

where, T is the translation matrix, TO the local origin translation, TOC an internal origin compensation translation [3], R the rotation, S*shear* the shear matrix, and Sscale the scale matrix. In detail:

../_images/math_mats.png

Attribute Reference

Name

niceName dist10 (⇨ wstring) dist50 plug_in plug_out , f_default Unnamed

Derived from Node. Human readable name of this node (eg. “Rectangle 1”). The name can be changed to any string in the Attribute Editor or in the Outliner.

Transformation settings

Translation

translation dist10 (⇨ vec2) dist50 plug_in plug_out , f_default 0 0

The translation, relative to the transforms parent (in “parent” coordinates).

Scale

scale dist10 (⇨ vec2) dist50 plug_in plug_out , f_default 1 1

The scale, relative to the transforms local axes.

Rotation

rotation dist10 (⇨ double) dist50 plug_in plug_out , f_default 0

The rotation, relative to the transforms parent axes.

Shear

shear dist10 (⇨ double) dist50 plug_in plug_out , f_default 0

The shear, relative to the transforms local axes.

Origin

origin dist10 (⇨ vec2) dist50 plug_in plug_out , f_default 0 0

A shift of the origin, in local (object) coordinates.

Visibility

Visible

visible dist10 (⇨ bool) dist50 plug_in plug_out , f_default True

If on the leaf and all children are visible, if off the leaf and all children are hidden (And not exposed as well).

Behavior

Overwrite child layer

overwriteLayer dist10 (⇨ bool) dist50 plug_in plug_out , f_default False

If on, the layer from this (topmost) transform determines the layer membership of the instance (or transform path).

If off, the layer membership is defined by the root transform.

This option has only effect, if the hierarchy depth is >=2 and child and parent have a different layer membership.

Other Attributes

Object Name

name dist10 (⇨ string) dist50 plug_in plug_out , f_default Unnamed

Derived from Node. The object name can be used to address objects from PYTHON scripts or from an expression (eg. in the Attribute Editor). More information about object names can be found Object Names

PYTHON Reference

Deriving from Transform

Note

Usually it is not necessary to derive from this class. However, if you think it is, please let us know about your user case.

The following methods can be overwritten in a subclass;

TODO

[1]If you are familiar with GDSII: smile2s Transforms compare best to GDSIIs SREF.
[2]Internally, transformations are described in 3-dimensional space.
[3]This translation is necessary to keep things “at the same place”, whenever the origin is changed with non trival rotation/scale/shear parameters already applied. This translation is fully managed “under the hood”.