PDM-UG: Conversion from Implicit to Explicit Transformation Information

From WikiSTEP

Jump to: navigation, search

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).

Image:Diagram_18_Implicit_Transformation_Instance_Diagram.png
Diagram 18: Implicit Transformation Instance Diagram

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);

Example 14: file segment for implicitly defined transformation

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 Image:zet.png be the placement Z axis direction and Image:a_in_formula.png 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 Image:x=a-azz.png and the placement Y axis direction calculates to Image:y=zxy.png . For the first representation item, the following calculations would result:

axis: Image:z=matrix.png, ref_direction: Image:a=matrix.png

therefore Image:x==a.png because Image:zet.png and Image:a_in_formula.png are already orthogonal in this example.

Next step is calculating using the vector product: Image:y=zxx=matrix.png

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 Image:a_caps_in_formula.png given by the three vectors Image:x_in_formula.png, Image:y_in_formula.png and Image:zet.png plus the translation vector Image:t_vector.png given by the axis2_placement_3d’s location attribute:

Image:a_caps=matrix.png, Image:t=matrix.png

In the same way, the matrix Image:b_caps.png and the vector Image:u_vector.png are computed from the second axis placement:

Image:b_caps=matrix.png, Image:u=matrix.png

Geometrically, the matrix Image:a_caps_in_formula.png defines a 60° rotation around the global X axis and the matrix Image:b_caps.png 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:

  1. First, the point has to be multiplied with the inverted matrix Image:A-1.pngto undo the rotation, which occurs when going from the global coordinate system into the first placement system.
  2. Next, multiply it with the second matrix Image:b_caps.png to get it into the right position for the target placement.
  3. 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 Image:a_caps_in_formula.png is a rotation matrix, the inverted matrix Image:A-1=AT.png, the transposed matrix. Steps 1 and 2 can be combined:

Image:C=BA-1=matrix.png

The translation vector needed is

Image:v=u-Ct=matrix.png

This means moving any point Image:p_caps.png from a location within the first placement into the second one follows the calculation

Image:Pt=CPplusv.png

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:

Image:Diagram_19_Explicit_Transformation_Instance_Diagram.png
Diagram 19: Explicit Transformation Instance 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);
Example 15: file segment for explicit transformation
Personal tools