pub struct PointCloud {
pub positions: Vec<Vec3>,
pub colors: Option<Vec<[f32; 3]>>,
}Expand description
Decoded points of one node, in the node’s local coordinates.
Fields§
§positions: Vec<Vec3>Point positions.
colors: Option<Vec<[f32; 3]>>One linear RGB colour in 0..=1 per position, when the source has
colours.
Implementations§
Source§impl PointCloud
impl PointCloud
Sourcepub fn from_attributes<A: Attributes + ?Sized>(
attributes: &A,
) -> Result<Option<Self>, DecodeError>
pub fn from_attributes<A: Attributes + ?Sized>( attributes: &A, ) -> Result<Option<Self>, DecodeError>
Decodes the node’s point cloud, or None when it has no point-cloud
attribute. With several, pcd::base64 wins over points::array, which
wins over points::base64, as in the upstream viewer.
Sourcepub fn from_points_array(value: &Value) -> Result<Self, DecodeError>
pub fn from_points_array(value: &Value) -> Result<Self, DecodeError>
Decodes a points::array value:
{"positions": [[x, y, z], …], "colors": [[r, g, b], …]} with
colors optional.
Sourcepub fn from_points_base64(value: &Value) -> Result<Self, DecodeError>
pub fn from_points_base64(value: &Value) -> Result<Self, DecodeError>
Decodes a points::base64 value:
{"positions": "<base64>", "colors": "<base64>"} with colors
optional. Each string holds little-endian f32 triples back to back.
Sourcepub fn from_pcd_base64(value: &Value) -> Result<Self, DecodeError>
pub fn from_pcd_base64(value: &Value) -> Result<Self, DecodeError>
Decodes a pcd::base64 value: a string holding a base64-encoded
PCD file. See PointCloud::from_pcd.
Sourcepub fn from_pcd(bytes: &[u8]) -> Result<Self, DecodeError>
pub fn from_pcd(bytes: &[u8]) -> Result<Self, DecodeError>
Reads a PCD v0.7 file the way three.js PCDLoader r171 does.
DATA ascii,binary(row-major), andbinary_compressed(LZF, column-major) are read. OtherDATAvalues areDecodeError::UnsupportedPcd.x,y,zare required. In binary data they must beSIZE 4,TYPE F,COUNT 1, the only layout the loader reads correctly.rgbis optional, packed as0x00RRGGBBin four bytes, and converted from sRGB to linear. In ASCII data aTYPE Fvalue is reinterpreted bit for bit, as PCL writes it.- Other fields (normals, intensity, label, …) are skipped.
- Multi-byte binary values are little-endian.
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