Capítulo 529 de 859

Chapter 529: ConvexHull

Core Idea

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.

Code Examples

import { ConvexHull } from 'three/addons/math/ConvexHull.js';
  • What it demonstrates: Typical usage of ConvexHull.

Reference Tables

Constructor

Signature
new ConvexHull()

Methods

MethodDescription
.containsPoint( point : Vector3 ) : booleanReturns true if the given point lies in the convex hull.
.intersectRay( ray : Ray, target : Vector3 ) : Vector3Computes the intersections point of the given ray and this convex hull.
.intersectsRay( ray : Ray ) : booleanReturns true if the given ray intersects with this convex hull.
.makeEmpty() : ConvexHullMakes the convex hull empty.
.setFromObject( object : Object3D ) : ConvexHullComputes the convex hull of the given 3D object (including its descendants), accounting for the world transforms of both the 3D object and its descendants.
.setFromPoints( points : Array.<Vector3> ) : ConvexHullComputes to convex hull for the given array of points.

Key Takeaways

  1. Key methods: containsPoint, intersectRay, intersectsRay, makeEmpty.

Connects To