sisetrun |
January 30, 2017 12:57 |
Python Shell Clipping
3 Attachment(s)
Hello everybody,
I am working with Paraview 5.1.2 at the moment.
I traced a script to perform some clips.
1. Divide a tubular lattice in a disk (disk.png)
2. Cut out a box from this disk (pic2.png)
The problem is: I do not see pic2, I see pic1.
When i move the cursor over the GUI or when I klick on clip3 (see code; this is the Box clip), the animation changes to pic2.
Code:
from paraview.simple import *
#read file
fixstl = STLReader(FileNames=['/home/fix.stl'])
#1st clip tube
clip1 = Clip(Input=fixstl)
clip1.ClipType = 'Plane'
clip1.ClipType.Origin = [0.0, 0.0, 0.0]
clip1.ClipType.Normal = [0.0, 0.0, 1.0]
#2nd clip tube
clip2 = Clip(Input=clip1)
clip2.ClipType = 'Plane'
clip2.ClipType.Normal = [0.0, 0.0, -1.0]
clip2.ClipType.Origin = [0.0, 0.0, 0.005]
#clip out a element
clip3 = Clip(Input=clip2)
clip3.ClipType = 'Box'
clip3.ClipType.Scale = [0.25, 0.25, 1.0]
clip3.InsideOut = 1
clip3.ClipType.Position = [0,0,0]
#extract the surface
extractSurface1 = ExtractSurface(Input=clip3)
#triangulate
triangulate1 = Triangulate(Input=extractSurface1)
Show()
Could anybody give me a hint what I am doing wrong so far?
I would like to run the script within a for loop to go through many Box-positions.
Thank you so much
Best regards
|