ConvexHullUtilities

public static class 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

#
public static Mesh CreateConvexHull3D(IEnumerable<Point3d> points, out int[][] hullFacets, double tolerance, double angleTolerance, bool weld, CancellationToken token)
Computes the 3d convex hull of a point set, aborting early if token is cancelled.
points (IEnumerable<Point3d>)The points to include in the hull.
hullFacets (out int[][])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 (double)The tolerance used to decide if points are coplanar or not. Use the document's tolerance if in doubt.
angleTolerance (double)The angle tolerance used for merging coplanar points into facets. Use the document's angle tolerance in radians if in doubt.
weld (bool)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 (CancellationToken)Cancellation token. When cancelled, the solver stops and this method returns null.
A valid mesh if successful; null on too few / coplanar input, or if cancellation was requested.