CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] Distance between STL and mesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 2, 2025, 09:58
Default Distance between STL and mesh
  #1
New Member
 
Join Date: Jul 2025
Posts: 4
Rep Power: 2
axtone is on a distinguished road
After creating a mesh with Snappyhexmesh, I want to analyze the differences between the resulting mesh and the original STL geometry (such as the distance between the snapped mesh and the STL). If the mesh does not fit perfectly on the surface and there are slight irregularities, I want to analyze these. How can I do this?
axtone is offline   Reply With Quote

Old   August 17, 2025, 08:38
Default
  #2
New Member
 
Ewan Koay
Join Date: Jun 2025
Location: Malaysia/ Singapore
Posts: 3
Rep Power: 2
ABitShy is on a distinguished road
Quote:
Originally Posted by axtone View Post
After creating a mesh with Snappyhexmesh, I want to analyze the differences between the resulting mesh and the original STL geometry (such as the distance between the snapped mesh and the STL). If the mesh does not fit perfectly on the surface and there are slight irregularities, I want to analyze these. How can I do this?
Is there a specific mesh issue you are facing?

From experience, with suitable mesh size controls, you can control the irregularities within your expectations.

Otherwise, scripts can loop the coordinates of each face mesh cell of specified problematic faces. This in turn can be used to interpolate the coordinates of the STL geometric faces and compute the distance differences. A distribution of mesh distance errors can be calculated from this for easy reference.

Regards,
Ewan
ABitShy is offline   Reply With Quote

Old   August 17, 2025, 09:13
Default
  #3
New Member
 
Join Date: Jul 2025
Posts: 4
Rep Power: 2
axtone is on a distinguished road
I was wondering about the distance between the STL file and the snapped mesh. Some sections of my mesh have minor indentations or bulges. I'd like to know the local deflection values. However, I haven't been able to write the script, so any help would be greatly appreciated.
axtone is offline   Reply With Quote

Old   September 16, 2025, 12:21
Default
  #4
Senior Member
 
M
Join Date: Dec 2017
Posts: 730
Rep Power: 14
AtoHM is on a distinguished road
I dont know exactly how it will work, but I would try to figure out the boundary nodes of the mesh from the polyMesh folder and compute somehow the distance to the appropriate part of the stl. A problem comes to mind: stl is tessellated and huge faces are probably meshed by thousands of finite faces. So you cannot compute the distance to the nodes of the stl file (well, you can, but it does not tell you anything). You need to compute the shortest distances to each face of the stl, which you must describe first, mathematically. Possible, but an additional step to consider. Corners might pose additional problems.


.. and then, you have the total deviation at each mesh node. I wonder how that is helping you?
AtoHM is offline   Reply With Quote

Reply

Tags
mesh, openfoam, paraview, snappyhexmesh

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[snappyHexMesh] SnappyHexMesh/splitMeshRegion : region1 in zone "-1" GuiMagyar OpenFOAM Meshing & Mesh Conversion 3 August 4, 2023 13:38
[snappyHexMesh] non uniform mesh near the stl object vava10 OpenFOAM Meshing & Mesh Conversion 0 January 31, 2021 15:41
[snappyHexMesh] SnappyHexMesh for internal Flow vishwa OpenFOAM Meshing & Mesh Conversion 24 June 27, 2016 09:54
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38
[snappyHexMesh] SnappyHexMesh no layers and no decent mesh for complex geometry pizzaspinate OpenFOAM Meshing & Mesh Conversion 1 February 25, 2015 08:05


All times are GMT -4. The time now is 09:48.