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
Related Functions
SUMeshHelperRef Struct Reference

A helper class that will tessellate a SUFaceRef object into triangles, and then provide the vertices, normals, and STQ coordinates of those triangles. More...

`#include <SketchUpAPI/model/mesh_helper.h>`

## Related Functions
(Note that these are not member functions.)
enum SUResult | SUMeshHelperCreate (SUMeshHelperRef *mesh_ref, SUFaceRef face_ref)
| Creates a tessellated polygon mesh object from a face object. More...
enum SUResult | SUMeshHelperCreateWithTextureWriter (SUMeshHelperRef *mesh_ref, SUFaceRef face_ref, SUTextureWriterRef texture_writer_ref)
| Creates a tessellated polygon mesh object from a face object and the texture writer object used to write the material texture(s) of the face object. More...
enum SUResult | SUMeshHelperCreateWithUVHelper (SUMeshHelperRef *mesh_ref, SUFaceRef face_ref, SUUVHelperRef uv_helper_ref)
| Creates a tessellated polygon mesh object from a face and a UV helper associated with the face. More...
enum SUResult | SUMeshHelperRelease (SUMeshHelperRef *mesh_ref)
| Deallocates a polygon mesh object. More...
enum SUResult | SUMeshHelperGetNumTriangles (SUMeshHelperRef mesh_ref, size_t *count)
| Retrieves the total number of polygons in the mesh. More...
enum SUResult | SUMeshHelperGetNumVertices (SUMeshHelperRef mesh_ref, size_t *count)
| Retrieves the total number of vertices in the polygon mesh object. More...
enum SUResult | SUMeshHelperGetVertexIndices (SUMeshHelperRef mesh_ref, size_t len, size_t indices[], size_t *count)
| Retrieves the array of indices of the vertices of a triangle mesh object. The each element indexes into the arrays retrieved with SUMeshHelperGetVertices, SUMeshHelperGetFrontSTQCoords(), SUMeshHelperGetBackSTQCoords and SUMeshHelperGetNormals(). The elements are sorted so that every three elements (i.e., stride of three) compose the indices to the three vertices of a triangle. More...
enum SUResult | SUMeshHelperGetVertices (SUMeshHelperRef mesh_ref, size_t len, struct SUPoint3D vertices[], size_t *count)
| Retrieves the vertices of a triangle mesh object. More...
enum SUResult | SUMeshHelperGetFrontSTQCoords (SUMeshHelperRef mesh_ref, size_t len, struct SUPoint3D stq[], size_t *count)
| Retrieves the front stq texture coordinates of a triangle mesh object. More...
enum SUResult | SUMeshHelperGetBackSTQCoords (SUMeshHelperRef mesh_ref, size_t len, struct SUPoint3D stq[], size_t *count)
| Retrieves the back stq texture coordinates of a triangle mesh object. More...
enum SUResult | SUMeshHelperGetNormals (SUMeshHelperRef mesh_ref, size_t len, struct SUVector3D normals[], size_t *count)
| Retrieves the vertex normal vectors of a triangle mesh object. More...

## Detailed Description

A helper class that will tessellate a SUFaceRef object into triangles, and then provide the vertices, normals, and STQ coordinates of those triangles.

## Friends And Related Function Documentation

enum SUResult SUMeshHelperCreate | ( | SUMeshHelperRef * | mesh_ref,
|  | SUFaceRef | face_ref
| ) |  |
| related

Creates a tessellated polygon mesh object from a face object.

Parameters

  [in] | mesh_ref | The mesh object created.
  [in] | face_ref | The face object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if mesh_ref is NULL
  - SU_ERROR_OVERWRITE_VALID if mesh_ref already references a valid object

enum SUResult SUMeshHelperCreateWithTextureWriter | ( | SUMeshHelperRef * | mesh_ref,
|  | SUFaceRef | face_ref,
|  | SUTextureWriterRef | texture_writer_ref
| ) |  |
| related

Creates a tessellated polygon mesh object from a face object and the texture writer object used to write the material texture(s) of the face object.

Parameters

  [out] | mesh_ref | The mesh object created.
  [in] | face_ref | The face object.
  [in] | texture_writer_ref | The texture writer object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if face_ref or texture_writer_ref is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if mesh_ref is NULL
  - SU_ERROR_OVERWRITE_VALID if mesh_ref already references a valid object

enum SUResult SUMeshHelperCreateWithUVHelper | ( | SUMeshHelperRef * | mesh_ref,
|  | SUFaceRef | face_ref,
|  | SUUVHelperRef | uv_helper_ref
| ) |  |
| related

Creates a tessellated polygon mesh object from a face and a UV helper associated with the face.

Parameters

  [out] | mesh_ref | The mesh object created.
  [in] | face_ref | The face object.
  [in] | uv_helper_ref | The UV helper object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if face_ref or uv_helper_ref is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if mesh_ref is NULL
  - SU_ERROR_OVERWRITE_VALID if mesh_ref already references a valid object

enum SUResult SUMeshHelperGetBackSTQCoords | ( | SUMeshHelperRef | mesh_ref,
|  | size_t | len,
|  | struct SUPoint3D | stq[],
|  | size_t * | count
| ) |  |
| related

Retrieves the back stq texture coordinates of a triangle mesh object.

Parameters

  [in] | mesh_ref | The mesh object.
  [in] | len | The number of stq coordinates to retrieve.
  [out] | stq | The stq coordinates retrieved.
  [out] | count | The number of stq coordinates retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if stq or count is NULL

enum SUResult SUMeshHelperGetFrontSTQCoords | ( | SUMeshHelperRef | mesh_ref,
|  | size_t | len,
|  | struct SUPoint3D | stq[],
|  | size_t * | count
| ) |  |
| related

Retrieves the front stq texture coordinates of a triangle mesh object.

Parameters

  [in] | mesh_ref | The mesh object.
  [in] | len | The number of stq coordinates to retrieve.
  [out] | stq | The stq coordinates retrieved.
  [out] | count | The number of stq coordinates retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if stq or count is NULL

enum SUResult SUMeshHelperGetNormals | ( | SUMeshHelperRef | mesh_ref,
|  | size_t | len,
|  | struct SUVector3D | normals[],
|  | size_t * | count
| ) |  |
| related

Retrieves the vertex normal vectors of a triangle mesh object.

Parameters

  [in] | mesh_ref | The mesh object whose vertex normal vectors are retrieved.
  [in] | len | The number of vertex normal objects to retrieve.
  [out] | normals | The vertex normal vectors retrieved.
  [out] | count | The number of normal vectors retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if normals or count is NULL

enum SUResult SUMeshHelperGetNumTriangles | ( | SUMeshHelperRef | mesh_ref,
|  | size_t * | count
| ) |  |
| related

Retrieves the total number of polygons in the mesh.

Parameters

  [in] | mesh_ref | The mesh object.
  [out] | count | The number of polygons available.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if mesh_ref is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if count is NULL

enum SUResult SUMeshHelperGetNumVertices | ( | SUMeshHelperRef | mesh_ref,
|  | size_t * | count
| ) |  |
| related

Retrieves the total number of vertices in the polygon mesh object.

Parameters

  [in] | mesh_ref | The mesh object.
  [out] | count | The number of vertices available.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if mesh_ref is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if count is NULL

enum SUResult SUMeshHelperGetVertexIndices | ( | SUMeshHelperRef | mesh_ref,
|  | size_t | len,
|  | size_t | indices[],
|  | size_t * | count
| ) |  |
| related

Retrieves the array of indices of the vertices of a triangle mesh object. The each element indexes into the arrays retrieved with SUMeshHelperGetVertices, SUMeshHelperGetFrontSTQCoords(), SUMeshHelperGetBackSTQCoords and SUMeshHelperGetNormals(). The elements are sorted so that every three elements (i.e., stride of three) compose the indices to the three vertices of a triangle.

Parameters

  [in] | mesh_ref | The mesh object.
  [in] | len | The number of indices to retrieve.
  [out] | indices | The indices retrieved.
  [out] | count | The number of indices retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if indices or count is NULL

enum SUResult SUMeshHelperGetVertices | ( | SUMeshHelperRef | mesh_ref,
|  | size_t | len,
|  | struct SUPoint3D | vertices[],
|  | size_t * | count
| ) |  |
| related

Retrieves the vertices of a triangle mesh object.

Parameters

  [in] | mesh_ref | The mesh object.
  [in] | len | The number of vertices to retrieve.
  [out] | vertices | The vertices retrieved.
  [out] | count | The number of vertices retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if vertices or count is NULL

enum SUResult SUMeshHelperRelease | ( | SUMeshHelperRef * | mesh_ref | ) |
| related

Deallocates a polygon mesh object.

Parameters

  [in] | mesh_ref | The mesh object to deallocate.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if mesh_ref is NULL

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

- SketchUpAPI/model/defs.h
- SketchUpAPI/model/mesh_helper.h