Can be used to compute the convex hull in 3D space for a given set of points. It is primarily intended for ConvexGeometry.
This Quickhull 3D implementation is a port of quickhull3d by Mauricio Poppe.
ConvexHull is an addon, and must be imported explicitly, see Installation#Addons.
import { ConvexHull } from 'three/addons/math/ConvexHull.js';
Constructs a new convex hull.
Returns true if the given point lies in the convex hull.
point
The point to test.
Returns: Whether the given point lies in the convex hull or not.
Computes the intersections point of the given ray and this convex hull.
ray
The ray to test.
target
The target vector that is used to store the method's result.
Returns: The intersection point. Returns null if not intersection was detected.
Returns true if the given ray intersects with this convex hull.
ray
The ray to test.
Returns: Whether the given ray intersects with this convex hull or not.
Makes the convex hull empty.
Returns: A reference to this convex hull.
Computes the convex hull of the given 3D object (including its descendants), accounting for the world transforms of both the 3D object and its descendants.
object
The 3D object to compute the convex hull for.
Returns: A reference to this convex hull.
Computes to convex hull for the given array of points.
points
The array of points in 3D space.
Returns: A reference to this convex hull.