pub struct ConvexHull<S: Scalar, const N: usize> {
pub points: Vec<Vector<S, N>>,
}Expand description
A convex hull represented by its defining point set (e.g. the control
points of a NURBS curve or surface), in N-dimensional space.
The hull is never computed explicitly — overlap and containment queries
operate directly on the point set via gjk. By the convex-hull
property of B-spline / NURBS bases, every point on a curve or surface
patch lies within the convex hull of its (dehomogenized) control points.
Fields§
§points: Vec<Vector<S, N>>Implementations§
Source§impl<S: Scalar, const N: usize> ConvexHull<S, N>
impl<S: Scalar, const N: usize> ConvexHull<S, N>
pub fn new(points: Vec<Vector<S, N>>) -> Self
Sourcepub fn centroid(&self) -> Vector<S, N>
pub fn centroid(&self) -> Vector<S, N>
The average of this hull’s defining points — a representative
position for the region it bounds, used e.g. to detect near-duplicate
solutions at a caller-chosen distance tolerance (see
curve_surface_intersect’s dedup check, which can’t rely solely on
could_overlap since that bottoms out in each Scalar’s own
built-in equality tolerance rather than the search’s own epsilon).
Sourcepub fn could_overlap(&self, other: &Self) -> bool
pub fn could_overlap(&self, other: &Self) -> bool
True if self and other could overlap (intersect or touch).
Sourcepub fn definitely_no_overlap(&self, other: &Self) -> bool
pub fn definitely_no_overlap(&self, other: &Self) -> bool
Negation of Self::could_overlap.
Sourcepub fn could_contain(&self, point: &Vector<S, N>) -> bool
pub fn could_contain(&self, point: &Vector<S, N>) -> bool
True if point could lie within this convex hull.
Sourcepub fn definitely_not_contains(&self, point: &Vector<S, N>) -> bool
pub fn definitely_not_contains(&self, point: &Vector<S, N>) -> bool
Negation of Self::could_contain.