Function downsample_point_cloud_voxel

Source
pub fn downsample_point_cloud_voxel<T, O, const N: usize>(
    points: &[Point<T, N>],
    voxel_size: O,
) -> Vec<Point<T, N>> 
Expand description

Downsample a points cloud, returning a new point cloud, with all points within each voxel combined into their mean.

§Arguments

  • points: a slice of Point, representing the point cloud.
  • voxel_size: a floating point number, specifying the size for each voxel, all points inside that voxel will be downsampled to their centroid.

§Generics

  • T: Either an f32 or f64.
  • N: A const usize, representing the number of dimensions in the points.

§Returns

A Vec of Point representing the downsampled point cloud.

§Warnings

  • Point cloud order is never guaranteed.
  • When compiling for no_std, a BTreeMap from the alloc crate is used in place of a HashMap.