Decomposes a polygon of the 3D model into convex polygons.
GSErrCode ACAPI_3D_DecomposePgon ( Int32 ipgon, Int32*** cpoly );
Parameters
- ipgon
- [in] Index of a polygon in the 3D model.
- cpoly
- [out] Points to an array which contains the vertices of subpolygons.
Return Values
NoError
- The function has completed with success.
APIERR_BADPARS
- The passed parameter is
nullptr
;cpoly
APIERR_REFUSEDCMD
- The 3D model is not available in the current context, or
- The polygon type cannot be queried directly; no active body
APIERR_BADINDEX
- The polygon index is out of range
APIERR_MEMFULL
- Not enough memory
For other common API errors see the API Errors document.
Remarks
This function is used to decompose a polygon into convex polygons. The polygon is defined by ipgon
index.
The decomposed polygon is returned in the cpoly
Int32 array, which contains the following values:
[-n], [-m1], i1, i2, ... i(m1), [-m2], j1, j2, ... j(m2)...
where:
- negative values mean some kind of measurement
- positive values mean vertex indices
Parameter |
Descriptions |
---|---|
|
The number of subpolygons |
|
The number of vertices of the following subpolygon |
|
The actual VERT indices of the subpolygons. |
Do not forget to dispose the returned handle if it is not needed any more.
Requirements
- Version: API 1.3 or later
- Header: ACAPinc.h