PDM-UG: Conversion from Implicit to Explicit Transformation Information
From WikiSTEP
This page belongs to the PDM Usage Guide.
In STEP, there are two possibilities of representing a transformation between two geometric models. In an implicitly defined transformation the item_defined_transformation entity is used with two representation_items (mostly axis2_placement_3ds) before and after applying the transforming function. In an explicitly defined transformation, this function is given by an instance of cartesian_transformation_operator. The operations allowed in this context are rotation and translation.
The intention of this section is to demonstrate how to extract the transforming function from an item_defined_transformation and model to an explicitly defined transformation from this information. Therefore, an example is constructed. First, the implicit way is shown, then the conversion will be calculated and finally the explicit representation is described.
Contents |
Implicitly defined transformation
To implicitly define a transformation between two representation_items, the following entities and attributes are needed (see Diagram 18).

This structure can be rediscovered in the following fragment from a Part 21 file:
/* representation_item 1 */
#1000=CARTESIAN_POINT('', 1.0, 1.0, 3.0);
#1010=DIRECTION('', 0.0, -0.8660254, 0.5);
#1020=DIRECTION('', 1.0, 0.0, 0.0);
#1030=AXIS2_PLACEMENT_3D('', #1000, #1010, #1020);
/* representation_item 2 */
#1050=CARTESIAN_POINT('', 2.0, 2.0, 1.0);
#1060=DIRECTION(''<nowiki>, 0.0, 0.0, 1.0);
#1070=DIRECTION(<nowiki>'', 0.7071068, 0.7071068, 0.0);
#1080=AXIS2_PLACEMENT_3D('', #1050, #1060, #1070);
/* transformation */
#1100=ITEM_DEFINED_TRANSFORMATION('', '', #1030, #1080);
#1110=REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION('', '', #800, #900, #1100);
Conversion
The first step is now to extract the two matrices implicitly given by each of the two placements. The axis2_placement_3d has a name, a location and two axes as attributes. The axes are the axis and ref_direction attribute, where axis is the placement Z axis direction and the ref_direction is an approximate to the placement X axis direction. From this information, a right-handed coordinate system is computed:
Let
be the placement Z axis direction and
be the approximate placement X axis direction. Approximate here means that and are not required to be orthogonal. Then the exact placement X axis direction is given as
and the placement Y axis direction calculates to
.
For the first representation item, the following calculations would result:
, ref_direction: 
therefore
because
and
are already orthogonal in this example.

So the geometric function which leads from the coordinates of the global coordinate system to those of the first axis placement is represented by the rotation matrix
given by the three vectors
,
and
plus the translation vector
given by the axis2_placement_3d’s location attribute:
, 
In the same way, the matrix
and the vector
are computed from the second axis placement:
, 
Geometrically, the matrix
defines a 60° rotation around the global X axis and the matrix
gives a 45° rotation around the global Z axis.
To get the explicit transformation from the information gained so far, the matrices have to be combined. The idea is as follows: To move a point from a location within the first placement into a location within the second one, three steps have to be made:
- First, the point has to be multiplied with the inverted matrix
to undo the rotation, which occurs when going from the global coordinate system into the first placement system.
- Next, multiply it with the second matrix
to get it into the right position for the target placement.
- Finally, a translation vector is needed to put the point into its correct location within the second axis placement. Calculation of this vector can be seen below.
As
is a rotation matrix, the inverted matrix
, the transposed matrix. Steps 1 and 2 can be combined:

The translation vector needed is

This means moving any point
from a location within the first placement into the second one follows the calculation
Explicitly defined transformation
This information will now be used in a Part 21 file example, using an instance of the cartesian_transformation_operator_3d to perform a translation with rotation, where the columns of the matrix are the three axis attributes and the vector is the local_origin attribute. The structure of the file is shown in the following diagram:

The Instance Model: STEP exchange file format (ISO10303 Part 21 syntax)
/* translation vector v */
#1000=CARTESIAN_POINT('', 3.4835639, -0.8977775, 0.3660254);
/* rotation matrix C */
#1010=DIRECTION('', 0.7071067811865, 0.7071067811865, 0.0);
#1020=DIRECTION('', -0.3535533905933, 0,3535533905933, 0.8660254037844);
#1030=DIRECTION('', -0.6123724356958, 0.6123724356958, 0.5);
/* transformation */
#1040=CARTESIAN_TRANSFORMATION_OPERATOR_3D('', '', $, #1010, #1020, #1000, $, #1030);
#1050=REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION('', '', #800, #900, #1040);

