[vtkusers] vtkContourFilter

Matthias Allen Meschede matthias.meschede at physik.uni-muenchen.de
Tue Jun 10 09:46:25 EDT 2008


Hi All,
I have a problem with the vtkContourFilter.
I'm reading a structured grid vtk-file which has 4 scalar arrays. If I  
try to use the vtkContourFilter, I only get some small points but no  
surface.
The vtk file is an earth crust model which consists of 4 layers. I'm  
apllying the contour filter on the density which ranges from 1e3 to 3e3.
Surprisingly the ContourFilter in Paraview does the same thing without  
any problem.
If I use SetValue(0,2e3) what's the tolerance in which the  
Contourfilter accepts a point?

Here is my code:

reader1 = vtk.vtkStructuredGridReader()
reader1.SetFileName("europe.vtk")
reader1.SetScalarsName("density")
reader1.Update()

surface = vtk.vtkContourFilter()
surface.SetInput(reader1.GetOutput())
surface.SetValue(0,2e3)
surface.Update()

pointdata = reader1.GetOutput().GetPointData()
drange = pointdata.GetScalars().GetRange()

Mapper = vtk.vtkDataSetMapper()
Mapper.SetInputConnection(surface.GetOutputPort())
Mapper.SetScalarRange(drange)
Mapper.ScalarVisibilityOn()

Thanks for help

Matthias

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the vtkusers mailing list