pub struct PointCloud { /* private fields */ }Expand description
An ordered set of 3D points with optional per-point channels.
Order is meaningful: it is the caller’s, and every channel is indexed by it. Operations that reorder points must say so, because a consumer holding a parallel array outside the cloud would otherwise be silently desynchronised.
Implementations§
Source§impl PointCloud
impl PointCloud
Sourcepub fn new(points: Vec<DVec3>) -> Result<PointCloud, PointCloudError>
pub fn new(points: Vec<DVec3>) -> Result<PointCloud, PointCloudError>
A cloud of positions, with no attributes.
§Errors
Refuses a non-finite coordinate, naming the offending index.
Sourcepub fn empty() -> PointCloud
pub fn empty() -> PointCloud
An empty cloud.
Legitimate rather than exceptional: a query that filters everything
out should return an empty cloud, not an error. Consumers that need
points must check is_empty themselves.
Sourcepub fn with_normals(
self,
normals: Vec<DVec3>,
) -> Result<PointCloud, PointCloudError>
pub fn with_normals( self, normals: Vec<DVec3>, ) -> Result<PointCloud, PointCloudError>
Attach per-point normals.
§Errors
Refuses a length mismatch, and a normal that is non-finite or too short to carry a direction.
Sourcepub fn with_colours(
self,
colours: Vec<Colour>,
) -> Result<PointCloud, PointCloudError>
pub fn with_colours( self, colours: Vec<Colour>, ) -> Result<PointCloud, PointCloudError>
Attach per-point colours.
§Errors
Refuses a length mismatch. Colour channels cannot be individually invalid, since every 8-bit value is meaningful.
Sourcepub fn with_intensities(
self,
intensities: Vec<f64>,
) -> Result<PointCloud, PointCloudError>
pub fn with_intensities( self, intensities: Vec<f64>, ) -> Result<PointCloud, PointCloudError>
Attach per-point intensities.
§Errors
Refuses a length mismatch and a non-finite intensity. The range is not constrained: sensors report intensity on their own scale, and normalising it here would discard information the caller may need.
Sourcepub fn intensities(&self) -> Option<&[f64]>
pub fn intensities(&self) -> Option<&[f64]>
Per-point intensities, if the cloud carries them.
Sourcepub fn has_normals(&self) -> bool
pub fn has_normals(&self) -> bool
Whether every point carries a normal.
Reconstruction algorithms differ sharply on this: Poisson needs oriented normals, ball pivoting does not. Asking is cheaper than discovering it mid-operation.
Trait Implementations§
Source§impl Clone for PointCloud
impl Clone for PointCloud
Source§fn clone(&self) -> PointCloud
fn clone(&self) -> PointCloud
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PointCloud
impl Debug for PointCloud
Source§impl Default for PointCloud
impl Default for PointCloud
Source§fn default() -> PointCloud
fn default() -> PointCloud
Source§impl PartialEq for PointCloud
impl PartialEq for PointCloud
impl StructuralPartialEq for PointCloud
Auto Trait Implementations§
impl Freeze for PointCloud
impl RefUnwindSafe for PointCloud
impl Send for PointCloud
impl Sync for PointCloud
impl Unpin for PointCloud
impl UnwindSafe for PointCloud
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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