TransformExtensionMethods

public static class TransformExtensionMethods

Methods

IsCorrect

#Example
public static bool IsCorrect(this Transform transform, Point3d a, Point3d b, double tolerance)
Test whether this transform genuinely converts one point into another.
transform (Transform)Transform to test.
a (Point3d)First point.
b (Point3d)Suggested location of a once the transformation is applied.
tolerance (double)Acceptable coincidence tolerance between transformed points.
True if all the 'a' points transform onto all the 'b' points within tolerance.

IsQuaternion

#Example
public static bool IsQuaternion(this Transform transform)
Test whether a specific transform is actually a quaternion in disguise.
transform (Transform)

IsRotation

#Example
public static bool IsRotation(this Transform transform, out Line axis, out Angle angle)
Gets whether this transformation matrix represents a rotation about a custom axis.
transform (Transform)Transform to examine.
axis (out Line)Rotation axis.
angle (out Angle)Rotation angle.
True if the transform represents a rotation.

IsTranslation

#Example
public static bool IsTranslation(this Transform transform, out Vector3d translation)
Gets whether this transformation matrix represents only a translation.
transform (Transform)Transform to examine.
translation (out Vector3d)Translation vector.
True if the transform is only a translation.

ToQuaternion

#Example
public static Quaternion ToQuaternion(this Transform transform)
Convert a Transform into a Quaternion. This is only possible if the transform has been created by the ToTransform(Quaternion) method.
transform (Transform)Transform to convert.
Quaternion.

ToTransform

#Example
public static Transform ToTransform(this Quaternion quaternion)
Convert a Quaternion into a Transform which contains the quaternion coefficients. Note that the resulting transform is not valid as such, it merely functions as a way to store quaternion data without the need of the quaternion type.
quaternion (Quaternion)

ToTransform

#Example
public static Transform ToTransform(this Transform transform)
Returns either the transform as is, or, if the transform represents a quaternion, the transform which mimics that quaternion.
transform (Transform)