[Paraview] Python Cut Problems

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Mar 20 11:48:17 EDT 2008


Try this:
Change the background color to something not-black, say blue,  and then 
play with the clip plane normal. Do you still get the depth issues?

Utkarsh


Kent Eschenberg wrote:
> Thanks, Sylvester, your change also works for me (see attachment). But 
> it seems there is another explanation.
> 
> I modified my example to run in a loop where the cut moves in Z from -1 
> to 1. I expected to see a dot expand to a circle then back to a dot as 
> the cut moves through the sphere.
> 
> Instead the circle "fades" into view around Z=0.2 then changes as 
> expected (i.e., it shrinks) until it is gone at Z=1.
> 
> This looks like a depth-cue phenomena. Sylvester, your test seems to 
> confirm this explanation. Your circle fades into view where it extends 
> forward of Z=0.2.
> 
> Could someone familiar with the default Python internals check whether 
> depth-cue is on by accident? Or tell me how to turn it off?
> 
> Thanks!
> Kent
> Pittsburgh Supercomputing Center
> 
> 
> Sylvester Gerardson wrote:
>> Hi Kent,
>>
>> Can it be that the cut is showing, but is not visible to you because 
>> you are
>> looking at it head on?
>> When I slightly modify your code (cutFunc.Normal) to the version shown
>> below, I can see just a sliver of the cut (using pvpython on OpenSUSE 
>> 10.3).
>>
>>
>> Regards,
>> Sylvester
>>
>> from paraview import servermanager
>> servermanager.Connect()
>> view = servermanager.CreateRenderView()
>> sphere = servermanager.sources.SphereSource()
>> sphere.Radius = 1.0
>> sphere.Center = ( 0.0, 0.0, 0.0 )
>> repr1 = servermanager.CreateRepresentation( sphere, view )
>> implFuncModule = servermanager._createModule( "implicit_functions" )
>> cutFunc = implFuncModule.Plane()
>> cutFunc.Normal = ( 0.0, 1.0, 1.0 )
>> cutFunc.Origin = ( 0.0, 0.0, 0.0 )
>> cut = servermanager.filters.Cut( Input=sphere, CutFunction=cutFunc )
>> cut.ContourValues = [ 0.0 ]
>> repr2 = servermanager.CreateRepresentation( cut, view )
>> repr1.Visibility = 0
>> view.StillRender()
>> view.ResetCamera()
>> view.StillRender()
>>
>>> -----Original Message-----
>>> From: paraview-bounces at paraview.org 
>>> [mailto:paraview-bounces at paraview.org] On Behalf Of Kent Eschenberg
>>> Sent: Wednesday, March 19, 2008 7:44 PM
>>> To: ParaView
>>> Subject: [Paraview] Python Cut Problems
>>>
>>> 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
> 
> ------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview


More information about the ParaView mailing list