Resource Menu


MeshToGeo is a command-line tool dedicated to convert a mesh file (.msh) of the Gmsh CAD/meshing software to an equivalent geometry file(.geo).
This allows to edit/modify/clean and mesh a volume defined a tessellated surface issued from a previous surface meshing. The conversion includes the support of Gmhs’s physicals flags.

General remarks

MeshToGeo converts an input mesh (.msh) file to an equivalent geometry file (.geo). The current version of MeshToGeo is compliment with the Gmsh format 2.2.

Each mesh element (i.g. point, line, face and linear tethraedra) is converted into equivalent geometrical elementary entities. The conversion of physicals is also supported.

By default, a global mesh refinement factor of one is applied on the exported geometrical nodes for futur remeshing. But, in alternative, this global refinement factor can manually be set by the user.

Currently and depending on the input mesh type, the following scenarios:

  • If the input mesh is a surface mesh (i.e. set of triangles), the generated geometrical model is a tessellated surface (i.e. set of triangles)
  • If the input mesh is a volume mesh, all triangles are converted, including faces of the inner tetrahedra, into triangles and a volume is defined by tetrahedron.
Remark: Please note that if there are volumes with multiple physicals defined, MeshToGeo will have an unexpected behavior: it will duplicate these volumes for each physical defined.

Executing MeshToGeo

To use MeshToGeo, simply go into the folder where the software is and type in a terminal:

./MeshToGeo.sh  inputFile.msh outputFile.geo on Linux/Mac OSX
MeshToGeo.bat inputFile.msh outputFile.geo on Windows systems

It is possible to choose the refinement coefficient for the geometry to export. This refinement will be reported to the geometry file and used by gmsh when re-meshing the geometry. To do so, simply type:

./MeshToGeo.sh inputFile.msh outputFile.geo refinementCoefficient on Linux/Mac OSX
MeshToGeo.bat inputFile.msh outputFile.geo refinementCoefficient on Windows systems

MeshToGeo comes with a simple help integrated, to use it type geficot -h.

Technical overview

MeshToGeo is using the gmsh plugin of the Penelope project to read the mesh file and the CAD module of the Keridwen Integrated Modelling Environment (IME) to convert and export this mesh to a gmsh geometry file.



Last edited by Nicolas Chabalier at May 12, 2016 4:50 PM - Edit content - View source