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<Point3>) -> Result<Self, PointCloudError>
pub fn new(points: Vec<Point3>) -> Result<Self, PointCloudError>
A cloud of positions, with no attributes.
§Errors
Refuses a non-finite coordinate, naming the offending index.
Sourcepub fn empty() -> Self
pub fn empty() -> Self
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<Vec3>) -> Result<Self, PointCloudError>
pub fn with_normals(self, normals: Vec<Vec3>) -> Result<Self, 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<Self, PointCloudError>
pub fn with_colours(self, colours: Vec<Colour>) -> Result<Self, 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<Scalar>,
) -> Result<Self, PointCloudError>
pub fn with_intensities( self, intensities: Vec<Scalar>, ) -> Result<Self, 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<&[Scalar]>
pub fn intensities(&self) -> Option<&[Scalar]>
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 more