VertexClusterer3

Struct VertexClusterer3 

Source
pub struct VertexClusterer3 { /* private fields */ }
Expand description

A simple VertexClusterer that samples a range of values into a number of bins.

Implementations§

Source§

impl VertexClusterer3

Source

pub fn new( vertices: Vec<[f64; 3]>, weights: Option<Vec<f64>>, bin_size: f64, ) -> Self

Create a VertexClusterer3 from a list of vertices.

Source

pub fn bin_size(&self) -> f64

Get the bin size.

Source

pub fn get_bin( &self, x_idx: usize, y_idx: usize, z_idx: usize, ) -> Option<&Vec<([f64; 3], f64)>>

Get the bin at the given position.

(0, 0, 0) is the bottom left bin.

Source

pub fn get_bin_mean( &self, x_idx: usize, y_idx: usize, z_idx: usize, ) -> Option<([f64; 3], f64)>

Get the mean of the bin at the given position.

Source

pub fn num_bins(&self) -> usize

Get the number of bins.

Source

pub fn num_bins_x(&self) -> usize

Get the number of bins in the x-direction.

Source

pub fn num_bins_y(&self) -> usize

Get the number of bins in the y-direction.

Source

pub fn num_bins_z(&self) -> usize

Get the number of bins in the z-direction.

Source

pub fn simplify(&self) -> (Vec<[f64; 3]>, Vec<f64>)

Simplifies the clustered point cloud, i.e. returns the mean of each bin.

Source

pub fn vertices(&self) -> Vec<&([f64; 3], f64)>

Get all vertices in the bins.

Trait Implementations§

Source§

impl Display for VertexClusterer3

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for VertexClusterer3

Source§

fn eq(&self, other: &VertexClusterer3) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for VertexClusterer3

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.