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
SUPlane3D Struct Reference

Represents a 3D plane by the parameters a, b, c, d. For any point on the plane, ax + by + cz + d = 0. The coeficients are normalized so that a*a + b*b + c*c = 1. More...

`#include <geometry.h>`

## Data Fields
double | a
| The "a" factor in the plane equation. More...
double | b
| The "b" factor in the plane equation. More...
double | c
| The "c" factor in the plane equation. More...
double | d
| The "d" factor in the plane equation. More...

## Related Functions
(Note that these are not member functions.)
SU_RESULT | SUPlane3DSetWithPoints (struct SUPlane3D *plane, const struct SUPoint3D *point1, const struct SUPoint3D *point2, const struct SUPoint3D *point3)
| Sets the plane using three points. More...
SU_RESULT | SUPlane3DSetWithPointAndNormal (struct SUPlane3D *plane, const struct SUPoint3D *point, const struct SUVector3D *normal)
| Sets the plane using a point and normal vector. More...
SU_RESULT | SUPlane3DSetWithCoefficients (struct SUPlane3D *plane, double a, double b, double c, double d)
| Sets the plane using equation coefficients. More...
SU_RESULT | SUPlane3DGetPosition (const struct SUPlane3D *plane, struct SUPoint3D *position)
| Gets the position on the plane closest to the origin. More...
SU_RESULT | SUPlane3DGetNormal (const struct SUPlane3D *plane, struct SUVector3D *normal)
| Gets the plane's unit normal vector. More...
SU_RESULT | SUPlane3DIsOn (const struct SUPlane3D *plane, const struct SUPoint3D *point, bool *is_on)
| Gets whether or not the point is on the plane. More...
SU_RESULT | SUPlane3DDistanceTo (const struct SUPlane3D *plane, const struct SUPoint3D *point, double *distance)
| Gets the distance from the point to the nearest point on the plane. More...
SU_RESULT | SUPlane3DProjectTo (const struct SUPlane3D *plane, const struct SUPoint3D *point, struct SUPoint3D *projected_point)
| Projects a point onto the plane. More...
SU_RESULT | SUPlane3DTransform (const struct SUTransformation *transform, struct SUPlane3D *plane)
| Transforms the provided 3D plane by applying the provided 3D transformation. More...

## Detailed Description

Represents a 3D plane by the parameters a, b, c, d. For any point on the plane, ax + by + cz + d = 0. The coeficients are normalized so that a*a + b*b + c*c = 1.

## Friends And Related Function Documentation

SU_RESULT SUPlane3DDistanceTo | ( | const struct SUPlane3D * | plane,
|  | const struct SUPoint3D * | point,
|  | double * | distance
| ) |  |
| related

Gets the distance from the point to the nearest point on the plane.

Since
  SketchUp 2018, API 6.0

Parameters

  [in] | plane | The plane.
  [in] | point | The 3D point.
  [out] | distance | The distance between the plane and point.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if plane or point are NULL
  - SU_ERROR_NULL_POINTER_OUTPUT if distance is NULL

SU_RESULT SUPlane3DGetNormal | ( | const struct SUPlane3D * | plane,
|  | struct SUVector3D * | normal
| ) |  |
| related

Gets the plane's unit normal vector.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | plane | The plane from which to get the normal.
  [out] | normal | The 3D vector struct retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if plane is NULL
  - SU_ERROR_NULL_POINTER_OUTPUT if normal is NULL

SU_RESULT SUPlane3DGetPosition | ( | const struct SUPlane3D * | plane,
|  | struct SUPoint3D * | position
| ) |  |
| related

Gets the position on the plane closest to the origin.

Since
  SketchUp 2016, API 4.0

Parameters

  [in] | plane | The plane from which to get the position.
  [out] | position | The 3D point struct retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if plane is NULL
  - SU_ERROR_NULL_POINTER_OUTPUT if position is NULL

SU_RESULT SUPlane3DIsOn | ( | const struct SUPlane3D * | plane,
|  | const struct SUPoint3D * | point,
|  | bool * | is_on
| ) |  |
| related

Gets whether or not the point is on the plane.

Since
  SketchUp 2018, API 6.0

Parameters

  [in] | plane | The plane.
  [in] | point | The 3D point.
  [out] | is_on | Whether or not the point is on the plane.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if plane or point are NULL
  - SU_ERROR_NULL_POINTER_OUTPUT if is_on is NULL

SU_RESULT SUPlane3DProjectTo | ( | const struct SUPlane3D * | plane,
|  | const struct SUPoint3D * | point,
|  | struct SUPoint3D * | projected_point
| ) |  |
| related

Projects a point onto the plane.

Since
  SketchUp 2018, API 6.0

Parameters

  [in] | plane | The plane.
  [in] | point | The 3D point to project onto the plane.
  [out] | projected_point | The point resulting from the projection.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if plane or point are NULL
  - SU_ERROR_NULL_POINTER_OUTPUT if projected_point is NULL

SU_RESULT SUPlane3DSetWithCoefficients | ( | struct SUPlane3D * | plane,
|  | double | a,
|  | double | b,
|  | double | c,
|  | double | d
| ) |  |
| related

Sets the plane using equation coefficients.

Since
  SketchUp 2018, API 6.0

Parameters

  [out] | plane | The plane defined by the coefficients.
  [in] | a | The first coefficient.
  [in] | b | The second coefficient.
  [in] | c | The third coefficient.
  [in] | d | The fourth coefficient.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if plane is NULL

SU_RESULT SUPlane3DSetWithPointAndNormal | ( | struct SUPlane3D * | plane,
|  | const struct SUPoint3D * | point,
|  | const struct SUVector3D * | normal
| ) |  |
| related

Sets the plane using a point and normal vector.

Since
  SketchUp 2018, API 6.0

Parameters

  [out] | plane | The plane defined by the point and normal.
  [in] | point | The point.
  [in] | normal | The normal vector.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if plane is NULL
  - SU_ERROR_NULL_POINTER_INPUT if point or normal are NULL

SU_RESULT SUPlane3DSetWithPoints | ( | struct SUPlane3D * | plane,
|  | const struct SUPoint3D * | point1,
|  | const struct SUPoint3D * | point2,
|  | const struct SUPoint3D * | point3
| ) |  |
| related

Sets the plane using three points.

Since
  SketchUp 2018, API 6.0

Parameters

  [out] | plane | The plane defined by the three points.
  [in] | point1 | The first point.
  [in] | point2 | The second point.
  [in] | point3 | The third point.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if plane is NULL
  - SU_ERROR_NULL_POINTER_INPUT if point1, point2, or point3 are NULL

SU_RESULT SUPlane3DTransform | ( | const struct SUTransformation * | transform,
|  | struct SUPlane3D * | plane
| ) |  |
| related

Transforms the provided 3D plane by applying the provided 3D transformation.

Since
  SketchUp 2018, API 6.0

Parameters

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

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

## Field Documentation

double SUPlane3D::a

The "a" factor in the plane equation.

double SUPlane3D::b

The "b" factor in the plane equation.

double SUPlane3D::c

The "c" factor in the plane equation.

double SUPlane3D::d

The "d" factor in the plane equation.

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

- SketchUpAPI/geometry.h
- SketchUpAPI/geometry/plane3d.h