Transform

class rhino3dm.Transform
Transform(diagonalValue)

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

Parameters:diagonalValue (float) – Value to assign to all diagonal cells except M33 which is set to 1.0.
Transform()

Transform constructor

IsIdentity

bool: Return True if this Transform is the identity transform

IsValid

bool: 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.

IsZero

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

IsZero4x4

bool: True if all values are 0

IsZeroTransformation

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

static Identity()

[todo] add documentation

static ZeroTransformation()

[todo] add documentation

static Unset()

[todo] add documentation

static Translation(motion)

Constructs a new translation (move) transformation.

Parameters:motion (rhino3dm.Vector3d) – Translation (motion) vector.
Returns:A transform matrix which moves geometry along the motion vector.
Return type:Transform
static Translation(x, y, z)

Constructs a new translation (move) transformation.

Returns:A transform matrix which moves geometry along the motion vector.
Return type:Transform
static Scale(anchor, scaleFactor)

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

Parameters:
  • anchor (rhino3dm.Point3d) – Defines the anchor point of the scaling operation.
  • scaleFactor (float) – Scaling factor in all directions.
Returns:

A transform matrix which scales geometry uniformly around the anchor point.

Return type:

Transform

static Scale(plane, xScaleFactor, yScaleFactor, zScaleFactor)

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

Returns:A transform matrix which scales geometry uniformly around the anchor point.
Return type:Transform
static Rotation(angleRadians, rotationAxis, rotationCenter)

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

Parameters:
  • sinAngle (float) – Sin of the rotation angle.
  • cosAngle (float) – Cos of the rotation angle.
  • rotationAxis (rhino3dm.Vector3d) – Axis direction of rotation.
  • rotationCenter (rhino3dm.Point3d) – Center point of rotation.
Returns:

A transformation matrix which rotates geometry around an anchor point.

Return type:

Transform

static Mirror(pointOnMirrorPlane, normalToMirrorPlane)

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

Parameters:
Returns:

A transformation matrix which mirrors geometry in a specified plane.

Return type:

Transform

static Mirror(mirrorPlane)

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

Parameters:
Returns:

A transformation matrix which mirrors geometry in a specified plane.

Return type:

Transform

Determinant()

[todo] add documentation

TryGetInverse()

Attempts to get the inverse transform of this transform.

Returns:tuple (bool, Transform)
  • True on success. If False is returned and this Transform is Invalid, inserveTransform will be set to this Transform. If False is returned and this Transform is Valid, inverseTransform will be set to a pseudo inverse.
  • The inverse transform. This out reference will be assigned during this call.
Return type:(bool, Transform)
TransformBoundingBox(bbox)

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

Returns:A new bounding box.
Return type:rhino3dm.BoundingBox
Transpose()

Flip row/column values

Return type:Transform
ToFloatArray()

Return the matrix as a linear array of 16 float values

Return type:float[]