pysdic.PointCloud.get_property#
- PointCloud.get_property(key)[source]#
Get a property of the point cloud by its key/name.
Note
The returned array is a unwritable view to prevent accidental modifications and is of type
numpy.float64.Note
The property can also be accessed using dictionary-like syntax:
1property_values = point_cloud['property_key']
- Parameters:
key (
str) – The key/name of the property to retrieve.- Returns:
A NumPy array of shape \((N_p, A)\) representing the property values for each point in the cloud.
- Return type:
- Raises:
KeyError – If the property with the given key does not exist.
Examples
Get a property of the point cloud.
1import numpy 2from pysdic import PointCloud 3 4pc = PointCloud.from_array(numpy.random.rand(100, 3)) 5intensity = numpy.random.rand(100) 6pc.set_property('intensity', intensity) 7retrieved_intensity = pc.get_property('intensity')