|
[Sponsors] |
October 15, 2019, 16:21 |
Clip by an stl file
|
#1 |
Member
Join Date: May 2017
Posts: 41
Rep Power: 9 |
Hello everyone,
is possible to clip my data using an STL file? At the moment, I am using a programmable filter with a cylinder but I would like to replace the cylinder with an STL file or any other format that allows me to use an arbitrary geometry for clipping my original data. 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.05,0,-0) cyl.SetRadius(0.0095) cyl.SetTransform(transf) clipper = vtk.vtkClipDataSet() clipper.SetClipFunction(cyl) clipper.SetInputData(inp_copy) clipper.Update() self.GetOutputDataObject(0).ShallowCopy(clipper.GetOutputDataObject(0)) Ryan |
|
October 16, 2019, 08:56 |
|
#2 |
Senior Member
Carlo_P
Join Date: May 2019
Location: Italy
Posts: 176
Rep Power: 8 |
You can use a sampleDict file in openFOAM.
It will create some points on your .stl file and create some "sample" points. { // Sampling on triSurface type sampledTriSurfaceMesh; surface integrationPlane.stl; source boundaryFaces; // sample cells or boundaryFaces interpolate true; } Here you can find the original file: https://github.com/OpenFOAM/OpenFOAM...ple/sampleDict Let me know if it can be ok. |
|
Tags |
clip, programmable filter, stl file |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using PengRobinsonGas EoS with sprayFoam | Jabo | OpenFOAM Running, Solving & CFD | 36 | July 16, 2024 04:52 |
how to calculate mass flow rate on patches and summation of that during the run? | immortality | OpenFOAM Post-Processing | 104 | February 16, 2021 09:46 |
what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 02:22 |
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 | Seroga | OpenFOAM Community Contributions | 9 | June 12, 2015 18:18 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |