Skip to main content

ConvexHullNd

Struct ConvexHullNd 

Source
#[non_exhaustive]
pub struct ConvexHullNd { pub points: Vec<Vec<f64>>, pub simplices: Vec<Vec<usize>>, pub equations: Vec<Vec<f64>>, pub neighbors: Vec<Vec<usize>>, pub vertices: Vec<usize>, pub facet_groups: Vec<Vec<usize>>, pub volume: f64, pub area: f64, /* private fields */ }
Expand description

The convex hull of points in any dimension d ≥ 2 (SciPy’s ConvexHull), with simplicial facets. Points within a small tolerance of a facet are treated as inside.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§points: Vec<Vec<f64>>§simplices: Vec<Vec<usize>>

Each facet as d point indices (SciPy’s simplices).

§equations: Vec<Vec<f64>>

Each facet’s hyperplane [n, b] with outward unit normal n and n·x + b ≤ 0 inside (SciPy’s equations).

§neighbors: Vec<Vec<usize>>

For each facet, the facets across the ridges opposite each of its vertices.

§vertices: Vec<usize>

The hull’s vertices, sorted (SciPy’s vertices is in counter-clockwise order in 2-D).

§facet_groups: Vec<Vec<usize>>

The hull’s facets as Qhull sees them after merging: for each facet of the polytope (all the coplanar pieces of a cube’s face, say), the indices into simplices of the simplices that triangulate it. A facet that is already a simplex has one entry.

§volume: f64

The d-volume enclosed and the (d − 1)-volume of the boundary.

§area: f64

Implementations§

Source§

impl ConvexHullNd

Source

pub fn new(points: &[Vec<f64>]) -> Result<ConvexHullNd, ErrorsJSL>

Source

pub fn with_options( points: &[Vec<f64>], options: &QhullOptions, ) -> Result<ConvexHullNd, ErrorsJSL>

As ConvexHullNd::new with Qhull-style options (see QhullOptions).

Source

pub fn add_points(&mut self, new: &[Vec<f64>]) -> Result<(), ErrorsJSL>

Adds points (SciPy’s add_points): the new points get the next indices. The hull is grown from its current state, as Quickhull does: only the new points that lie outside it are added, each replacing the facets it sees, and nothing is recomputed for the rest. The hull is that of the union (the order of the simplices may differ from a fresh computation).

Trait Implementations§

Source§

impl Clone for ConvexHullNd

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConvexHullNd

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSerialize for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.