CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] issues using clip in python driven analysis

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 17, 2017, 12:07
Default issues using clip in python driven analysis
  #1
Member
 
robo
Join Date: May 2013
Posts: 47
Rep Power: 12
robo is on a distinguished road
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!
robo is offline   Reply With Quote

Old   July 18, 2017, 02:19
Default
  #2
Member
 
Swempa's Avatar
 
Join Date: Apr 2015
Posts: 37
Rep Power: 11
Swempa is on a distinguished road
Quote:
Originally Posted by robo View Post
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
Swempa is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pressure driven flow issues at the inlet of a pipe CRI_CFD OpenFOAM Running, Solving & CFD 1 May 25, 2016 13:11
Multigrid Stability Issues ThomasHermann SU2 1 November 5, 2014 16:18
Lid driven flow in shallow rectangular domain issues, MATLAB new_at_this Main CFD Forum 0 November 10, 2011 20:41
Short Course: Computational Thermal Analysis Dean S. Schrage Main CFD Forum 11 September 27, 2000 17:46
Is CFD Science or Art ? John C. Chien Main CFD Forum 36 October 5, 1999 12:58


All times are GMT -4. The time now is 01:00.