SketchUp C API
|
References a face. More...
#include <SketchUpAPI/model/face.h>
Inherits SUDrawingElementRef.
Related Functions | |
(Note that these are not member functions.) | |
SUEntityRef | SUFaceToEntity (SUFaceRef face) |
Converts from an SUFaceRef to an SUEntityRef. This is essentially an upcast operation. More... | |
SUFaceRef | SUFaceFromEntity (SUEntityRef entity) |
Converts from an SUEntityRef to an SUFaceRef. This is essentially a downcast operation so the given entity must be convertible to an SUFaceRef. More... | |
SUDrawingElementRef | SUFaceToDrawingElement (SUFaceRef face) |
Converts from an SUFaceRef to an SUDrawingElementRef. This is essentially an upcast operation. More... | |
SUFaceRef | SUFaceFromDrawingElement (SUDrawingElementRef drawing_elem) |
Converts from an SUDrawingElementRef to an SUFaceRef. This is essentially a downcast operation so the given element must be convertible to an SUFaceRef. More... | |
enum SUResult | SUFaceCreate (SUFaceRef *face, const struct SUPoint3D vertices3d[], SULoopInputRef *outer_loop) |
Creates a face without holes. More... | |
enum SUResult | SUFaceCreateSimple (SUFaceRef *face, const struct SUPoint3D vertices3d[], size_t len) |
Creates a simple face without holes from an array of vertices. More... | |
enum SUResult | SUFaceGetNormal (SUFaceRef face, struct SUVector3D *normal) |
Retrieves the normal vector of a face object. More... | |
enum SUResult | SUFaceRelease (SUFaceRef *face) |
Releases a face object and its associated resources. More... | |
enum SUResult | SUFaceGetNumEdges (SUFaceRef face, size_t *count) |
Retrieves the number of edges in a face. More... | |
enum SUResult | SUFaceGetEdges (SUFaceRef face, size_t len, SUEdgeRef edges[], size_t *count) |
Retrieves the edges in the face. More... | |
enum SUResult | SUFaceGetNumEdgeUses (SUFaceRef face, size_t *count) |
Retrieves the number of edge uses in a face. More... | |
enum SUResult | SUFaceGetEdgeUses (SUFaceRef face, size_t len, SUEdgeUseRef edges[], size_t *count) |
Retrieves the edge uses in the face. More... | |
enum SUResult | SUFaceGetPlane (SUFaceRef face, struct SUPlane3D *plane) |
Retrieves the plane of the face. More... | |
enum SUResult | SUFaceGetNumVertices (SUFaceRef face, size_t *count) |
Retrieves the number of vertices that the face is associated with. More... | |
enum SUResult | SUFaceGetVertices (SUFaceRef face, size_t len, SUVertexRef vertices[], size_t *count) |
Retrieves the vertex objects associated with a face object. More... | |
enum SUResult | SUFaceGetOuterLoop (SUFaceRef face, SULoopRef *loop) |
Retrieves the outer loop of a face object. More... | |
enum SUResult | SUFaceGetNumInnerLoops (SUFaceRef face, size_t *count) |
Retrieves the number of loops in a face. More... | |
enum SUResult | SUFaceGetInnerLoops (SUFaceRef face, size_t len, SULoopRef loops[], size_t *count) |
Retrieves the loops in the face. More... | |
enum SUResult | SUFaceAddInnerLoop (SUFaceRef face, const struct SUPoint3D vertices3d[], SULoopInputRef *loop) |
Adds a hole to the face. The face object must be associated with a parent component. More... | |
enum SUResult | SUFaceGetNumOpenings (SUFaceRef face, size_t *count) |
Retrieves the number of openings in a face. More... | |
enum SUResult | SUFaceGetOpenings (SUFaceRef face, size_t len, SUOpeningRef openings[], size_t *count) |
Retrieves the openings in the face. The retrieved SUOpeningRef() objects must be manually released by calling SUOpeningRelease() on each one. More... | |
enum SUResult | SUFaceGetFrontMaterial (SUFaceRef face, SUMaterialRef *material) |
Retrieves the front material associated with a face object. More... | |
enum SUResult | SUFaceSetFrontMaterial (SUFaceRef face, SUMaterialRef material) |
Sets the front material of a face object. More... | |
enum SUResult | SUFaceGetBackMaterial (SUFaceRef face, SUMaterialRef *material) |
Retrieves the back material associate with a face object. More... | |
enum SUResult | SUFaceSetBackMaterial (SUFaceRef face, SUMaterialRef material) |
Sets the back material of a face object. More... | |
enum SUResult | SUFaceIsFrontMaterialAffine (SUFaceRef face, bool *is_affine) |
Retrieves the flag indicating whether a face object has an affine texture applied to its front. More... | |
enum SUResult | SUFaceIsBackMaterialAffine (SUFaceRef face, bool *is_affine) |
Retrieves the flag indicating whether a face object has an affine texture applied to its back. More... | |
enum SUResult | SUFaceGetArea (SUFaceRef face, double *area) |
Computes the area of the face, taking into account all the inner loops and cuts from openings. More... | |
enum SUResult | SUFaceGetAreaWithTransform (SUFaceRef face, const struct SUTransformation *transform, double *area) |
Computes the area of the face with the provided transformation applied. More... | |
enum SUResult | SUFaceIsComplex (SUFaceRef face, bool *is_complex) |
Retrieves a flag indicating whether the face is complex, i.e. contains either inner loops or openings cut by attached component instances or attached groups. More... | |
enum SUResult | SUFaceGetUVHelper (SUFaceRef face, bool front, bool back, SUTextureWriterRef texture_writer, SUUVHelperRef *uv_helper) |
Creates a UV helper for the face. More... | |
enum SUResult | SUFaceGetUVHelperWithTextureHandle (SUFaceRef face, bool front, bool back, SUTextureWriterRef texture_writer, long textureHandle, SUUVHelperRef *uv_helper) |
Creates a UV helper for the face given a specific texture handle. More... | |
enum SUResult | SUFaceGetNumAttachedDrawingElements (SUFaceRef face, size_t *count) |
Retrieves the number of attached drawing elements in a face. More... | |
enum SUResult | SUFaceGetAttachedDrawingElements (SUFaceRef face, size_t len, SUDrawingElementRef elems[], size_t *count) |
Retrieves the attached drawing elements in the face. More... | |
enum SUResult | SUFaceReverse (SUFaceRef face) |
Reverses a face object. More... | |
enum SUResult | SUFaceGetUVTileAt (SUFaceRef face, const struct SUPoint3D *reference, bool front, struct SUPoint3D points[4], struct SUPoint2D uv_coords[4]) |
Retrieves the world and UV coordinates of a UV tile. More... | |
enum SUResult | SUFaceIsTexturePositioned (SUFaceRef face, bool front, bool *is_positioned) |
Retrieves a flag indicating whether the face has a positioned texture. More... | |
enum SUResult | SUFaceClearTexturePosition (SUFaceRef face, bool front) |
Clears the texture position. More... | |
enum SUResult | SUFaceIsTextureProjected (SUFaceRef face, bool front, bool *is_projected) |
Retrieves a flag indicating whether the face has a projected texture. More... | |
enum SUResult | SUFaceGetTextureProjection (SUFaceRef face, bool front, struct SUVector3D *vector) |
Retrieves a vector representing the projection direction for the texture on the given side of the face. More... | |
enum SUResult | SUFaceClearTextureProjection (SUFaceRef face, bool front) |
Clears the texture projection. More... | |
enum SUResult | SUFacePositionMaterial (SUFaceRef face, bool front, struct SUMaterialPositionInput *mapping) |
Positions a textured material on the face. More... | |
Related Functions inherited from SUDrawingElementRef | |
SUEntityRef | SUDrawingElementToEntity (SUDrawingElementRef elem) |
Converts from an SUDrawingElementRef to an SUEntityRef. This is essentially an upcast operation. More... | |
SUDrawingElementRef | SUDrawingElementFromEntity (SUEntityRef entity) |
Converts from an SUEntityRef to an SUDrawingElementRef. This is essentially a downcast operation so the given entity must be convertible to a drawing element. More... | |
enum SURefType | SUDrawingElementGetType (SUDrawingElementRef elem) |
Returns the concrete type of the given drawing element. More... | |
enum SUResult | SUDrawingElementGetBoundingBox (SUDrawingElementRef elem, struct SUBoundingBox3D *bbox) |
Retrieves the bounding box of a drawing element. More... | |
enum SUResult | SUDrawingElementGetMaterial (SUDrawingElementRef elem, SUMaterialRef *material) |
Retrieves the material object of a drawing element. More... | |
enum SUResult | SUDrawingElementSetMaterial (SUDrawingElementRef elem, SUMaterialRef material) |
Sets the material of a drawing element. More... | |
enum SUResult | SUDrawingElementGetLayer (SUDrawingElementRef elem, SULayerRef *layer) |
Retrieves the layer object associated with a drawing element. More... | |
enum SUResult | SUDrawingElementSetLayer (SUDrawingElementRef elem, SULayerRef layer) |
Sets the layer object to be associated with a drawing element. More... | |
enum SUResult | SUDrawingElementSetHidden (SUDrawingElementRef elem, bool hide_flag) |
Sets the hide flag of a drawing element. More... | |
enum SUResult | SUDrawingElementGetHidden (SUDrawingElementRef elem, bool *hide_flag) |
Retrieves the hide flag of a drawing element. More... | |
enum SUResult | SUDrawingElementSetCastsShadows (SUDrawingElementRef elem, bool casts_shadows_flag) |
Sets the casts shadows flag of a drawing element. More... | |
enum SUResult | SUDrawingElementGetCastsShadows (SUDrawingElementRef elem, bool *casts_shadows_flag) |
Retrieves the casts shadows flag of a drawing element. More... | |
enum SUResult | SUDrawingElementSetReceivesShadows (SUDrawingElementRef elem, bool receives_shadows_flag) |
Sets the receives shadows flag of a drawing element. More... | |
enum SUResult | SUDrawingElementGetReceivesShadows (SUDrawingElementRef elem, bool *receives_shadows_flag) |
Retrieves the receives shadows flag of a drawing element. More... | |
Related Functions inherited from SUEntityRef | |
enum SURefType | SUEntityGetType (SUEntityRef entity) |
Returns the concrete type of the given entity. More... | |
enum SUResult | SUEntityGetID (SUEntityRef entity, int32_t *entity_id) |
Retrieves the id of the entity. More... | |
enum SUResult | SUEntityGetPersistentID (SUEntityRef entity, int64_t *entity_pid) |
Retrieves the persistent id of the entity. More... | |
enum SUResult | SUEntityGetNumAttributeDictionaries (SUEntityRef entity, size_t *count) |
Retrieves the number of attribute dictionaries of an entity. More... | |
enum SUResult | SUEntityGetAttributeDictionaries (SUEntityRef entity, size_t len, SUAttributeDictionaryRef dictionaries[], size_t *count) |
Retrieves the attribute dictionaries of an entity. More... | |
enum SUResult | SUEntityAddAttributeDictionary (SUEntityRef entity, SUAttributeDictionaryRef dictionary) |
Adds the attribute dictionary to an entity. The given dictionary object must not belong to another entity. In other words, each dictionary should be added to one entity only. More... | |
enum SUResult | SUEntityGetAttributeDictionary (SUEntityRef entity, const char *name, SUAttributeDictionaryRef *dictionary) |
Retrieves the attribute dictionary of an entity that has the given name. More... | |
enum SUResult | SUEntityGetModel (SUEntityRef entity, SUModelRef *model) |
Retrieves the model object associated with the entity. More... | |
enum SUResult | SUEntityGetParentEntities (SUEntityRef entity, SUEntitiesRef *entities) |
Retrieves the entities object which contains the entity. More... | |
References a face.
|
related |
Adds a hole to the face. The face object must be associated with a parent component.
[in] | face | The face object. |
[in] | vertices3d | The array of vertices references by the added loop. |
[in] | loop | The loop input that describes the inner loop. If the function is successful, the new face will take ownership of the loop and this reference will be invalidated. |
Clears the texture position.
This is similar to reseting the texture position from the SketchUp UI face context menu.
[in] | face | |
[in] | front | Flag indicating whether to clear the front or back side of the face. |
face
is not a valid face object. Clears the texture projection.
This is similar to toggling off Projection from the Position Texture tool in the UI.
[in] | face | |
[in] | front | Flag indicating whether to clear the front or back side of the face. |
face
is not a valid face object.
|
related |
Creates a face without holes.
[out] | face | The face object created. |
[in] | vertices3d | The array of vertices that make the face. |
[in] | outer_loop | The loop input that describes the outer loop of the face. If the function is successful, the new face will take ownership of the loop and this reference will be invalidated. |
|
related |
Creates a simple face without holes from an array of vertices.
[out] | face | The face object created. |
[in] | vertices3d | The array of vertices of the face. |
[in] | len | The length of the array of vertices. |
|
related |
Converts from an SUDrawingElementRef to an SUFaceRef. This is essentially a downcast operation so the given element must be convertible to an SUFaceRef.
[in] | drawing_elem | The given element reference. |
|
related |
Converts from an SUEntityRef to an SUFaceRef. This is essentially a downcast operation so the given entity must be convertible to an SUFaceRef.
[in] | entity | The given entity reference. |
Computes the area of the face, taking into account all the inner loops and cuts from openings.
[in] | face | The face object. |
[out] | area | The area retrieved. |
|
related |
Computes the area of the face with the provided transformation applied.
[in] | face | The face object. |
[in] | transform | A transformation to be appllied to the face. |
[out] | area | The area retrieved. |
|
related |
Retrieves the attached drawing elements in the face.
[in] | face | The face object. |
[in] | len | The number of attached drawing elements to retrieve. |
[out] | elems | The attached drawing elements retrieved. |
[out] | count | The number of attached drawing elements retrieved. |
|
related |
Retrieves the back material associate with a face object.
[in] | face | The face object. |
[out] | material | The material object retrieved. |
|
related |
Retrieves the edges in the face.
[in] | face | The face object. |
[in] | len | The number of edges to retrieve. |
[out] | edges | The edges retrieved. |
[out] | count | The number of edges retrieved. |
|
related |
Retrieves the edge uses in the face.
[in] | face | The face object. |
[in] | len | The number of edge uses to retrieve. |
[out] | edges | The edgeuses retrieved. |
[out] | count | The number of edge uses retrieved. |
|
related |
Retrieves the front material associated with a face object.
[in] | face | The face object. |
[out] | material | The material object retrieved. |
|
related |
Retrieves the loops in the face.
[in] | face | The face object. |
[in] | len | The number of loops to retrieve. |
[out] | loops | The inner loops retrieved. |
[out] | count | The number of inner loops retrieved. |
|
related |
Retrieves the normal vector of a face object.
[in] | face | The face object. |
[out] | normal | The 3d normal vector retrieved. |
Retrieves the number of attached drawing elements in a face.
[in] | face | The face object. |
[out] | count | The number of attached drawing elements. |
Retrieves the number of edges in a face.
[in] | face | The face object. |
[out] | count | The number of edges. |
Retrieves the number of edge uses in a face.
[in] | face | The face object. |
[out] | count | The number of edge uses. |
Retrieves the number of loops in a face.
[in] | face | The face object. |
[out] | count | The number of inner loops. |
Retrieves the number of openings in a face.
[in] | face | The face object. |
[out] | count | The number of openings. |
Retrieves the number of vertices that the face is associated with.
[in] | face | The face object. |
[out] | count | The number of vertices. |
|
related |
Retrieves the openings in the face. The retrieved SUOpeningRef() objects must be manually released by calling SUOpeningRelease() on each one.
[in] | face | The face object. |
[in] | len | The number of openings to retrieve. |
[out] | openings | The openings retrieved. |
[out] | count | The number of openings retrieved. |
Retrieves the outer loop of a face object.
[in] | face | The face object. |
[out] | loop | The loop object retrieved. |
Retrieves the plane of the face.
[in] | face | The face object. |
[out] | plane | The 3d plane retrieved. |
|
related |
Retrieves a vector representing the projection direction for the texture on the given side of the face.
[in] | face | |
[in] | front | Flag indicating whether to use the front or back side of the face. |
[out] | vector |
face
is not a valid face object.face
does not have a projected material applied.vector
is NULL.
|
related |
Creates a UV helper for the face.
[in] | face | The face object. |
[in] | front | Flag indicating whether to compute the UV coordinates for the front of the face. |
[in] | back | Flag indicating whether to compute the UV coordinates for the back of the face. |
[in] | texture_writer | An optional texture writer to aid in texture coordinate calculations for non-affine textures. |
[out] | uv_helper | The UV helper object created. Must be deallocated via SUUVHelperRelease(). |
|
related |
Creates a UV helper for the face given a specific texture handle.
[in] | face | The face object. |
[in] | front | Flag indicating whether to compute the UV coordinates for the front of the face. |
[in] | back | Flag indicating whether to compute the UV coordinates for the back of the face. |
[in] | texture_writer | An optional texture writer to aid in texture coordinate calculations for non-affine textures. |
[in] | textureHandle | The handle of the image that should be mapped to the face. |
[out] | uv_helper | The UV helper object created. Must be deallocated via SUUVHelperRelease(). |
|
related |
Retrieves the world and UV coordinates of a UV tile.
The UV tile bounds the given reference point on the plane of the face. If the reference isn't on the plane of the face it will be projected onto it.
The world coordinates are on the plane of the face unless the texture is projected. When the texture is projected the the world points are on an arbitrary plane that is perpendicular to the projection direction.
The returned points
and uv_coords
can be used directly with SUMaterialPositionInput.
[in] | face | |
[in] | reference | A point of reference on the plane of the face. |
[in] | front | Flag indicating whether to compute the UV Tile for the front side of the face. |
[out] | points | World coordinates for the bounding UV tile. |
[out] | uv_coords | UV coordinates for the bounding UV tile. |
face
is not a valid object.face
has no textured material of the given side.reference
is NULL.points
is NULL.uv_coords
is NULL.
|
related |
Retrieves the vertex objects associated with a face object.
[in] | face | The face object. |
[in] | len | The number of vertices to retrieve. |
[out] | vertices | The vertices retrieved. |
[out] | count | The number of vertices retrieved. |
Retrieves the flag indicating whether a face object has an affine texture applied to its back.
[in] | face | The face object. |
[out] | is_affine | The flag retrieved. |
Retrieves a flag indicating whether the face is complex, i.e. contains either inner loops or openings cut by attached component instances or attached groups.
[in] | face | The face object. |
[out] | is_complex | The flag retrieved. |
Retrieves the flag indicating whether a face object has an affine texture applied to its front.
[in] | face | The face object. |
[out] | is_affine | The flag retrieved. |
|
related |
Retrieves a flag indicating whether the face has a positioned texture.
A texture is positioned when it's not using the default texture coordinates.
When a user uses the Paint Bucket Tool to apply a material sampled from the Material Browser it will use default texture coordinates and not be positioned. It will be positioned if the user uses the Position Texture Tool.
[in] | face | |
[in] | front | Flag indicating whether to check the front or back side of the face. |
[out] | is_positioned |
face
is not a valid face object.is_positioned
is NULL. Retrieves a flag indicating whether the face has a projected texture.
A texture is projected when the user enables this property via the Position Texture Tool.
In SketchUp a projected texture can use an arbitrary plane, rather than the face's own plane. The projection vector defines the normal of this plane and used this to project the texture onto the face.
[in] | face | |
[in] | front | Flag indicating whether to check the front or back side of the face. |
[out] | is_projected |
face
is not a valid face object.is_projected
is NULL.
|
related |
Positions a textured material on the face.
The texture is positioned using 1 to 4 pairs of model and uv points. The points are used in pairs to describe where a point in the texture image is positioned on the face. This is similar to how textures are positioned in the UI using the Position Texture tool.
[in] | face | |
[in] | front | Flag indicating whether to use the front or back side of the face. |
[in] | mapping |
face
is not a valid face objectmapping
is NULLmapping
doesn't have a valid textured materialmapping
doesn't have 1-4 points/uv_coords.mapping
. Releases a face object and its associated resources.
[in] | face | The face object. |
Reverses a face object.
[in] | face | The face object. |
|
related |
Sets the back material of a face object.
[in] | face | The face object. |
[in] | material | The material object to set. If invalid, this will set the material to the default material. |
|
related |
Sets the front material of a face object.
[in] | face | The face object. |
[in] | material | The material object to set. If invalid, this will set the material to the default material. |
|
related |
Converts from an SUFaceRef to an SUDrawingElementRef. This is essentially an upcast operation.
[in] | face | The given face reference. |
|
related |
Converts from an SUFaceRef to an SUEntityRef. This is essentially an upcast operation.
[in] | face | The given face reference. |