CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [blockMesh] Get vertices from stl-file (https://www.cfd-online.com/Forums/openfoam-meshing/249223-get-vertices-stl-file.html)

Florian Mlehliw April 27, 2023 07:18

Get vertices from stl-file
 
Hey guys!
I'm relatively new to OpenFOAM and this forum, but I hope I follow all the rules with this question.

I have a huge stl file (50GB) that I'm working on. I want to run blockMesh and snappy, but for this I need the vertices of the stl-file. Since it is so huge, I cannot open it in paraview to get the vertices - my paraview always crashes. At the moment, I use the numpy-stl package like this:
Code:

import numpy
from stl import mesh
mesh = mesh.Mesh.from_file("my_stl_file")
mesh.max_

This gives me the vertices, but it takes ~2 hours to run. I know there is a possibility for openFoam to read the stl-files and give me the vertices but I've been googling for some time and could not find the answer.
Please help :)

Yann April 27, 2023 07:52

I'm not sure to understand what you mean by vertices, but if you are interested in getting the bounding box of your STL in order to set your blockMesh size, you can use OpenFOAM surfaceCheck utlity.

Hope this helps,
Yann

Florian Mlehliw April 27, 2023 08:05

Yeah, that's it! I meant to extract the bounding box (in the blockMeshDict it's under 'vertices') and surfaceCheck seems to do exactly that! Thanks a lot!!

Florian Mlehliw April 27, 2023 08:47

And it really is much faster than the numpy-stl solution! So thanks again, Yann!


All times are GMT -4. The time now is 19:43.