[vtkusers] vtkSurfaceLICPainter

Andre Zimmer andre.zimmer at rwth-aachen.de
Thu Nov 10 04:49:28 EST 2016


Hi,
I would like to use surfaceLIC like I do in Paraview but using VTK 6.3 
in Python 2.7.
After a lot of research I have found nothing useful other than that I 
probably need to somehow use vtkSurfaceLICPainter. Here is a test case 
and a small script that loads the velocity field of a VTK file generated 
by OpenFOAM:
https://www.dropbox.com/s/5bhic1ms0anzrno/U_nearWalls.vtk?dl=0


#!
import vtk
file_name = "U_nearWalls.vtk"

reader = vtk.vtkPolyDataReader()
reader.SetFileName(file_name)
reader.ReadAllScalarsOn()
reader.ReadAllVectorsOn()
reader.Update()
reader.GetOutput().GetPointData().SetActiveScalars("U")
mapper=vtk.vtkPolyDataMapper()
mapper.SetInputConnection(reader.GetOutputPort())
mapper.SetScalarRange(reader.GetOutput().GetPointData().GetScalars().GetRange())
actor=vtk.vtkActor()
actor.SetMapper(mapper)

renderer = vtk.vtkRenderer()
renderer.AddActor(actor)
renderer.SetBackground(0.1, 0.2, 0.4)
render_window = vtk.vtkRenderWindow()
render_window.AddRenderer(renderer)
render_window.SetSize(300, 300)
interactor = vtk.vtkRenderWindowInteractor()
interactor.SetRenderWindow(render_window)

interactor.Initialize()
render_window.Render()
interactor.Start()


Thank you,
André





More information about the vtkusers mailing list