ConvexHull

Struct ConvexHull 

Source
pub struct ConvexHull {
    pub points: Vec<Point3>,
    pub bounding_planes: Vec<HalfPlane>,
    pub face_indices_start: Vec<u32>,
    pub face_vertex_indices: Vec<u32>,
    pub center: Vec3,
    pub volume: f32,
    pub total_area: f32,
    pub shift_center: Option<Vec3>,
    pub debug: Option<ConvexHullDebugInfo>,
}

Fields§

§points: Vec<Point3>§bounding_planes: Vec<HalfPlane>§face_indices_start: Vec<u32>§face_vertex_indices: Vec<u32>§center: Vec3§volume: f32§total_area: f32§shift_center: Option<Vec3>

The offset vector applied to all points if align-to-center is enabled.

  • If None, align-to-center is disabled, and points remain at their original positions.
  • If Some(Vec3), align-to-center is enabled, and points are shifted by the given vector, meaning the original positions are at pos + shift_center.
§debug: Option<ConvexHullDebugInfo>

Implementations§

Source§

impl<'a> ConvexHull

Source

pub fn get_vertex_indices(&self, face_index: usize) -> &[u32]

Source

pub fn triangle_index_iter(&self) -> impl Iterator<Item = [usize; 3]> + '_

Source

pub fn face_iter(&'a self) -> impl Iterator<Item = &'a [u32]>

Source§

impl ConvexHull

Trait Implementations§

Source§

impl From<ConvexHull> for ConvexHull

Source§

fn from(convex_hull: QuickConvexHull) -> Self

Converts to this type from the input type.

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.