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

Represents a 2D (2x3) affine transformation matrix. The matrix is stored in column-major format: More...

#include <geometry.h>

Data Fields

double m11
 the m11 component More...
 
double m12
 the m12 component More...
 
double m21
 the m21 component More...
 
double m22
 the m22 component More...
 
double tx
 the tx component More...
 
double ty
 the ty component More...
 

Related Functions

(Note that these are not member functions.)

SU_RESULT SUTransformation2DTranslation (struct SUTransformation2D *transform, const struct SUVector2D *vector)
 Creates a translation transformation using the given vector. More...
 
SU_RESULT SUTransformation2DScale (struct SUTransformation2D *transform, double scale)
 Creates a scale transformation using the given scale value. More...
 
SU_RESULT SUTransformation2DNonUniformScale (struct SUTransformation2D *transform, double x_scale, double y_scale)
 Creates a scale transformation using the given scale values. More...
 
SU_RESULT SUTransformation2DScaleAboutPoint (struct SUTransformation2D *transform, const struct SUPoint2D *point, double scale)
 Creates a scale transformation using the given scale value and origin. More...
 
SU_RESULT SUTransformation2DNonUniformScaleAboutPoint (struct SUTransformation2D *transform, const struct SUPoint2D *point, double x_scale, double y_scale)
 Creates a scale transformation using the given scale values and origin. More...
 
SU_RESULT SUTransformation2DRotation (struct SUTransformation2D *transform, const struct SUPoint2D *point, double angle)
 Creates a transformation given a point and angle. More...
 
SU_RESULT SUTransformation2DIsIdentity (const struct SUTransformation2D *transform, bool *is_identity)
 Gets whether the transformation is an identity transformation. More...
 
SU_RESULT SUTransformation2DGetInverse (const struct SUTransformation2D *transform, struct SUTransformation2D *inverse)
 Gets the inverse transformation of the given transformation object. More...
 
SU_RESULT SUTransformation2DMultiply (const struct SUTransformation2D *transform1, const struct SUTransformation2D *transform2, struct SUTransformation2D *out_transform)
 Multiplies a transformation by another transformation. More...
 

Detailed Description

Represents a 2D (2x3) affine transformation matrix. The matrix is stored in column-major format:

 m11 m21 tx
 m12 m22 ty

Friends And Related Function Documentation

SU_RESULT SUTransformation2DGetInverse ( const struct SUTransformation2D transform,
struct SUTransformation2D inverse 
)
related

Gets the inverse transformation of the given transformation object.

Since
SketchUp 2019, API 7.0
Parameters
[in]transformThe transformation object.
[out]inverseThe inverse transformation object.
Returns
SU_RESULT SUTransformation2DIsIdentity ( const struct SUTransformation2D transform,
bool *  is_identity 
)
related

Gets whether the transformation is an identity transformation.

Since
SketchUp 2019, API 7.0
Parameters
[in]transformThe transformation object.
[out]is_identityWhether the transformation is identity.
Returns
SU_RESULT SUTransformation2DMultiply ( const struct SUTransformation2D transform1,
const struct SUTransformation2D transform2,
struct SUTransformation2D out_transform 
)
related

Multiplies a transformation by another transformation.

Since
SketchUp 2019, API 7.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
SU_RESULT SUTransformation2DNonUniformScale ( struct SUTransformation2D transform,
double  x_scale,
double  y_scale 
)
related

Creates a scale transformation using the given scale values.

Since
SketchUp 2019, API 7.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.
Returns
SU_RESULT SUTransformation2DNonUniformScaleAboutPoint ( struct SUTransformation2D transform,
const struct SUPoint2D point,
double  x_scale,
double  y_scale 
)
related

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

Since
SketchUp 2019, API 7.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.
Returns
SU_RESULT SUTransformation2DRotation ( struct SUTransformation2D transform,
const struct SUPoint2D point,
double  angle 
)
related

Creates a transformation given a point and angle.

Since
SketchUp 2019, API 7.0
Parameters
[out]transformThe calculated transformation.
[in]pointThe point specifying the translation component of the transformation.
[in]angleThe rotation in radians for the transformation.
Returns
SU_RESULT SUTransformation2DScale ( struct SUTransformation2D transform,
double  scale 
)
related

Creates a scale transformation using the given scale value.

Since
SketchUp 2019, API 7.0
Parameters
[out]transformThe transformation to be set.
[in]scaleThe scale value for the transformation.
Returns
SU_RESULT SUTransformation2DScaleAboutPoint ( struct SUTransformation2D transform,
const struct SUPoint2D point,
double  scale 
)
related

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

Since
SketchUp 2019, API 7.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
SU_RESULT SUTransformation2DTranslation ( struct SUTransformation2D transform,
const struct SUVector2D vector 
)
related

Creates a translation transformation using the given vector.

Since
SketchUp 2019, API 7.0
Parameters
[out]transformThe transformation to be set.
[in]vectorThe 2D vector specifying the translation for the transformation.
Returns

Field Documentation

double SUTransformation2D::m11

the m11 component

double SUTransformation2D::m12

the m12 component

double SUTransformation2D::m21

the m21 component

double SUTransformation2D::m22

the m22 component

double SUTransformation2D::tx

the tx component

double SUTransformation2D::ty

the ty component


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