SketchUp C API

- Main Page
- Related Pages
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends 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 <SketchUpAPI/geometry.h>`

## Data Fields
double | m11
| the m11 component
double | m12
| the m12 component
double | m21
| the m21 component
double | m22
| the m22 component
double | tx
| the tx component
double | ty
| the ty component

## Related Functions
(Note that these are not member functions.)
enum SUResult | SUTransformation2DTranslation (struct SUTransformation2D *transform, const struct SUVector2D *vector)
| Creates a translation transformation using the given vector. More...
enum SUResult | SUTransformation2DScale (struct SUTransformation2D *transform, double scale)
| Creates a scale transformation using the given scale value. More...
enum SUResult | SUTransformation2DNonUniformScale (struct SUTransformation2D *transform, double x_scale, double y_scale)
| Creates a scale transformation using the given scale values. More...
enum SUResult | SUTransformation2DScaleAboutPoint (struct SUTransformation2D *transform, const struct SUPoint2D *point, double scale)
| Creates a scale transformation using the given scale value and origin. More...
enum SUResult | 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...
enum SUResult | SUTransformation2DRotation (struct SUTransformation2D *transform, const struct SUPoint2D *point, double angle)
| Creates a transformation given a point and angle. More...
enum SUResult | SUTransformation2DIsIdentity (const struct SUTransformation2D *transform, bool *is_identity)
| Gets whether the transformation is an identity transformation. More...
enum SUResult | SUTransformation2DGetInverse (const struct SUTransformation2D *transform, struct SUTransformation2D *inverse)
| Gets the inverse transformation of the given transformation object. More...
enum SUResult | 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

enum SUResult 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] | transform | The transformation object.
  [out] | inverse | The inverse transformation object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if transform is NULL
  - SU_ERROR_NULL_POINTER_INPUT if inverse is NULL
  - SU_ERROR_INVALID_ARGUMENT if the transform cannot be inverted

enum SUResult 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] | transform | The transformation object.
  [out] | is_identity | Whether the transformation is identity.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if transform is NULL
  - SU_ERROR_NULL_POINTER_OUTPUT if is_identity is NULL

enum SUResult 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] | transform1 | The transformation object to be multiplied.
  [in] | transform2 | The transformation object to multiply by.
  [out] | out_transform | The result of the matrix multiplication [transform1 * transform2].

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if out_transform is NULL
  - SU_ERROR_NULL_POINTER_INPUT if transform1 or transform2 are NULL

enum SUResult 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] | transform | The transformation to be set.
  [in] | x_scale | The x-axis scale value for the transformation.
  [in] | y_scale | The y-axis scale value for the transformation.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if transform is NULL
  - SU_ERROR_NULL_POINTER_INPUT if x_scale or y_scale are NULL

enum SUResult 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] | transform | The transformation to be set.
  [in] | point | The point specifying the translation component of the transformation. The coordinates of the point should be expressed in inches.
  [in] | x_scale | The x-axis scale value for the transformation.
  [in] | y_scale | The y-axis scale value for the transformation.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if transform is NULL
  - SU_ERROR_NULL_POINTER_INPUT if point, x_scale, or y_scale are NULL

enum SUResult 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] | transform | The calculated transformation.
  [in] | point | The point specifying the translation component of the transformation. The coordinates of the point should be expressed in inches.
  [in] | angle | The rotation in radians for the transformation.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if transform is NULL
  - SU_ERROR_NULL_POINTER_OUTPUT if is_identity is NULL
  - SU_ERROR_OUT_OF_RANGE if weight is not between 0.0 and 1.0

enum SUResult SUTransformation2DScale | ( | struct SUTransformation2D * | transform,
|  | double | scale
| ) |  |
| related

Creates a scale transformation using the given scale value.

Since
  SketchUp 2019, API 7.0

Parameters

  [out] | transform | The transformation to be set.
  [in] | scale | The scale value for the transformation.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if transform is NULL

enum SUResult 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] | transform | The transformation to be set.
  [in] | point | The point specifying the translation component of the transformation. The coordinates of the point are in inches.
  [in] | scale | The scale value for the transformation.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if transform is NULL
  - SU_ERROR_NULL_POINTER_INPUT if point or scale are NULL

enum SUResult 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] | transform | The transformation to be set.
  [in] | vector | The 2D vector specifying the translation for the transformation.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if transform is NULL
  - SU_ERROR_NULL_POINTER_INPUT if vector is NULL

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

- SketchUpAPI/geometry.h
- SketchUpAPI/geometry/transformation2d.h