CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [General] issues using clip in python driven analysis (https://www.cfd-online.com/Forums/paraview/190586-issues-using-clip-python-driven-analysis.html)

robo July 17, 2017 12:07

issues using clip in python driven analysis
 
Hey all, hopefully this is a simple question. I have a python script that includes a clip in my pipeline, using the code
Code:

c1 = pv.Clip(Input=fieldReader)
c1.ClipType = 'Box'
c1.InsideOut = 1
c1.ClipType.Scale = [xs,ys,zs]
pv.UpdatePipeline()

however, when I run this script, the resulting box is dramatically smaller then I specified. If I then manually hit 'apply' again, the box becomes the size I want. I'm unclear on why this is happening and how to fix it, and would welcome any advice. Also, if anyone is aware of any good resources for helping with python scripting, I would really appreciate it.
Thanks!

Swempa July 18, 2017 02:19

Quote:

Originally Posted by robo (Post 657406)
Hey all, hopefully this is a simple question. I have a python script that includes a clip in my pipeline, using the code
Code:

c1 = pv.Clip(Input=fieldReader)
c1.ClipType = 'Box'
c1.InsideOut = 1
c1.ClipType.Scale = [xs,ys,zs]
pv.UpdatePipeline()

however, when I run this script, the resulting box is dramatically smaller then I specified. If I then manually hit 'apply' again, the box becomes the size I want. I'm unclear on why this is happening and how to fix it, and would welcome any advice. Also, if anyone is aware of any good resources for helping with python scripting, I would really appreciate it.
Thanks!

Hi robo,

Maybe you can try to add the "bounds" and "position" definition of the clip before the "scale" command to control the limits of the clip?

Code:

c1 = pv.Clip(Input=fieldReader)
c1.ClipType = 'Box'
c1.InsideOut = 1
c1.ClipType.Bounds = [xb1,yb1,zb1,xb2,yb2,zb2]
c1.ClipType.Position = [xp,yp,zp]
c1.ClipType.Scale = [xs,ys,zs]
pv.UpdatePipeline()

Good luck!

Cheers


All times are GMT -4. The time now is 11:16.