FusedPointCloud Class Reference

Class representing a fused point cloud and containing the geometric and color data of the scene captured by the spatial mapping module. More...

Functions

list[PointCloudChunkchunks (self)
 List of chunks constituting the sl.FusedPointCloud.
 
PointCloudChunk __getitem__ (self, x)
 Gets a chunk from chunks.
 
np.array[float] vertices (self)
 NumPy array of vertices. More...
 
np.array[float] normals (self)
 NumPy array of normals. More...
 
bool save (self, str filename, typeMesh=MESH_FILE_FORMAT.OBJ, id=[])
 Saves the current sl.FusedPointCloud into a file. More...
 
bool load (self, str filename, update_chunk_only=False)
 Loads the fused point cloud from a file. More...
 
None clear (self)
 Clears all the data.
 
None update_from_chunklist (self, id=[])
 Updates vertices and normals from chunk data pointed by the given list of id. More...
 
int get_number_of_points (self)
 Computes the total number of points stored in all chunks. More...
 

Detailed Description

Class representing a fused point cloud and containing the geometric and color data of the scene captured by the spatial mapping module.

By default the fused point cloud is defined as a set of point cloud chunks.
This way we update only the required data, avoiding a time consuming remapping process every time a small part of the sl.FusedPointCloud cloud is changed.

Functions

◆ vertices()

np.array[float] vertices (   self)

NumPy array of vertices.

Vertices are defined by a colored 3D point [x, y, z, rgba].

◆ normals()

np.array[float] normals (   self)

NumPy array of normals.

Normals are defined by three components [nx, ny, nz].

Note
A normal is defined for each vertex.

◆ save()

bool save (   self,
str  filename,
  typeMesh = MESH_FILE_FORMAT.OBJ,
  id = [] 
)

Saves the current sl.FusedPointCloud into a file.

Parameters
filename: Path of the file to store the fused point cloud in.
typeMesh: File extension type. Default: sl.MESH_FILE_FORMAT.OBJ.
id: Set of chunks to be saved. Default: (empty) (all chunks are saved)
Returns
True if the file was successfully saved, otherwise False.
Note
This method operates on the sl.FusedPointCloud not on chunks.
This way you can save different parts of your sl.FusedPointCloud by updating it with update_from_chunklist().

◆ load()

bool load (   self,
str  filename,
  update_chunk_only = False 
)

Loads the fused point cloud from a file.

Parameters
filename: Path of the file to load the fused point cloud from.
update_chunk_only: Whether to only load data in chunks (and not vertices / normals).
Default: False.
Returns
True if the mesh was successfully loaded, otherwise False.
Note
Updating a sl.FusedPointCloud is time consuming. Consider using only chunks for better performances.

◆ update_from_chunklist()

None update_from_chunklist (   self,
  id = [] 
)

Updates vertices and normals from chunk data pointed by the given list of id.

Parameters
id: Indices of chunks which will be concatenated. Default: (empty).
Note
If the given list of id is empty, all chunks will be used to update the current sl.FusedPointCloud.

◆ get_number_of_points()

int get_number_of_points (   self)

Computes the total number of points stored in all chunks.

Returns
The number of points stored in all chunks.