Converting STL surface mesh to volume mesh using GMSH


Just three simple steps:
> File -> Merge -> “filename.stl”
> Geometry -> Elementary entities -> Add -> New -> Volume, click on the surface to build the volume
> Mesh -> 3D

Sample STL file can be downloaded @ https://geuz.org/trac/gmsh/attachment/wiki/STLRemeshing/pelvis.stl.gz (user name and password are ‘gmsh’ ‘gmsh’.)

If some errors happened, it is the problem of your input stl surface mesh. One common error is “self intersecting surface mesh, computing intersections (this could tak a while)”. If your surface is generated by some segmentation software and too complicated to fix. You may want to convert your surface mesh to a solid volume and then rebuild the surface mesh through isosurface reconstruction.

Or you can use meshlab to find those problematic faces and edges. Use the tools from Filters/Selection/Select Self Intersecting Faces (Select non Manifold Edges) to select these regions, delete them, and then use hole filling tool to generate the final surface mesh. This sometimes can solve some weird volume mesh problems, for example, volume mesh outside the surface mesh.

http://www.geuz.org/pipermail/gmsh/2010/005558.html

—————————–

[10/27/2014] Instead of using GMSH, I actually used TetGen (http://wias-berlin.de/software/tetgen/) for several of my projects for volume mesh generation. It is a great tool for its simple syntax and lots of easy to understand examples. It was also integrated into Febio (http://mrl.sci.utah.edu/software/febio/), a FEM analysis software for biomechanical simulations. A paper of using both TetGen and Febio can be found here.

Advertisement

7 thoughts on “Converting STL surface mesh to volume mesh using GMSH

  1. Clarice

    You share interesting things here. I think that your website can go viral easily, but you must
    give it initial boost and i know how to do
    it, just type in google for – wcnu traffic increase

    Reply
  2. Rifat

    Hello, what about creating a volumetric mesh with multiple Physical Entities? Lets say I have two surface meshes, one is completely enclosed within the other one. Like the bone inside the soft-tissue. How can I generate a volumetric mesh given these two surfaces? Later on, I would like to use this mesh within FeBio.

    Reply
    1. Prithivi

      I also want to do the same thing. I have N number of STL files and I need a single volume mesh out of it. Did you figure out how to do that? If so, COuld you please guide me ?

      Reply
  3. David

    Hi, thanks for the info. Do you know if this can be done using command line prompts and not opening the acutal gui of gmsh?

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s