Skip to content

An implementation in Unity of the Quickhull algorithm for generating 3D convex hulls

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

gabrielaillet/unity-quickhull

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Unity implementation of the Quickhull algorithm for generating 3D convex hulls.

The only file that matters is ConvexHullCalculator.cs in the Scripts folder. It defines a class called ConvexHullCalculator that can calculate 3D convex hulls from a point cloud containing at least 4 points. It returns lists of vertices, triangles and normals suitable to be directly converted into a Mesh (see example).

If there are less than 4 points, or if all points are coplanar, the calculator will throw an exception, as 3D convex hulls aren’t really defined in those cases.

The class uses a number of internal buffers for doing the calculation, but they are all reused for subsequent calculations in order to avoid generating garbage.

You can run the calculator on background threads without issue, but the same calculator cannot be shared by multiple threads. If you want to parallelize hull generation, use one calculator per thread.

About

An implementation in Unity of the Quickhull algorithm for generating 3D convex hulls

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%