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

References a geometry input object. It is used as an input to SUEntitiesFill(). More...

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

## Related Functions
(Note that these are not member functions.)
enum SUResult | SUGeometryInputCreate (SUGeometryInputRef *geom_input)
| Creates a geometry input object. More...
enum SUResult | SUGeometryInputRelease (SUGeometryInputRef *geom_input)
| Deallocates a geometry input object. More...
enum SUResult | SUGeometryInputAddVertex (SUGeometryInputRef geom_input, const struct SUPoint3D *point)
| Adds a vertex to a geometry input object. More...
enum SUResult | SUGeometryInputSetVertices (SUGeometryInputRef geom_input, size_t num_vertices, const struct SUPoint3D points[])
| Sets all vertices of a geometry input object. Any existing vertices will be overridden. More...
enum SUResult | SUGeometryInputAddEdge (SUGeometryInputRef geom_input, size_t vertex0_index, size_t vertex1_index, size_t *added_edge_index)
| Adds an edge to a geometry input object. This method is intended for specifying edges which are not associated with loop inputs. For specifying edge properties on a face use the SULoopInput interface. More...
enum SUResult | SUGeometryInputEdgeSetHidden (SUGeometryInputRef geom_input, size_t edge_index, bool hidden)
| Sets the hidden flag of an edge in a geometry input object which is not associated with a loop input. More...
enum SUResult | SUGeometryInputEdgeSetSoft (SUGeometryInputRef geom_input, size_t edge_index, bool soft)
| Sets the soft flag of an edge in a geometry input object which is not associated with a loop input. More...
enum SUResult | SUGeometryInputEdgeSetSmooth (SUGeometryInputRef geom_input, size_t edge_index, bool smooth)
| Sets the smooth flag of an edge in a geometry input object which is not associated with a loop input. More...
enum SUResult | SUGeometryInputEdgeSetMaterial (SUGeometryInputRef geom_input, size_t edge_index, SUMaterialRef material)
| Sets the material of an edge in the geometry input. More...
enum SUResult | SUGeometryInputEdgeSetLayer (SUGeometryInputRef geom_input, size_t edge_index, SULayerRef layer)
| Sets the layer of an edge in the geometry input. More...
enum SUResult | SUGeometryInputAddCurve (SUGeometryInputRef geom_input, size_t num_edges, const size_t edge_indices[], size_t *added_curve_index)
| Adds a curve to a geometry input object. This method is intended for specifying curves which are not associated with loop inputs. For specifying curves on faces use the SULoopInput interface. More...
enum SUResult | SUGeometryInputAddArcCurve (SUGeometryInputRef geom_input, size_t start_point, size_t end_point, const struct SUPoint3D *center, const struct SUVector3D *normal, size_t num_segments, size_t *added_curve_index, size_t *control_edge_index)
| Adds an arccurve to a geometry input object. In addition to adding an arccurve to the geometry input this method will append num_segments edges to the geometry's edge collection where control_edge_index is the index of the first new edge. Also, num_segments-1 vertices along the arc will be appended to the geometry's collection of verttices. In order to include an arccurve in a loop the user only needs add the arccurve's points to a loop using SULoopInputAddVertexIndex(). More...
enum SUResult | SUGeometryInputAddFace (SUGeometryInputRef geom_input, SULoopInputRef *outer_loop, size_t *added_face_index)
| Adds a face to a geometry input object with a given outer loop for the face. More...
enum SUResult | SUGeometryInputFaceSetReverse (SUGeometryInputRef geom_input, size_t face_index, bool reverse)
| Sets a flag in the geometry input that, when true, will create a face by reversing the orientations of all of its loops. More...
enum SUResult | SUGeometryInputFaceSetLayer (SUGeometryInputRef geom_input, size_t face_index, SULayerRef layer)
| Sets the layer of a face in the geometry input. More...
enum SUResult | SUGeometryInputFaceAddInnerLoop (SUGeometryInputRef geom_input, size_t face_index, SULoopInputRef *loop_input)
| Adds an inner loop to a face in the geometry input. More...
enum SUResult | SUGeometryInputFaceSetFrontMaterial (SUGeometryInputRef geom_input, size_t face_index, const struct SUMaterialInput *material_input)
| Sets the front material of a face in the geometry input. More...
enum SUResult | SUGeometryInputFaceSetBackMaterial (SUGeometryInputRef geom_input, size_t face_index, const struct SUMaterialInput *material_input)
| Sets the back material of a face in the geometry input. More...
enum SUResult | SUGeometryInputFaceSetFrontMaterialByPosition (SUGeometryInputRef geom_input, size_t face_index, const struct SUMaterialPositionInput *material_input)
| Sets the front material of a face in the geometry input. More...
enum SUResult | SUGeometryInputFaceSetBackMaterialByPosition (SUGeometryInputRef geom_input, size_t face_index, const struct SUMaterialPositionInput *material_input)
| Sets the back material of a face in the geometry input. More...
enum SUResult | SUGeometryInputFaceSetHidden (SUGeometryInputRef geom_input, size_t face_index, bool hidden)
| Sets a flag in the geometry input that, when true, will create a hidden face. More...
enum SUResult | SUGeometryInputGetCounts (SUGeometryInputRef geom_input, size_t *vertices_count, size_t *faces_count, size_t *edge_count, size_t *curve_count, size_t *arc_count)
| Returns all the various geometry counts. More...

## Detailed Description

References a geometry input object. It is used as an input to SUEntitiesFill().

## Friends And Related Function Documentation

enum SUResult SUGeometryInputAddArcCurve | ( | SUGeometryInputRef | geom_input,
|  | size_t | start_point,
|  | size_t | end_point,
|  | const struct SUPoint3D * | center,
|  | const struct SUVector3D * | normal,
|  | size_t | num_segments,
|  | size_t * | added_curve_index,
|  | size_t * | control_edge_index
| ) |  |
| related

Adds an arccurve to a geometry input object. In addition to adding an arccurve to the geometry input this method will append num_segments edges to the geometry's edge collection where control_edge_index is the index of the first new edge. Also, num_segments-1 vertices along the arc will be appended to the geometry's collection of verttices. In order to include an arccurve in a loop the user only needs add the arccurve's points to a loop using SULoopInputAddVertexIndex().

Since
  SketchUp 2017 M2, API 5.2

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | start_point | The index of the vertex at the start of the arc.
  [in] | end_point | The index of the vertex at the end of the arc.
  [in] | center | The center point of the arc's circle.
  [in] | normal | The normal vector of the arc plane.
  [in] | num_segments | The number of edges for the arc.
  [out] | added_curve_index | (optional) If not NULL, returns the index of the added curve.
  [out] | control_edge_index | (optional) If not NULL, returns the index of the the arc's control edge which can be used to set the arc's edge properties.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input is not valid
  - SU_ERROR_NULL_POINTER_INPUT if center or normal is NULL
  - SU_ERROR_OUT_OF_RANGE if either start_point or end_point are greater than the total number of points in geom_input
  - SU_ERROR_INVALID_ARGUMENT if the data specifies an invalid arccurve

enum SUResult SUGeometryInputAddCurve | ( | SUGeometryInputRef | geom_input,
|  | size_t | num_edges,
|  | const size_t | edge_indices[],
|  | size_t * | added_curve_index
| ) |  |
| related

Adds a curve to a geometry input object. This method is intended for specifying curves which are not associated with loop inputs. For specifying curves on faces use the SULoopInput interface.

Since
  SketchUp 2017, API 5.0

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | num_edges | The number of edges to be used in the curve.
  [in] | edge_indices | The edge indices to be used in defining the curve.
  [out] | added_curve_index | (optional) If not NULL, returns the index of the added curve.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input is not valid
  - SU_ERROR_NULL_POINTER_INPUT if edge_indices is NULL
  - SU_ERROR_OUT_OF_RANGE if any of the indices in edge_indices are greater than the total number of edges which are not associated with loop inputs

enum SUResult SUGeometryInputAddEdge | ( | SUGeometryInputRef | geom_input,
|  | size_t | vertex0_index,
|  | size_t | vertex1_index,
|  | size_t * | added_edge_index
| ) |  |
| related

Adds an edge to a geometry input object. This method is intended for specifying edges which are not associated with loop inputs. For specifying edge properties on a face use the SULoopInput interface.

Since
  SketchUp 2017, API 5.0

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | vertex0_index | The vertex index of the edge's first vertex.
  [in] | vertex1_index | The vertex index of the edge's last vertex.
  [out] | added_edge_index | (optional) If not NULL, returns the index of the added edge.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input is not valid
  - SU_ERROR_OUT_OF_RANGE if vertex0_index or vertex1_index are greater than the total vertex count
  - SU_ERROR_INVALID_ARGUMENT if vertex0_index and vertex1_index are equal

enum SUResult SUGeometryInputAddFace | ( | SUGeometryInputRef | geom_input,
|  | SULoopInputRef * | outer_loop,
|  | size_t * | added_face_index
| ) |  |
| related

Adds a face to a geometry input object with a given outer loop for the face.

Warning
  Breaking Change: The behavior of this method was changed in SketchUp 2017 M2, API 5.2. An additional error code was added (SU_ERROR_INVALID_ARGUMENT) to indicate to users when the loop contains invalid data.

Parameters

  [in,out] | geom_input | The geometry input object.
  [in,out] | outer_loop | The outer loop to be set for the face. If the function succeeds (i.e. returns SU_ERROR_NONE), this loop will be deallocated.
  [out] | added_face_index | (optional) If not NULL, returns the index of the added face.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input is not valid
  - SU_ERROR_NULL_POINTER_INPUT if outer_loop is NULL
  - SU_ERROR_INVALID_ARGUMENT if the data specifies an invalid loop

enum SUResult SUGeometryInputAddVertex | ( | SUGeometryInputRef | geom_input,
|  | const struct SUPoint3D * | point
| ) |  |
| related

Adds a vertex to a geometry input object.

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | point | The location of the vertex to be added.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input is not valid
  - SU_ERROR_NULL_POINTER_INPUT if point is NULL

enum SUResult SUGeometryInputCreate | ( | SUGeometryInputRef * | geom_input | ) |
| related

Creates a geometry input object.

Parameters

  [out] | geom_input | The object created. This object can be passed into SUEntitiesFill() to populate an entities object. It should be released subsequently by calling SUGeometryInputRelease().

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

enum SUResult SUGeometryInputEdgeSetHidden | ( | SUGeometryInputRef | geom_input,
|  | size_t | edge_index,
|  | bool | hidden
| ) |  |
| related

Sets the hidden flag of an edge in a geometry input object which is not associated with a loop input.

Since
  SketchUp 2017, API 5.0

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | edge_index | The zero-based index of the edge which is not associated with a loop input.
  [in] | hidden | The flag to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input is not valid
  - SU_ERROR_OUT_OF_RANGE if edge_index references beyond the current total number of edges which are not associated with loop inputs

enum SUResult SUGeometryInputEdgeSetLayer | ( | SUGeometryInputRef | geom_input,
|  | size_t | edge_index,
|  | SULayerRef | layer
| ) |  |
| related

Sets the layer of an edge in the geometry input.

Since
  SketchUp 2017, API 5.0

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | edge_index | Index of the edge to set the layer.
  [in] | layer | The layer to be set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input or layer is not valid
  - SU_ERROR_OUT_OF_RANGE if edge_index references an edge beyond the total edge count of geom_input

enum SUResult SUGeometryInputEdgeSetMaterial | ( | SUGeometryInputRef | geom_input,
|  | size_t | edge_index,
|  | SUMaterialRef | material
| ) |  |
| related

Sets the material of an edge in the geometry input.

Since
  SketchUp 2017, API 5.0

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | edge_index | Index of the edge to set the material.
  [in] | material | The material to be set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input or material is not valid
  - SU_ERROR_OUT_OF_RANGE if edge_index references an edge beyond the total
  - SU_ERROR_INVALID_ARGUMENT is the material is owned by a layer or image edge count of geom_input

enum SUResult SUGeometryInputEdgeSetSmooth | ( | SUGeometryInputRef | geom_input,
|  | size_t | edge_index,
|  | bool | smooth
| ) |  |
| related

Sets the smooth flag of an edge in a geometry input object which is not associated with a loop input.

Since
  SketchUp 2017, API 5.0

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | edge_index | The zero-based index of the edge which is not associated with a loop input.
  [in] | smooth | The flag to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input is not valid
  - SU_ERROR_OUT_OF_RANGE if edge_index references beyond the current total number of edges which are not associated with loop inputs

enum SUResult SUGeometryInputEdgeSetSoft | ( | SUGeometryInputRef | geom_input,
|  | size_t | edge_index,
|  | bool | soft
| ) |  |
| related

Sets the soft flag of an edge in a geometry input object which is not associated with a loop input.

Since
  SketchUp 2017, API 5.0

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | edge_index | The zero-based index of the edge which is not associated with a loop input.
  [in] | soft | The flag to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input is not valid
  - SU_ERROR_OUT_OF_RANGE if edge_index references beyond the current total number of edges which are not associated with loop inputs

enum SUResult SUGeometryInputFaceAddInnerLoop | ( | SUGeometryInputRef | geom_input,
|  | size_t | face_index,
|  | SULoopInputRef * | loop_input
| ) |  |
| related

Adds an inner loop to a face in the geometry input.

Warning
  Breaking Change: The behavior of this method was changed in SketchUp 2017 M2, API 5.2. An additional error code was added (SU_ERROR_INVALID_ARGUMENT) to indicate to users when the loop contains invalid data.

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | face_index | Index of the face to receive the inner loop.
  [in,out] | loop_input | The inner loop to be added. If the function succeeds (i.e. returns SU_ERROR_NONE), this loop will be deallocated.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input or *loop_input are not valid
  - SU_ERROR_NULL_POINTER_INPUT if loop_input is NULL
  - SU_ERROR_OUT_OF_RANGE if face_index references a face beyond the total face count of geom_input.
  - SU_ERROR_INVALID_ARGUMENT if the data specifies an invalid loop

enum SUResult SUGeometryInputFaceSetBackMaterial | ( | SUGeometryInputRef | geom_input,
|  | size_t | face_index,
|  | const struct SUMaterialInput * | material_input
| ) |  |
| related

Sets the back material of a face in the geometry input.

Deprecated:
  This function is made obsolete by the newer SUGeometryInputFaceSetBackMaterialPosition() and left in place only for compatibility.

See Also
  SUGeometryInputFaceSetBackMaterialPosition

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | face_index | Index of the face to receive the material.
  [in] | material_input | The material input to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input is not valid
  - SU_ERROR_OUT_OF_RANGE if face_index references a face beyond the total face count of geom_input
  - SU_ERROR_NULL_POINTER_INPUT if material_input is NULL
  - SU_ERROR_INVALID_ARGUMENT is the material is owned by a layer or image

enum SUResult SUGeometryInputFaceSetBackMaterialByPosition | ( | SUGeometryInputRef | geom_input,
|  | size_t | face_index,
|  | const struct SUMaterialPositionInput * | material_input
| ) |  |
| related

Sets the back material of a face in the geometry input.

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | face_index | Index of the face to receive the material.
  [in] | material_input | The material input to set.

Since
  SketchUp 2021.1, API 9.1

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `geom_input` is not valid
  - SU_ERROR_OUT_OF_RANGE if `face_index` references a face beyond the total face count of `geom_input`
  - SU_ERROR_NULL_POINTER_INPUT if `material_input` is NULL
  - SU_ERROR_INVALID_ARGUMENT is the material is owned by a layer or image

enum SUResult SUGeometryInputFaceSetFrontMaterial | ( | SUGeometryInputRef | geom_input,
|  | size_t | face_index,
|  | const struct SUMaterialInput * | material_input
| ) |  |
| related

Sets the front material of a face in the geometry input.

Deprecated:
  This function is made obsolete by the newer SUGeometryInputFaceSetFrontMaterialPosition() and left in place only for compatibility.

See Also
  SUGeometryInputFaceSetFrontMaterialPosition

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | face_index | Index of the face to receive the material.
  [in] | material_input | The material input to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input is not valid
  - SU_ERROR_OUT_OF_RANGE if face_index references a face beyond the total face count of geom_input
  - SU_ERROR_NULL_POINTER_INPUT if material_input is NULL
  - SU_ERROR_INVALID_ARGUMENT is the material is owned by a layer or image

enum SUResult SUGeometryInputFaceSetFrontMaterialByPosition | ( | SUGeometryInputRef | geom_input,
|  | size_t | face_index,
|  | const struct SUMaterialPositionInput * | material_input
| ) |  |
| related

Sets the front material of a face in the geometry input.

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | face_index | Index of the face to receive the material.
  [in] | material_input | The material input to set.

Since
  SketchUp 2021.1, API 9.1

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `geom_input` is not valid
  - SU_ERROR_OUT_OF_RANGE if `face_index` references a face beyond the total face count of `geom_input`
  - SU_ERROR_NULL_POINTER_INPUT if `material_input` is NULL
  - SU_ERROR_INVALID_ARGUMENT is the material is owned by a layer or image

enum SUResult SUGeometryInputFaceSetHidden | ( | SUGeometryInputRef | geom_input,
|  | size_t | face_index,
|  | bool | hidden
| ) |  |
| related

Sets a flag in the geometry input that, when true, will create a hidden face.

Since
  SketchUp 2017, API 5.0

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | face_index | Index of the face to be hidden.
  [in] | hidden | The given hidden flag.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input is not valid
  - SU_ERROR_OUT_OF_RANGE if face_index references a face beyond the total face count of geom_input

enum SUResult SUGeometryInputFaceSetLayer | ( | SUGeometryInputRef | geom_input,
|  | size_t | face_index,
|  | SULayerRef | layer
| ) |  |
| related

Sets the layer of a face in the geometry input.

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | face_index | Index of the face to be reversed.
  [in] | layer | The layer to be set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input or layer is not valid
  - SU_ERROR_OUT_OF_RANGE if face_index references a face beyond the total face count of geom_input

enum SUResult SUGeometryInputFaceSetReverse | ( | SUGeometryInputRef | geom_input,
|  | size_t | face_index,
|  | bool | reverse
| ) |  |
| related

Sets a flag in the geometry input that, when true, will create a face by reversing the orientations of all of its loops.

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | face_index | Index of the face to be reversed.
  [in] | reverse | The given reverse flag.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input is not valid
  - SU_ERROR_OUT_OF_RANGE if face_index references a face beyond the total face count of geom_input

enum SUResult SUGeometryInputGetCounts | ( | SUGeometryInputRef | geom_input,
|  | size_t * | vertices_count,
|  | size_t * | faces_count,
|  | size_t * | edge_count,
|  | size_t * | curve_count,
|  | size_t * | arc_count
| ) |  |
| related

Returns all the various geometry counts.

Since
  SketchUp 2018, API 6.0

Parameters

  [in] | geom_input | The geometry input object.
  [out] | vertices_count | The total count of vertices.
  [out] | faces_count | The total count of faces.
  [out] | edge_count | The total count of edges.
  [out] | curve_count | The total count of curves.
  [out] | arc_count | The total count of arcs.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if vertices_count, faces_count, edge_count, curve_count, or arc_count is NULL

enum SUResult SUGeometryInputRelease | ( | SUGeometryInputRef * | geom_input | ) |
| related

Deallocates a geometry input object.

Parameters

  [in,out] | geom_input | The object to deallocate.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if geom_input is NULL
  - SU_ERROR_INVALID_INPUT if geom_input points to an invalid object

enum SUResult SUGeometryInputSetVertices | ( | SUGeometryInputRef | geom_input,
|  | size_t | num_vertices,
|  | const struct SUPoint3D | points[]
| ) |  |
| related

Sets all vertices of a geometry input object. Any existing vertices will be overridden.

Parameters

  [in,out] | geom_input | The geometry input object.
  [in] | num_vertices | The number of vertices in the given point array.
  [in] | points | The points array containing the location of vertices.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if geom_input is not valid
  - SU_ERROR_NULL_POINTER_INPUT if points is NULL

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

- SketchUpAPI/model/defs.h
- SketchUpAPI/model/geometry_input.h