Struct Transform3D
Represents a 3D transformation.
Inherited Members
Namespace: TopSolid.Kernel.Automating
Assembly: cs.temp.dll.dll
Syntax
[AvailableSinceVersion(7, 6, 0, 0)]
public struct Transform3D
Remarks
The transformation is defined by a 4x4 matrix that operates as multiplier on column vectors containing homogeneous coordinates:
[ R00 R01 R02 Tx ]
[ R10 R11 R12 Ty ]
[ R20 R21 R22 Tz ]
[ Px Py Pz Si ]
That transforms (X, Y, Z, H) into (X', Y', Z', H') as follows:
X' = R00 * X + R01 * Y + R02 * Z + Tx * H
Y' = R10 * X + R11 * Y + R12 * Z + Ty * H
Z' = R20 * X + R21 * Y + R22 * Z + Tz * H
H' = Px * X + Py * Y + Pz * Z + Si * H
R
is a non singular transformation matrix, that contains the rotation, reflection,
non-uniform scaling and shearing components.
T
is a translation vector.
P
represents the perspective terms in viewing transformations. It must be zero in
transformations used for modeling.
Si
is the inverse of the global scale factor, it has to be greater than zero.
In the case of conventional coordinates, H is equal to one, and the coordinates of the transformed point are (X'/H', Y'/H', Z'/H').
For instance here is the transformation matrix corresponding to the rotation of angle "a" around the Z axis:
[ cos(a) -sin(a) 0 0 ]
[ sin(a) cos(a) 0 0 ]
[ 0 0 1 0 ]
[ 0 0 0 1 ]
This structure is available since v7.6.
Constructors
Transform3D(Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double)
Initializes a new instance of the Transform3D structure.
Declaration
public Transform3D(double inR00, double inR01, double inR02, double inTx, double inR10, double inR11, double inR12, double inTy, double inR20, double inR21, double inR22, double inTz, double inPx, double inPy, double inPz, double inSi)
Parameters
Type | Name | Description |
---|---|---|
Double | inR00 | |
Double | inR01 | |
Double | inR02 | |
Double | inTx | |
Double | inR10 | |
Double | inR11 | |
Double | inR12 | |
Double | inTy | |
Double | inR20 | |
Double | inR21 | |
Double | inR22 | |
Double | inTz | |
Double | inPx | |
Double | inPy | |
Double | inPz | |
Double | inSi |
Fields
Identity
Indentity transformation.
Declaration
public static readonly Transform3D Identity
Field Value
Type | Description |
---|---|
Transform3D |
Px
Perspective factor along X.
Declaration
public double Px
Field Value
Type | Description |
---|---|
Double |
Py
Perspective factor along Y.
Declaration
public double Py
Field Value
Type | Description |
---|---|
Double |
Pz
Perspective factor along Z.
Declaration
public double Pz
Field Value
Type | Description |
---|---|
Double |
R00
Rotation[0,0].
Declaration
public double R00
Field Value
Type | Description |
---|---|
Double |
R01
Rotation[0,1].
Declaration
public double R01
Field Value
Type | Description |
---|---|
Double |
R02
Rotation[0,2].
Declaration
public double R02
Field Value
Type | Description |
---|---|
Double |
R10
Rotation[1,0].
Declaration
public double R10
Field Value
Type | Description |
---|---|
Double |
R11
Rotation[1,1].
Declaration
public double R11
Field Value
Type | Description |
---|---|
Double |
R12
Rotation[1,2].
Declaration
public double R12
Field Value
Type | Description |
---|---|
Double |
R20
Rotation[2,0].
Declaration
public double R20
Field Value
Type | Description |
---|---|
Double |
R21
Rotation[2,1].
Declaration
public double R21
Field Value
Type | Description |
---|---|
Double |
R22
Rotation[2,2].
Declaration
public double R22
Field Value
Type | Description |
---|---|
Double |
Si
Inverse of the global scale factor.
Declaration
public double Si
Field Value
Type | Description |
---|---|
Double |
Tx
Translation along X.
Declaration
public double Tx
Field Value
Type | Description |
---|---|
Double |
Ty
Translation along Y.
Declaration
public double Ty
Field Value
Type | Description |
---|---|
Double |
Tz
Translation along Z.
Declaration
public double Tz
Field Value
Type | Description |
---|---|
Double |
Methods
SetRotation(Axis3D, Double)
Sets the transformation as the rotation about a specified axis with a specified angle.
Declaration
public void SetRotation(Axis3D inAxis, double inAngle)
Parameters
Type | Name | Description |
---|---|---|
Axis3D | inAxis | Rotation axis. |
Double | inAngle | Rotation angle, in radians. |
SetTranslation(Vector3D)
Sets the transformation as the translation along a specified vector.
Declaration
public void SetTranslation(Vector3D inVector)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | inVector | Translation vector. |