pyvista.DataSetAttributes.active_vectors

pyvista.DataSetAttributes.active_vectors#

property DataSetAttributes.active_vectors: NumpyArray[float] | None[source]#

Return the active vectors as a pyvista_ndarray.

Changed in version 0.32.0: Can no longer be used to set the active vectors. Either use DataSetAttributes.set_vectors() or if the array already exists, assign to pyvista.DataSetAttributes.active_vectors_name.

Returns:
Optional[np.ndarray]

Active vectors as a pyvista_ndarray.

Examples

Associate point data to a simple cube mesh and show that the active vectors in the point array are the most recently added array.

>>> import pyvista as pv
>>> import numpy as np
>>> mesh = pv.Cube()
>>> vectors = np.random.default_rng().random((mesh.n_points, 3))
>>> mesh.point_data.set_vectors(vectors, 'my-vectors')
>>> vectors_out = mesh.point_data.active_vectors
>>> vectors_out.shape
(8, 3)