pysdic.PointCloud.set_property#

PointCloud.set_property(key, values)[source]#

Set a property for the point cloud as a NumPy array of shape \((N_p, A)\) where \(A\) is the number of attributes per point for the given property.

Note

The given array will be copied and stored as type numpy.float64.

Note

The property can also be set using dictionary-like syntax:

1point_cloud['property_key'] = property_values
Parameters:
  • key (str) – The key/name of the property to set.

  • values (ArrayLike) – A NumPy array of shape \((N_p, A)\) or \((N_p,)\) representing the property values for each point in the cloud. If 1D array is provided, it will be reshaped to \((N_p, 1)\).

Raises:
  • TypeError – If the property key is not a string. If the input values is not a NumPy array.

  • ValueError – If the input array does not have the correct shape \((N_p, A)\) or \((N_p,)\).

Return type:

None

Examples

Set a property for 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)