Skip to content

Transform

Public Struct

Represents the values in a 4x4 transform matrix.

This is parallel to C++ ON_Xform.

Namespace: Rhino.Geometry

Assembly: RhinoCommon (in RhinoCommon.dll)

Syntax

[SerializableAttribute]
public struct Transform : IComparable<Transform>,
IEquatable<Transform>, ICloneable

The Transform type exposes the following members.

Constructors

Name

Description


Public Method

Initializes a new transform matrix with a specified value along the diagonal.


Public Method

Initializes a new transform matrix with a specified value.


Properties

Name

Description


Public Property

The determinant of this 4x4 matrix.


Public Property
Static Member

Gets a new identity transform matrix. An identity matrix defines no transformation.


Public Property

Tests for an affine transformation. A transformation is affine if it is valid and its last row is [0, 0, 0, 1]. An affine transformation can be broken into a linear transformation and a translation.


Public Property

Return true if this Transform is the identity transform


Public Property

Tests for a linear transformation. A transformation is affine if it is valid and its last row is [0, 0, 0, 1]. If in addition its last column is ( 0, 0, 0, 1)^T then it is linear. An affine transformation can be broken into a linear transformation and a translation.


Public Property

Returns true if this is a proper rotation.


Public Property

Gets a value indicating whether or not this Transform is a valid matrix. A valid transform matrix is not allowed to have any invalid numbers.


Public Property

True if matrix is Zero4x4, ZeroTransformation, or some other type of zero. The value xform[3][3] can be anything.


Public Property

True if all values are 0


Public Property

True if all values are 0, except for M33 which is 1.


Public Property

Gets or sets the matrix value at the given row and column indices.


Public Property

Gets or sets this[0,0].


Public Property

Gets or sets this[0,1].


Public Property

Gets or sets this[0,2].


Public Property

Gets or sets this[0,3].


Public Property

Gets or sets this[1,0].


Public Property

Gets or sets this[1,1].


Public Property

Gets or sets this[1,2].


Public Property

Gets or sets this[1,3].


Public Property

Gets or sets this[2,0].


Public Property

Gets or sets this[2,1].


Public Property

Gets or sets this[2,2].


Public Property

Gets or sets this[2,3].


Public Property

Gets or sets this[3,0].


Public Property

Gets or sets this[3,1].


Public Property

Gets or sets this[3,2].


Public Property

Gets or sets this[3,3].


Public Property

Gets a value indicating whether or not the Transform is rigid. A rigid transformation can be broken into a proper rotation and a translation, while an isometry transformation could also include a reflection.


Public Property

Gets a value indicating whether or not the Transform maintains similarity. The easiest way to think of Similarity is that any circle, when transformed, remains a circle. Whereas a non-similarity Transform deforms circles into ellipses.


Public Property
Static Member

Gets an XForm filled with RhinoMath.UnsetValue.


Public Property
Static Member

ZeroTransformation diagonal = (0,0,0,1)


Methods

Name

Description


Public Method

Replaces the last row with (0 0 0 1), discarding any perspective part of this transform


Public Method
Static Member

Computes a change of basis transformation. A basis change is essentially a remapping of geometry from one coordinate system to another.


Public Method
Static Member

Computes a change of basis transformation. A basis change is essentially a remapping of geometry from one coordinate system to another.


Public Method

Returns a deep copy of the transform. For languages that treat structures as value types, this can be accomplished by a simple assignment.


Public Method

Compares this transform with another transform.

M33 has highest value, then M32, etc..


Public Method
DecomposeAffine(Transform., Vector3d.)

Decomposes an affine transformation. A transformation is affine if it is valid and its last row is [0, 0, 0, 1]. An affine transformation can be broken into a linear transformation and a translation. Note, a perspective transformation is not affine.


Public Method
DecomposeAffine(Vector3d., Transform.)

Decomposes an affine transformation. A transformation is affine if it is valid and its last row is [0, 0, 0, 1]. An affine transformation can be broken into a linear transformation and a translation. Note, a perspective transformation is not affine.


Public Method

An affine transformation can be decomposed into a Symmetric, Rotation and Translation. Then the Symmetric component may be further decomposed as non-uniform scale in an orthonormal coordinate system.


Public Method
DecomposeRigid

Decomposes a rigid transformation. The transformation must be affine.


Public Method
DecomposeSimilarity

Decomposes a similarity transformation. The transformation must be affine. A similarity transformation can be broken into a sequence of a dilation, translation, rotation, and a reflection.


Public Method
DecomposeSymmetric

A Symmetric linear transformation can be decomposed A = Q * Diag * Q ^ T, where Diag is a diagonal transformation. Diag[i][i] is an eigenvalue of A and the i-th column of Q is a corresponding unit length eigenvector. Note, this transformation must be Linear and Symmetric.


Public Method

Decomposition of a uvw transform into components


Public Method
Static Member

Constructs a new transformation with diagonal (d0,d1,d2,1.0).


Public Method
Static Member

Constructs a new transformation with diagonal (d0,d1,d2,1.0).


Public Method

Determines if another object is a transform and its value equals this transform value.

(Overrides ValueType.Equals(Object).)


Public Method

Determines if another transform equals this transform value.


Public Method
GetEulerZYZ

Find the Euler angles for a rotation transformation.


Public Method

Gets a non-unique hashing code for this transform.

(Overrides ValueType.GetHashCode..)


Public Method

If this transform is a proper rotation, then find the equivalent quaternion.


Public Method

GetType

Gets the Type of the current instance.

(Inherited from Object.)


Public Method

Find the Tait-Byran angles (also loosely called Euler angles) for a rotation transformation.


Public Method

Gets a value indicating whether or not the Transform is rigid. A rigid transformation can be broken into a proper rotation and a translation, while an isometry transformation could also include a reflection.


Public Method

Gets a value indicating whether or not the Transform maintains similarity. A similarity transformation can be broken into a sequence of a dilation, translation, rotation, and a reflection.


Public Method

True if all values are 0 within tolerance, except for M33 which is exactly 1.


Public Method

Affinitize() and replaces the last column with (0 0 0 1)^T, discarding any translation part of this transform.


Public Method
Static Member

Constructs a new Mirror transformation.


Public Method
Static Member

Create mirror transformation matrix The mirror transform maps a point Q to Q - (2*(Q-P)oN)*N, where P = pointOnMirrorPlane and N = normalToMirrorPlane.


Public Method
Static Member

Multiplies (combines) two transformations.

This is the same as the * operator between two transformations.


Public Method

Force the linear part of this transformation to be a rotation (or a rotation with reflection). Use DecomposeRigid(T,R) to find the nearest rotation.


Public Method
Static Member

Constructs a projection transformation.


Public Method
Static Member

Create a rotation transformation that orients plane0 to plane1. If you want to orient objects from one plane to another, use this form of transformation.


Public Method
Static Member

Construct a projection onto a plane along a specific direction.


Public Method
Static Member

Constructs a new rotation transformation with specified angle and rotation center. The axis of rotation is

.


Public Method
Static Member

Constructs a new rotation transformation with specified angle, rotation center and rotation axis.


Public Method
Static Member

Constructs a new rotation transformation with start and end directions and rotation center.


Public Method
Static Member

Constructs a new rotation transformation with specified angle, rotation center and rotation axis.


Public Method
Static Member

Constructs a transformation that maps X0 to X1, Y0 to Y1, Z0 to Z1. The frames should be right hand orthonormal frames (unit vectors with Z = X x Y). The resulting rotation fixes the origin (0,0,0), maps initial X to final X, initial Y to final Y, and initial Z to final Z.


Public Method
Static Member
RotationZYX

Create rotation transformation From Tait-Byran angles (also loosely known as Euler angles).


Public Method
Static Member
RotationZYZ

Create rotation transformation From Euler angles.


Public Method
Static Member

Constructs a new uniform scaling transformation with a specified scaling anchor point.


Public Method
Static Member

Constructs a new non-uniform scaling transformation with a specified scaling anchor point.


Public Method
Static Member

Constructs a Shear transformation.


Public Method
Static Member

Construct a UVW Transform from components.


Public Method

Return the matrix as a linear array of 16 double values.


Public Method

Return the matrix as a linear array of 16 float values.


Public Method

Returns a string representation of this transform.

(Overrides ValueType.ToString..)


Public Method

Computes a new bounding box that is the smallest axis aligned bounding box that contains the transformed result of its 8 original corner points.


Public Method

Given a list, an array or any enumerable set of points, computes a new array of transformed points.


Public Method
Static Member
Code Example

Constructs a new translation (move) transformation.


Public Method
Static Member
Code Example

Constructs a new translation (move) transformation. Right column is (dx, dy, dz, 1.0).


Public Method

Flip row/column values


Public Method

Attempts to get the inverse transform of this transform.


Operators

Name

Description


Public Operator
Static Member
Equality

Determines if two transformations are equal in value.


Public Operator
Static Member
Inequality

Determines if two transformations are different in value.


Public Operator
Static Member
Multiply(Transform, Point3d)

Multiplies a transformation by a point and gets a new point.


Public Operator
Static Member
Multiply(Transform, Transform)

Multiplies (combines) two transformations.


Public Operator
Static Member
Multiply(Transform, Vector3d)

Multiplies a transformation by a vector and gets a new vector.