CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[blockMesh] Get vertices from stl-file

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Yann
  • 1 Post By Florian Mlehliw

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 27, 2023, 08:18
Default Get vertices from stl-file
  #1
New Member
 
Wilhelm Furian
Join Date: Apr 2023
Location: Berlin
Posts: 16
Rep Power: 3
Florian Mlehliw is on a distinguished road
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
Florian Mlehliw is offline   Reply With Quote

Old   April 27, 2023, 08:52
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
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 likes this.
Yann is offline   Reply With Quote

Old   April 27, 2023, 09:05
Default
  #3
New Member
 
Wilhelm Furian
Join Date: Apr 2023
Location: Berlin
Posts: 16
Rep Power: 3
Florian Mlehliw is on a distinguished road
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!!
Yann likes this.
Florian Mlehliw is offline   Reply With Quote

Old   April 27, 2023, 09:47
Default
  #4
New Member
 
Wilhelm Furian
Join Date: Apr 2023
Location: Berlin
Posts: 16
Rep Power: 3
Florian Mlehliw is on a distinguished road
And it really is much faster than the numpy-stl solution! So thanks again, Yann!
Florian Mlehliw is offline   Reply With Quote

Reply

Tags
blockmesh, openfoam, stl file


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
what is swap4foam ?? AB08 OpenFOAM 28 February 2, 2016 02:22
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 20:43
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 07:42
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 11:23
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 12:46


All times are GMT -4. The time now is 10:51.