[Paraview] Python Cut Problems

Kent Eschenberg eschenbe at psc.edu
Wed Mar 19 14:44:24 EDT 2008


I cannot seem to get the cut function to work and came up with the simplest test case I could imagine:

======
from paraview import servermanager
servermanager.Connect()
implFuncModule = servermanager._createModule( "implicit_functions" )
sphere = servermanager.sources.SphereSource()
sphere.Radius = 1.0
sphere.Center = ( 0.0, 0.0, 0.0 )
cutFunc = implFuncModule.Plane()
cutFunc.Normal = ( 0.0, 0.0, 1.0 )
cutFunc.Origin = ( 0.0, 0.0, 0.0 )
cut = servermanager.filters.Cut( Input=sphere, CutFunction=cutFunc )
cut.ContourValues = [ 0.0 ]
view = servermanager.CreateRenderView()
if( raw_input("Enter 0/1 for cut/sphere: ") == "0" ):
    repr = servermanager.CreateRepresentation( cut, view )
else:
    repr = servermanager.CreateRepresentation( sphere, view )
view.StillRender()
view.ResetCamera()
view.StillRender()
reply = raw_input("Do you have a dead parrot? ")
======

The sphere always appears; the cut never does. I'm using pvpython 3.2.1 on CentOS 5. I hope someone can spot what I am doing wrong.

TIA!
Kent
Pittsburgh Supercomputing Center


More information about the ParaView mailing list