Table of Contents

Method FromPoints

Namespace
Box3D
Assembly
Box3D.NET.dll

FromPoints(ReadOnlySpan<Vector3>, int)

Builds the convex hull enclosing a set of points.

public static ConvexHull FromPoints(ReadOnlySpan<Vector3> points, int maxVertexCount = 0)

Parameters

points ReadOnlySpan<Vector3>

The points to enclose.

maxVertexCount int

The vertex budget for the result, or zero for the engine limit. Points beyond it are merged, which simplifies the hull.

Returns

ConvexHull

The hull.

Remarks

Interior points are discarded, so passing a whole mesh is wasteful but harmless. A degenerate cloud, such as coplanar points, has no hull and is rejected.

Exceptions

ArgumentException

points holds fewer than four points, or the engine could not build a hull from them.