LayOut C API

- Main Page
- Related Pages
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Data Fields

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Data Fields | Related Functions
SUPoint2D Struct Reference

Represents a point in 2-dimensional space. The coordinates are represented in inches. More...

`#include <geometry.h>`

## Data Fields
double | x
| X coordinate. More...
double | y
| Y coordinate. More...

## Related Functions
(Note that these are not member functions.)
SU_RESULT | SUPoint2DToSUPoint2D (const struct SUPoint2D *point1, const struct SUPoint2D *point2, struct SUVector2D *vector)
| Creates a vector between two point objects. More...
SU_RESULT | SUPoint2DGetEqual (const struct SUPoint2D *point1, const struct SUPoint2D *point2, bool *equal)
| Determines if two points are equal. More...
SU_RESULT | SUPoint2DOffset (const struct SUPoint2D *point1, const struct SUVector2D *vector, struct SUPoint2D *point2)
| Creates a new point that is offset from another point. More...
SU_RESULT | SUPoint2DDistanceToSUPoint2D (const struct SUPoint2D *point1, const struct SUPoint2D *point2, double *distance)
| Gets the distance between two point objects, in inches. More...
SU_RESULT | SUPoint2DTransform (const struct SUTransformation2D *transform, struct SUPoint2D *point)
| Transforms a point by applying a 2D transformation. More...

## Detailed Description

Represents a point in 2-dimensional space. The coordinates are represented in inches.

## Friends And Related Function Documentation

SU_RESULT SUPoint2DDistanceToSUPoint2D | ( | const struct SUPoint2D * | point1,
|  | const struct SUPoint2D * | point2,
|  | double * | distance
| ) |  |
| related

Gets the distance between two point objects, in inches.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | point1 | The first point object.
  [in] | point2 | The second point object.
  [out] | distance | The distance between the two points, in inches.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if point1 or point2 is NULL
  - SU_ERROR_NULL_POINTER_OUTPUT if distance is NULL

SU_RESULT SUPoint2DGetEqual | ( | const struct SUPoint2D * | point1,
|  | const struct SUPoint2D * | point2,
|  | bool * | equal
| ) |  |
| related

Determines if two points are equal.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | point1 | The first point object.
  [in] | point2 | The second point object.
  [out] | equal | Whether the two points are the same.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if point1 or point2 is NULL
  - SU_ERROR_NULL_POINTER_OUTPUT if equal is NULL

SU_RESULT SUPoint2DOffset | ( | const struct SUPoint2D * | point1,
|  | const struct SUVector2D * | vector,
|  | struct SUPoint2D * | point2
| ) |  |
| related

Creates a new point that is offset from another point.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | point1 | The point object.
  [in] | vector | The offset vector object.
  [out] | point2 | The new point.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if point1 or vector is NULL
  - SU_ERROR_NULL_POINTER_OUTPUT if point2 is NULL

SU_RESULT SUPoint2DToSUPoint2D | ( | const struct SUPoint2D * | point1,
|  | const struct SUPoint2D * | point2,
|  | struct SUVector2D * | vector
| ) |  |
| related

Creates a vector between two point objects.

Since
  SketchUp 2017, API 5.0

Deprecated:
  The functionality is replaced by SUVector2DCreate.

Parameters

  [in] | point1 | The first point object.
  [in] | point2 | The second point object.
  [out] | vector | The vector from point1 to point2.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if point1 or point2 is NULL
  - SU_ERROR_NULL_POINTER_OUTPUT if vector is NULL

SU_RESULT SUPoint2DTransform | ( | const struct SUTransformation2D * | transform,
|  | struct SUPoint2D * | point
| ) |  |
| related

Transforms a point by applying a 2D transformation.

Since
  SketchUp 2019, API 7.0

Parameters

  [in] | transform | The transformation to be applied.
  [in,out] | point | The point to be transformed.

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

## Field Documentation

double SUPoint2D::x

X coordinate.

double SUPoint2D::y

Y coordinate.

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

- SketchUpAPI/geometry.h
- SketchUpAPI/geometry/point2d.h