spkit.io.write_vtk

spkit.io.write_vtk(filename, vertices, faces)

Writes .vtk file format for the Paraview (Kitware (c)) visualisation software.

It relies on the VTK library for its writer. VTK files use the legagy ASCII file format of the VTK library.

Parameters:
filename: str
  • name of the mesh file to be written on disk

vertices: ndarray
  • numpy array of the coordinates of the mesh’s nodes

faces: ndarray
  • numpy array of the faces’ nodes connectivities

Examples

>>> import numpy as np
>>> import spkit as sp
>>> V = np.random.randn([100,3])
>>> F = (np.random.randn([100,3])*100).astype(int)
>>> file_name = 'full_accessible_path/to_vtk_file.vtk'
>>> sp.io.read_vtk(file_name, vertices= V, faces=F)