pyvista.vtkmatrix_from_array

pyvista.vtkmatrix_from_array#

vtkmatrix_from_array(array: NumpyArray[float]) _vtk.vtkMatrix3x3 | _vtk.vtkMatrix4x4[source]#

Convert a numpy.ndarray or array-like to a vtk matrix.

Parameters:
arrayarray_like[float]

The array or array-like to be converted to a vtk matrix. Shape (3, 3) gets converted to a vtk.vtkMatrix3x3, shape (4, 4) gets converted to a vtk.vtkMatrix4x4. No other shapes are valid.

Returns:
vtk.vtkMatrix3x3 or vtk.vtkMatrix4x4

VTK matrix.