About
The maxon::ConvexHullInterface allows to compute a convex polygon hull that encapsulates a given set of points in 3D space.
ConvexHullInterface
The maxon::ConvexHullInterface class provides only one function that can either accept a maxon::ConvexHullData argument or several arrays:
The maxon::ConvexHullData structure contains these members:
const maxon::ConvexHullRef convexHull = maxon::ConvexHullRef::Create()
iferr_return;
maxon::ConvexHullData hullData;
if (res < 0)
if (polyObject == nullptr)
CPolygon* const polygons = polyObject->GetPolygonW();
const
maxon::ConvEdge* lastEdge;
for (
Int32 faceIndex = 0; faceIndex < polyCount; faceIndex++)
{
const maxon::ConvEdge* currentEdge = &hullData.edges[hullData.faces[faceIndex]];
lastEdge = currentEdge;
for (currentEdge = &hullData.edges[lastEdge->_nextEdgeOfFace];
&hullData.edges[currentEdge->
_nextEdgeOfFace] != &hullData.edges[hullData.faces[faceIndex]];
{
polyCounter++;
lastEdge = currentEdge;
}
}
Vector*
const polyPoints = polyObject->GetPointW();
for (
Int32 pointIndex = 0; pointIndex < vertexCount; pointIndex++)
polyPoints[pointIndex] = hullData.vertices[pointIndex];
doc->InsertObject(polyObject, nullptr, nullptr);
Further Reading