VTK Polydata

[1]:
import k3d
import os
import vtk

from k3d.helpers import download

filename = download('https://raw.githubusercontent.com/' +
                    'naucoin/VTKData/master/Data/cow.vtp')

model_matrix = (
     1.0,  0.0, 0.0, 0.0,
     0.0,  0.0, 1.0, 0.0,
     0.0,  1.0, 0.0, 0.0,
     0.0,  0.0, 0.0, 1.0
)

reader = vtk.vtkXMLPolyDataReader()
reader.SetFileName(filename)
reader.Update()

plot = k3d.plot()
cow3d = k3d.vtk_poly_data(reader.GetOutput(), color=0xff0000,
                          model_matrix=model_matrix)
plot += cow3d
plot.display()
[ ]: