Utilities
matengine.utils.plotting
- matengine.utils.plotting.array_to_vtk(arr, fname='array_out')[source]
Save a 2D or 3D array as a VTK file for visualisation using PyVista.
- Parameters:
- arr: numpy.ndarray
The array to be saved as a VTK file. Can be 2D or 3D.
- fname: str, optional
The name of the output VTK file (without extension). Default is ‘array_out’.
- Notes:
For 2D arrays, the function creates a structured grid with zero height (z-dimension).
For 3D arrays, the function directly wraps the array as a PyVista grid.