![]() |
Transformations |
<<< Lattice Geometry | Chapters | Assemblies And Instances >>> |
The Parasolid PK interface supports homogenous coordinate transformations. These allow translation, scale (equal and non-uniform), rotation, shear and reflection transformations to be specified. These transformations can then be combined to give more general transformations.
Transformations can be applied to individual geometrical entities or to whole bodies. Transformations can also be checked for validity, and classified by class.
Note: Throughout this chapter, transformations are assumed to be supplied in the form of a 4x4 matrix. For more details, see PK_TRANSF_sf_t. |
Many of the basic transformations are available directly via:
In addition to these functions, PK_TRANSF_create allows you to create any transformation directly. For example, a non-uniform scaling of 2 in X, 3 in Y and 4 in Z can be generated from the PK_TRANSF_create function with matrix:
( 2 0 0 0 )
( 0 3 0 0 )
( 0 0 4 0 )
( 0 0 0 1 )
as input. The documentation of the standard form, PK_TRANSF_sf_t, explains the mathematics underlying this matrix. Parasolid currently does not allow perspective terms in transformations used in modeling operations. This means that the first 3 elements of the 4th column of the matrix must be zero.
The upper left 3x3 sub-matrix of any 4x4 transformation matrix represents the component of the transformation that is a linear transformation. This is referred to as the linear transformation matrix. For more details, see PK_TRANSF_sf_t.
Transformations can be combined and manipulated using PK_TRANSF_transform_2.
Parasolid supports large transformations (i.e where the entity lies within the size box but can be positioned by a large transform outside the size box).This can be useful for example in factory design when deciding where to position objects (such as machinery) around the factory. Each component of the factory is “small” but the factory itself may extend to a few kilometers in size.
Large transformations cannot be applied to geometry or topology but they can be passed into certain Parasolid API that accept transformations as input. These include:
In order to maintain accuracy when working with large transformations, we recommend you use the specific transformation functions PK_TRANSF_create_equal_scale, PK_TRANSF_create_reflection and PK_TRANSF_create_rotation to create the necessary transformations and PK_TRANSF_transform_2 to combine them.
If you are interested in implementing large transformations in your application, please contact Parasolid Support for more information.
Transformations can be applied to geometry, bodies, assemblies, instances, vectors and faces.
You can use PK_GEOM_transform_2 to transform an array of geometric entities, either by modifying the original entities, or by modifying copies of them. It receives an array of geometries, a transformation and a set of options. It can return transformed copies of the supplied geometry, together with information about whether each copy is an exact transformation of the original or not.
PK_GEOM_transform_2 takes options that let you control the behaviour of the function as follows:
tolerance |
If a geometric entity cannot be transformed exactly, this is the tolerance to which the new geometry matches the original. Whether an exact result is possible depends on both the type of transformation and the class of the geometry. For example, for surfaces: |
modify |
Whether to create new geometric entities, or to modify the originals.
|
want_out_geoms |
Whether to return transformed geometry in an |
want_exact |
Whether to return information indicating whether each geometry has been transformed exactly, or to within the specified tolerance. If PK_LOGICAL_true, then PK_GEOM_transform_2 returns an |
PK_BODY_transform_2 takes a sheet or solid body, a transformation and a tolerance for geometry which may have to be approximated.
The body is transformed. Face surfaces and edge curves may have to be approximated in order to achieve the desired result. Intersection curves are recalculated between transformed face surfaces unless the intersection and face surfaces can be transformed exactly.
It can happen that edges and vertices become tolerant as a result of this operation. For example, a smooth edge between faces often transforms to a tolerant smooth edge. Some topology changes, such as the elimination of edges made too short by transformation, are supported.
As well as bodies and geometry, you can apply transformations to other entities using the following functions:
You can use PK_TRANSF_check to perform a simple validity check on a given transformation. This function returns limited information about any faults found in the transformation, if any.
PK_TRANSF_classify is a more comprehensive API that complements the basic validity checking of PK_TRANSF_check. PK_TRANSF_classify can tell you the class of a transformation and (optionally) provide details about how the transformation deviates from the orthonormal state for that class.
PK functions that receive transformations as arguments have their own requirements on the classification of transformation that they accept. Please refer to the relevant API for further information. Where a received transformation is rejected, you can use PK_TRANSF_classify to provide additional information to help you diagnose the cause.
PK_TRANSF_classify returns the following information:
matrix_type |
The class of the linear transformation matrix (this is the upper left 3x3 matrix of the supplied transformation: see Section 21.2). |
determinant |
|
unit_rows_deviations |
The signed deviations from 1.0 of the squared norms of the rows of the linear transformation matrix. |
orthog_rows_deviation |
The signed deviations from 0.0 of the dot products between the rows of the linear transformation matrix. |
translation |
|
perspective |
|
scale |
The reciprocal of the global scale factor corresponding to the bottom right corner value of the transformation. The transformation is shrinking if this value is < 1.0 and expanding if this value is > 1.0, |
The returned
matrix_type
is one of the following:
The linear transformation is an orthonormal matrix that includes a reflection (i.e. the determinant is -1). |
|
The linear transformation is valid (according to PK_TRANSF_check), but contains local scaling information. |
|
By default, PK_TRANSF_classify does not return either
unit_rows_deviations
or
orthog_rows_deviations
. These values are only returned if the
diagnostics
option is PK_TRANSF_diagnostics_all_c.
See PK_TRANSF_classify for more information.
<<< Lattice Geometry | Chapters | Assemblies And Instances >>> |