@Hosam: vtki
objects are instances of VTK objects, so you could save them in the same way you would save any VTK data object.
To make life a bit easier, we have added a .save()
method on each of the objects:
...
# after the code I shared in my previous post
surface.save('my-data.vtk')
Or you could pass that object to a VTK pipeline if you’re more familiar with that:
...
# after the code I shared in my previous post
import vtk
writer = vtk.vtkDataSetWriter()
writer.SetInputDataObject(surface)
writer.SetFileName('my-data.vtk')
writer.Write()