|
[Sponsors] |
June 29, 2015, 09:29 |
Clip Filter as Type Cylinder
|
#1 |
New Member
Join Date: Jun 2015
Posts: 3
Rep Power: 11 |
Hello!
I am using ParaView 4.1.0 and I require to apply slices, as well as cuts to my model- but in cylindrical shapes. I went through the forums thoroughly and was able to find programmable filters for the same. The Cylindrical Slice worked, but with a slight modification to cutter.SetInput() -> cutter.SetInputData(). You can see the complete code Code:
#Change 'Output Data Set Type' to vtkPolyData input = self.GetInputDataObject(0, 0) inp_copy = input.NewInstance() inp_copy.ShallowCopy(input) inp_copy.UnRegister(None) cutter = vtk.vtkCutter() transf = vtk.vtkTransform() transf.RotateX(90) cyl = vtk.vtkCylinder() #Define radius and cylinder centre- in the following two lines of code cyl.SetCenter(0,0,0) cyl.SetRadius(0.00375) cyl.SetTransform(transf) cutter.SetCutFunction(cyl) cutter.SetInputData(inp_copy) cutter.Update() self.GetOutputDataObject(0).ShallowCopy(cutter.GetOutputDataObject(0)) Code:
input = self.GetInputDataObject(0, 0) inp_copy = input.NewInstance() inp_copy.ShallowCopy(input) inp_copy.UnRegister(None) transf = vtk.vtkTransform() transf.RotateX(90) cyl = vtk.vtkCylinder() cyl.SetCenter(0,0,0) cyl.SetRadius(0.00375) cyl.SetTransform(transf) clipper = vtk.vtkClipDataSet() clipper.SetClipFunction(cyl) clipper.SetInputData(inp_copy) #clipper.InsideOutOn() clipper.Update() self.GetOutputDataObject(0).ShallowCopy(clipper.GetOutputDataObject(0)) File "<string>", line 22, in <module> File "<string>", line 14, in RequestData AttributeError: 'module' object has no attribute 'vtkClipDataSet' Could someone please explain what is wrong with the Clip Programmable Filter? The link for the original posts by wyldckat : http://www.cfd-online.com/Forums/ope...-cylinder.html http://www.cfd-online.com/Forums/ope...ere-plane.html Would really appreciate a quick reply, thank you in advance! Last edited by wyldckat; August 20, 2015 at 16:40. Reason: Mr.Robot: formal - wyldckat: Added [CODE] markers |
|
August 20, 2015, 16:43 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Mr.Robot,
Sorry for the late reply, but only today did I finally manage to look into this. The problem is that you were missing this line: Code:
import vtk The complete script therefore being this: Code:
import vtk input = self.GetInputDataObject(0, 0) inp_copy = input.NewInstance() inp_copy.ShallowCopy(input) inp_copy.UnRegister(None) transf = vtk.vtkTransform() transf.RotateX(90) cyl = vtk.vtkCylinder() cyl.SetCenter(0,0,0) cyl.SetRadius(0.00375) cyl.SetTransform(transf) clipper = vtk.vtkClipDataSet() clipper.SetClipFunction(cyl) clipper.SetInputData(inp_copy) #clipper.InsideOutOn() clipper.Update() self.GetOutputDataObject(0).ShallowCopy(clipper.GetOutputDataObject(0)) Bruno |
|
Tags |
cut, cylinder, paraview, programmable filter, slice |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with continuity simpleFoam kkl omega airfoils | ibelunatic | OpenFOAM Running, Solving & CFD | 0 | March 20, 2018 12:48 |
Strange high velocity in centrifugal pump simulation | huangxianbei | OpenFOAM Running, Solving & CFD | 26 | August 15, 2014 03:27 |
SimpleFoam - instable simulation | Specialist | OpenFOAM Running, Solving & CFD | 17 | August 12, 2014 05:52 |
interFoam/kOmegaSST tank filling with printStackError/Mules | simpomann | OpenFOAM Running, Solving & CFD | 3 | February 17, 2014 18:06 |
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) | cfdonline2mohsen | OpenFOAM | 3 | October 21, 2013 10:28 |