SketchUp C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Fields | Related Functions
SUTransformation Struct Reference

Represents a 3D (4x4) geometric transformation matrix. More...

#include <SketchUpAPI/geometry.h>

Data Fields

double values [16]
 Matrix values in column-major order.
 

Related Functions

(Note that these are not member functions.)

enum SUResult SUTransformationSetFromPointAndNormal (struct SUTransformation *transform, const struct SUPoint3D *point, const struct SUVector3D *normal)
 Sets the transformation based on the provided point and z-axis vector. The resulting transformation transforms points/vectors to a new coordinate system where the provided point is the new origin and the vector is the new z-axis. The other two axes in the transformed space are computed using the "Arbitrary axis algorithm". More...
 
enum SUResult SUTransformationSetFromPointAndAxes (struct SUTransformation *transform, const struct SUPoint3D *point, const struct SUVector3D *x_axis, const struct SUVector3D *y_axis, const struct SUVector3D *z_axis)
 Sets the transformation based on the provided origin and axes. More...
 
enum SUResult SUTransformationTranslation (struct SUTransformation *transform, const struct SUVector3D *vector)
 Creates a translation transformation using the given vector. More...
 
enum SUResult SUTransformationScale (struct SUTransformation *transform, double scale)
 Creates a scale transformation using the given scale value. More...
 
enum SUResult SUTransformationNonUniformScale (struct SUTransformation *transform, double x_scale, double y_scale, double z_scale)
 Creates a scale transformation using the given scale values. More...
 
enum SUResult SUTransformationScaleAboutPoint (struct SUTransformation *transform, const struct SUPoint3D *point, double scale)
 Creates a scale transformation using the given scale value and origin. More...
 
enum SUResult SUTransformationNonUniformScaleAboutPoint (struct SUTransformation *transform, const struct SUPoint3D *point, double x_scale, double y_scale, double z_scale)
 Creates a scale transformation using the given scale values and origin. More...
 
enum SUResult SUTransformationRotation (struct SUTransformation *transform, const struct SUPoint3D *point, const struct SUVector3D *vector, double angle)
 Creates a transformation given an origin, vector of rotation, and angle. More...
 
enum SUResult SUTransformationInterpolate (struct SUTransformation *transform, const struct SUTransformation *t1, const struct SUTransformation *t2, double weight)
 Performs an interpolation between two transformations. The weight determines the amount of interpolation. A weight of 0.0 would return a transformation of t1, while a weight of 1.0 would return a transformation of t2. More...
 
enum SUResult SUTransformationIsIdentity (const struct SUTransformation *transform, bool *is_identity)
 Gets whether the transformation is an identity transformation. More...
 
enum SUResult SUTransformationGetInverse (const struct SUTransformation *transform, struct SUTransformation *inverse)
 Gets the inverse transformation of the given transformation object. More...
 
enum SUResult SUTransformationGetOrigin (const struct SUTransformation *transform, struct SUPoint3D *origin)
 Gets the origin point of the given transformation object. More...
 
enum SUResult SUTransformationGetXAxis (const struct SUTransformation *transform, struct SUVector3D *x_axis)
 Gets the x axis vector of the given transformation object. More...
 
enum SUResult SUTransformationGetYAxis (const struct SUTransformation *transform, struct SUVector3D *y_axis)
 Gets the y axis vector of the given transformation object. More...
 
enum SUResult SUTransformationGetZAxis (const struct SUTransformation *transform, struct SUVector3D *z_axis)
 Gets the z_axis vector of the given transformation object. More...
 
enum SUResult SUTransformationGetZRotation (const struct SUTransformation *transform, double *z_rotation)
 Gets the rotation about the z axis from the given transformation object. More...
 
enum SUResult SUTransformationMultiply (const struct SUTransformation *transform1, const struct SUTransformation *transform2, struct SUTransformation *out_transform)
 Multiplies a transformation by another transformation. More...
 
enum SUResult SUTransformationIsMirrored (const struct SUTransformation *transform, bool *is_mirrored)
 Returns true if transformation has been mirrored. More...
 

Detailed Description

Represents a 3D (4x4) geometric transformation matrix.

Matrix values are in column-major order. The transformation is stored as:

- -
| R T |
M = | 0 w |
- -

where:

Friends And Related Function Documentation

enum SUResult SUTransformationGetInverse ( const struct SUTransformation transform,
struct SUTransformation inverse 
)
related

Gets the inverse transformation of the given transformation object.

Since
SketchUp 2018, API 6.0
Parameters
[in]transformThe transformation object.
[out]inverseThe inverse transformation object.
Returns
enum SUResult SUTransformationGetOrigin ( const struct SUTransformation transform,
struct SUPoint3D origin 
)
related

Gets the origin point of the given transformation object.

Since
SketchUp 2018, API 6.0
Parameters
[in]transformThe transformation object.
[out]originThe origin point to be retrieved.
Returns
enum SUResult SUTransformationGetXAxis ( const struct SUTransformation transform,
struct SUVector3D x_axis 
)
related

Gets the x axis vector of the given transformation object.

Since
SketchUp 2018, API 6.0
Parameters
[in]transformThe transformation object.
[out]x_axisThe x axis vector to be retrieved.
Returns
enum SUResult SUTransformationGetYAxis ( const struct SUTransformation transform,
struct SUVector3D y_axis 
)
related

Gets the y axis vector of the given transformation object.

Since
SketchUp 2018, API 6.0
Parameters
[in]transformThe transformation object.
[out]y_axisThe y axis vector to be retrieved.
Returns
enum SUResult SUTransformationGetZAxis ( const struct SUTransformation transform,
struct SUVector3D z_axis 
)
related

Gets the z_axis vector of the given transformation object.

Since
SketchUp 2018, API 6.0
Parameters
[in]transformThe transformation object.
[out]z_axisThe z_axis vector to be retrieved.
Returns
enum SUResult SUTransformationGetZRotation ( const struct SUTransformation transform,
double *  z_rotation 
)
related

Gets the rotation about the z axis from the given transformation object.

Since
SketchUp 2018, API 6.0
Parameters
[in]transformThe transformation object.
[out]z_rotationThe rotation to be retrieved.
Returns
enum SUResult SUTransformationInterpolate ( struct SUTransformation transform,
const struct SUTransformation t1,
const struct SUTransformation t2,
double  weight 
)
related

Performs an interpolation between two transformations. The weight determines the amount of interpolation. A weight of 0.0 would return a transformation of t1, while a weight of 1.0 would return a transformation of t2.

Since
SketchUp 2018, API 6.0
Parameters
[out]transformThe result of the interpolation.
[in]t1The first transformation object.
[in]t2The second transformation object.
[in]weightThe weight determines the amount of interpolation from t1 to t2.
Returns
enum SUResult SUTransformationIsIdentity ( const struct SUTransformation transform,
bool *  is_identity 
)
related

Gets whether the transformation is an identity transformation.

Since
SketchUp 2018, API 6.0
Parameters
[in]transformThe transformation object.
[out]is_identityWhether the transformation is identity.
Returns
enum SUResult SUTransformationIsMirrored ( const struct SUTransformation transform,
bool *  is_mirrored 
)
related

Returns true if transformation has been mirrored.

Since
SketchUp 2019, API 7.0
Parameters
[in]transformThe transform object.
[out]is_mirroredIndicates if mirrored.
Returns
enum SUResult SUTransformationMultiply ( const struct SUTransformation transform1,
const struct SUTransformation transform2,
struct SUTransformation out_transform 
)
related

Multiplies a transformation by another transformation.

Since
SketchUp 2018, API 6.0
Parameters
[in]transform1The transformation object to be multiplied.
[in]transform2The transformation object to multiply by.
[out]out_transformThe result of the matrix multiplication [transform1 * transform2].
Returns
enum SUResult SUTransformationNonUniformScale ( struct SUTransformation transform,
double  x_scale,
double  y_scale,
double  z_scale 
)
related

Creates a scale transformation using the given scale values.

Since
SketchUp 2018, API 6.0
Parameters
[out]transformThe transformation to be set.
[in]x_scaleThe x-axis scale value for the transformation.
[in]y_scaleThe y-axis scale value for the transformation.
[in]z_scaleThe z-axis scale value for the transformation.
Returns
enum SUResult SUTransformationNonUniformScaleAboutPoint ( struct SUTransformation transform,
const struct SUPoint3D point,
double  x_scale,
double  y_scale,
double  z_scale 
)
related

Creates a scale transformation using the given scale values and origin.

Since
SketchUp 2018, API 6.0
Parameters
[out]transformThe transformation to be set.
[in]pointThe point specifying the translation component of the transformation.
[in]x_scaleThe x-axis scale value for the transformation.
[in]y_scaleThe y-axis scale value for the transformation.
[in]z_scaleThe z-axis scale value for the transformation.
Returns
enum SUResult SUTransformationRotation ( struct SUTransformation transform,
const struct SUPoint3D point,
const struct SUVector3D vector,
double  angle 
)
related

Creates a transformation given an origin, vector of rotation, and angle.

Since
SketchUp 2018, API 6.0
Parameters
[out]transformThe calculated transformation.
[in]pointThe point specifying the translation component of the transformation.
[in]vectorThe vector about which rotation will occur.
[in]angleThe rotation in radians for the transformation.
Returns
enum SUResult SUTransformationScale ( struct SUTransformation transform,
double  scale 
)
related

Creates a scale transformation using the given scale value.

Since
SketchUp 2018, API 6.0
Parameters
[out]transformThe transformation to be set.
[in]scaleThe scale value for the transformation.
Returns
enum SUResult SUTransformationScaleAboutPoint ( struct SUTransformation transform,
const struct SUPoint3D point,
double  scale 
)
related

Creates a scale transformation using the given scale value and origin.

Since
SketchUp 2018, API 6.0
Parameters
[out]transformThe transformation to be set.
[in]pointThe point specifying the translation component of the transformation.
[in]scaleThe scale value for the transformation.
Returns
enum SUResult SUTransformationSetFromPointAndAxes ( struct SUTransformation transform,
const struct SUPoint3D point,
const struct SUVector3D x_axis,
const struct SUVector3D y_axis,
const struct SUVector3D z_axis 
)
related

Sets the transformation based on the provided origin and axes.

Since
SketchUp 2018, API 6.0
Parameters
[out]transformThe transformation to be set.
[in]pointThe point specifying the translation component of the transformation.
[in]x_axisThe 3D vector specifying the x-axis for the transformation. This is treated as a unit vector, so any scaling will be ignored.
[in]y_axisThe 3D vector specifying the y-axis for the transformation. This is treated as a unit vector, so any scaling will be ignored.
[in]z_axisThe 3D vector specifying the z-axis for the transformation. This is treated as a unit vector, so any scaling will be ignored.
Returns
enum SUResult SUTransformationSetFromPointAndNormal ( struct SUTransformation transform,
const struct SUPoint3D point,
const struct SUVector3D normal 
)
related

Sets the transformation based on the provided point and z-axis vector. The resulting transformation transforms points/vectors to a new coordinate system where the provided point is the new origin and the vector is the new z-axis. The other two axes in the transformed space are computed using the "Arbitrary axis algorithm".

Since
SketchUp 2017, API 5.0
Parameters
[out]transformThe transformation to be set.
[in]pointThe point specifying the translation component of the transformation.
[in]normalThe 3D vector specifying the rotation component of the transformation. This is treated as a unit vector, so any scaling will be ignored.
Returns
enum SUResult SUTransformationTranslation ( struct SUTransformation transform,
const struct SUVector3D vector 
)
related

Creates a translation transformation using the given vector.

Since
SketchUp 2018, API 6.0
Parameters
[out]transformThe transformation to be set.
[in]vectorThe 3D vector specifying the translation for the transformation.
Returns

The documentation for this struct was generated from the following files: