PointCloud

Struct PointCloud 

Source
pub struct PointCloud<P: Point> { /* private fields */ }
Expand description

Main point cloud container that owns point data

This structure provides ownership-based point cloud management with efficient parallel processing capabilities.

Implementations§

Source§

impl<P: Point> PointCloud<P>

Source

pub fn new() -> Self

Create a new empty point cloud

Source

pub fn from_points(points: Vec<P>) -> Self

Create a point cloud from a vector of points

Source

pub fn with_capacity(capacity: usize) -> Self

Create a point cloud with specified capacity

Source

pub fn from_points_and_metadata(points: Vec<P>, metadata: Metadata) -> Self

Create a point cloud from points and metadata

Source

pub fn len(&self) -> usize

Get the number of points

Source

pub fn is_empty(&self) -> bool

Check if the point cloud is empty

Source

pub fn points(&self) -> &[P]

Get a reference to the points vector

Source

pub fn points_mut(&mut self) -> &mut Vec<P>

Get a mutable reference to the points vector

Source

pub fn metadata(&self) -> &Metadata

Get a reference to the metadata

Source

pub fn metadata_mut(&mut self) -> &mut Metadata

Get a mutable reference to the metadata

Source

pub fn push(&mut self, point: P)

Add a point to the cloud

Source

pub fn extend<I>(&mut self, points: I)
where I: IntoIterator<Item = P>,

Add multiple points to the cloud

Source

pub fn get(&self, index: usize) -> Option<&P>

Get a point by index

Source

pub fn get_mut(&mut self, index: usize) -> Option<&mut P>

Get a mutable reference to a point by index

Source

pub fn remove(&mut self, index: usize) -> P

Remove a point by index

Source

pub fn clear(&mut self)

Clear all points

Source

pub fn reserve(&mut self, additional: usize)

Reserve capacity for additional points

Source

pub fn shrink_to_fit(&mut self)

Shrink the capacity to fit the current number of points

Source

pub fn iter(&self) -> Iter<'_, P>

Create an iterator over the points

Source

pub fn iter_mut(&mut self) -> IterMut<'_, P>

Create a mutable iterator over the points

Source

pub fn par_iter(&self) -> Iter<'_, P>

Create a parallel iterator over the points

Source

pub fn par_iter_mut(&mut self) -> IterMut<'_, P>

Create a parallel mutable iterator over the points

Source

pub fn filter<F>(self, predicate: F) -> Self
where F: Fn(&P) -> bool + Send + Sync,

Filter points based on a predicate

Source

pub fn map<F, Q>(self, mapper: F) -> PointCloud<Q>
where F: Fn(P) -> Q + Send + Sync, Q: Point,

Transform points using a mapping function

Source

pub fn bounding_box(&self) -> Option<([f32; 3], [f32; 3])>

Calculate the bounding box of the point cloud

Source

pub fn centroid(&self) -> Option<[f32; 3]>

Calculate the centroid of the point cloud

Source

pub fn crop(self, min_bounds: [f32; 3], max_bounds: [f32; 3]) -> Self

Crop the point cloud to a bounding box

Source

pub fn into_shared(self) -> Arc<Self>

Convert to shared ownership using Arc

Trait Implementations§

Source§

impl<P: Clone + Point> Clone for PointCloud<P>

Source§

fn clone(&self) -> PointCloud<P>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<P: Debug + Point> Debug for PointCloud<P>

Source§

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

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

impl<P: Point> Default for PointCloud<P>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de, P> Deserialize<'de> for PointCloud<P>
where P: Deserialize<'de> + Point,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<P: Point> FeatureExt<P> for PointCloud<P>

Source§

fn estimate_normals(&self, search_radius: f32) -> Result<Vec<[f32; 3]>>

Estimate surface normals
Source§

impl<P: Point> FilterExt<P> for PointCloud<P>

Source§

fn voxel_downsample(self, voxel_size: f32) -> PointCloud<P>

Apply voxel downsampling
Source§

fn remove_outliers( self, k_neighbors: usize, std_dev_threshold: f32, ) -> Result<PointCloud<P>>

Remove statistical outliers
Source§

fn remove_radius_outliers( self, radius: f32, min_neighbors: usize, ) -> PointCloud<P>

Remove radius outliers
Source§

fn pass_through( self, axis: Axis, min_value: f32, max_value: f32, ) -> PointCloud<P>

Apply pass-through filter
Source§

impl<P: Point> FromIterator<P> for PointCloud<P>

Source§

fn from_iter<I: IntoIterator<Item = P>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a, P: Point> IntoIterator for &'a PointCloud<P>

Source§

type Item = &'a P

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, P>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, P: Point> IntoIterator for &'a mut PointCloud<P>

Source§

type Item = &'a mut P

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, P>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<P: Point> IntoIterator for PointCloud<P>

Source§

type Item = P

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<P>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<P: Point> RegistrationExt<P> for PointCloud<P>

Source§

fn icp_register( &self, target: &PointCloud<P>, max_iterations: usize, tolerance: f32, ) -> Result<Transform>

Perform ICP registration with another point cloud
Source§

fn transform(self, transform: &Transform) -> PointCloud<P>

Apply transformation to the point cloud
Source§

impl<P: Point> SegmentationExt<P> for PointCloud<P>

Source§

fn euclidean_cluster( &self, tolerance: f32, min_size: usize, max_size: usize, ) -> Vec<Vec<usize>>

Perform Euclidean clustering
Source§

fn ransac_plane( &self, distance_threshold: f32, max_iterations: usize, ) -> Result<(Vec<usize>, [f32; 4])>

Perform RANSAC plane segmentation
Source§

impl<P> Serialize for PointCloud<P>
where P: Serialize + Point,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<P> Freeze for PointCloud<P>

§

impl<P> RefUnwindSafe for PointCloud<P>
where P: RefUnwindSafe,

§

impl<P> Send for PointCloud<P>

§

impl<P> Sync for PointCloud<P>

§

impl<P> Unpin for PointCloud<P>
where P: Unpin,

§

impl<P> UnwindSafe for PointCloud<P>
where P: UnwindSafe,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,