ConvexHullUtilities
Helpers around the native convex hull solver that let a running solution be cancelled. This mirrors Mesh.CreateConvexHull3D(IEnumerable<Point3d>, int[][], double, double) but polls a CancellationToken while the hull is being built.
Methods
CreateConvexHull3D
#Computes the 3d convex hull of a point set, aborting early if
token is cancelled.public static Mesh CreateConvexHull3D()
points,
The points to include in the hull.
hullFacets,
On return, one entry per facet holding the indices (into
points) that make up that facet. Set to the empty jagged array when the result is null.tolerance,
The tolerance used to decide if points are coplanar or not. Use the document's tolerance if in doubt.
angleTolerance,
The angle tolerance used for merging coplanar points into facets. Use the document's angle tolerance in radians if in doubt.
weld,
If true the returned mesh shares its hull-corner vertices; if false it is fully unwelded (each facet keeps its own vertices). Either way
hullFacets holds input-point indices.token
Cancellation token. When cancelled, the solver stops and this method returns null.
Returns: A valid mesh if successful; null on too few / coplanar input, or if cancellation was requested.