SketchUp SDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
mesh_helper.h File Reference
#include <stdlib.h>
#include <slapi/geometry.h>
#include <slapi/slapi.h>
#include <slapi/model/defs.h>
#include <slapi/model/texture_writer.h>

Go to the source code of this file.

Functions

SU_RESULT SUMeshHelperCreate (SUMeshHelperRef *mesh_ref, SUFaceRef face_ref)
 Creates a tessellated polygon mesh object from a face object. More...
 
SU_RESULT 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...
 
SU_RESULT 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...
 
SU_RESULT SUMeshHelperRelease (SUMeshHelperRef *mesh_ref)
 Deallocates a polygon mesh object. More...
 
SU_RESULT SUMeshHelperGetNumTriangles (SUMeshHelperRef mesh_ref, size_t *count)
 Retrieves the total number of polygons in the mesh. More...
 
SU_RESULT SUMeshHelperGetNumVertices (SUMeshHelperRef mesh_ref, size_t *count)
 Retrieves the total number of vertices in the polygon mesh object. More...
 
SU_RESULT 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...
 
SU_RESULT SUMeshHelperGetVertices (SUMeshHelperRef mesh_ref, size_t len, struct SUPoint3D vertices[], size_t *count)
 Retrieves the vertices of a triangle mesh object. More...
 
SU_RESULT 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...
 
SU_RESULT 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...
 
SU_RESULT SUMeshHelperGetNormals (SUMeshHelperRef mesh_ref, size_t len, struct SUVector3D normals[], size_t *count)
 Retrieves the vertex normal vectors of a triangle mesh object. More...
 

Function Documentation

SU_RESULT SUMeshHelperCreate ( SUMeshHelperRef mesh_ref,
SUFaceRef  face_ref 
)

Creates a tessellated polygon mesh object from a face object.

Parameters
[in]mesh_refThe mesh object created.
[in]face_refThe face object.
Returns
SU_RESULT 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.

Parameters
[out]mesh_refThe mesh object created.
[in]face_refThe face object.
[in]texture_writer_refThe texture writer object.
Returns
SU_RESULT 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.

Parameters
[out]mesh_refThe mesh object created.
[in]face_refThe face object.
[in]uv_helper_refThe UV helper object.
Returns
SU_RESULT SUMeshHelperGetBackSTQCoords ( SUMeshHelperRef  mesh_ref,
size_t  len,
struct SUPoint3D  stq[],
size_t *  count 
)

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

Parameters
[in]mesh_refThe mesh object.
[in]lenThe number of stq coordinates to retrieve.
[out]stqThe stq coordinates retrieved.
[out]countThe number of stq coordinates retrieved.
Returns
SU_RESULT SUMeshHelperGetFrontSTQCoords ( SUMeshHelperRef  mesh_ref,
size_t  len,
struct SUPoint3D  stq[],
size_t *  count 
)

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

Parameters
[in]mesh_refThe mesh object.
[in]lenThe number of stq coordinates to retrieve.
[out]stqThe stq coordinates retrieved.
[out]countThe number of stq coordinates retrieved.
Returns
SU_RESULT SUMeshHelperGetNormals ( SUMeshHelperRef  mesh_ref,
size_t  len,
struct SUVector3D  normals[],
size_t *  count 
)

Retrieves the vertex normal vectors of a triangle mesh object.

Parameters
[in]mesh_refThe mesh object whose vertex normal vectors are retrieved.
[in]lenThe number of vertex normal objects to retrieve.
[out]normalsThe vertex normal vectors retrieved.
[out]countThe number of normal vectors retrieved.
Returns
SU_RESULT SUMeshHelperGetNumTriangles ( SUMeshHelperRef  mesh_ref,
size_t *  count 
)

Retrieves the total number of polygons in the mesh.

Parameters
[in]mesh_refThe mesh object.
[out]countThe number of polygons available.
Returns
SU_RESULT SUMeshHelperGetNumVertices ( SUMeshHelperRef  mesh_ref,
size_t *  count 
)

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

Parameters
[in]mesh_refThe mesh object.
[out]countThe number of vertices available.
Returns
SU_RESULT 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.

Parameters
[in]mesh_refThe mesh object.
[in]lenThe number of indices to retrieve.
[out]indicesThe indices retrieved.
[out]countThe number of indices retrieved.
Returns
SU_RESULT SUMeshHelperGetVertices ( SUMeshHelperRef  mesh_ref,
size_t  len,
struct SUPoint3D  vertices[],
size_t *  count 
)

Retrieves the vertices of a triangle mesh object.

Parameters
[in]mesh_refThe mesh object.
[in]lenThe number of vertices to retrieve.
[out]verticesThe vertices retrieved.
[out]countThe number of vertices retrieved.
Returns
SU_RESULT SUMeshHelperRelease ( SUMeshHelperRef mesh_ref)

Deallocates a polygon mesh object.

Parameters
[in]mesh_refThe mesh object to deallocate.
Returns