QuickHullSharp 0.1.0
dotnet add package QuickHullSharp --version 0.1.0
NuGet\Install-Package QuickHullSharp -Version 0.1.0
<PackageReference Include="QuickHullSharp" Version="0.1.0" />
<PackageVersion Include="QuickHullSharp" Version="0.1.0" />
<PackageReference Include="QuickHullSharp" />
paket add QuickHullSharp --version 0.1.0
#r "nuget: QuickHullSharp, 0.1.0"
#:package QuickHullSharp@0.1.0
#addin nuget:?package=QuickHullSharp&version=0.1.0
#tool nuget:?package=QuickHullSharp&version=0.1.0
QuickHullSharp
QuickHullSharp computes the 3D convex hull of a point cloud with the QuickHull algorithm. It is a pure C# port of akuukka/quickhull by Antti Kuukka, which is public domain. The port is released under the MIT license.
Targets netstandard2.0, netstandard2.1, net8.0, and net10.0, so it can be used from .NET Framework 4.6.2+, .NET Core 2.0+, .NET 5+, Unity 2021.2+, and Mono.
Installation
dotnet add package QuickHullSharp
Usage
using System.Numerics;
using QuickHullSharp;
Vector3[] points = /* your point cloud */;
ConvexHull<Vector3> hull = QuickHull.ComputeHull(points);
IReadOnlyList<Vector3> vertices = hull.Vertices; // only the hull vertices
IReadOnlyList<int> indices = hull.Indices; // three indices per triangle
ccw(defaulttrue): whether the triangles are counter-clockwise seen from outside the hull in a left-handed coordinate system, as upstream defines it. Passfalseto get triangles whose right-hand-rule normal(b - a) x (c - a)points out of the hull.useOriginalIndices(defaultfalse): whentrue, the indices refer to the input points andVerticesis a copy of them; otherwiseVerticesholds only the points on the hull.epsilon: minimum distance to a face plane for a point to count as outside it, relative to the scale of the point cloud (default1e-4forVector3input,1e-7for double input). The scale is the largest absolute coordinate, so a point cloud far from the origin keeps less detail: translate it near the origin first. A negative or non-finite value throwsArgumentOutOfRangeException.
Degenerate input (fewer than four points, or coincident, collinear or coplanar points) still yields a closed triangle mesh, which is then flat and can contain zero-area triangles that repeat a vertex index.
Double-precision input
Coordinates can also be given as consecutive (x, y, z) triples of double. The vertices are then
returned as Vector3D. The hull is always computed in double precision.
double[] coordinates = [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1];
ConvexHull<Vector3D> hull = QuickHull.ComputeHullFromCoordinates(coordinates);
ComputeHullAsMeshFromCoordinates is the half edge mesh counterpart. The default epsilon of the
double path (1e-7) is 1000x tighter than the Vector3 default (1e-4), so switching paths changes
the hull size and speed on dense point clouds: pass the same epsilon to both to get comparable results.
Half edge mesh
ComputeHullAsMesh returns the hull as a half edge mesh, which gives quick access to adjacent faces:
HalfEdgeMesh<Vector3> mesh = QuickHull.ComputeHullAsMesh(points);
foreach (Face face in mesh.Faces)
{
HalfEdge edge = mesh.HalfEdges[face.HalfEdgeIndex];
int neighborFace = mesh.HalfEdges[edge.Opp].Face;
}
Credits
Algorithm and original implementation: akuukka/quickhull (public domain).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Memory (>= 4.6.3)
- System.Numerics.Vectors (>= 4.6.1)
-
.NETStandard 2.1
- No dependencies.
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 112 | 11/1/2026 |