im2mesh / README.md
Im2mesh is an open-source MATLAB/Octave package for generating finite element mesh based on 2D segmented multi-phase
image. It provides a robust workflow capable of processing various input images, such as microstructure images of
engineering materials. Due to its generalized framework, Im2mesh can handle segmented image with more than 10 phases.
Im2mesh was originally released on MathWorks File Exchange in 2019.
Im2mesh can also be used as a mesh generation interface for MATLAB 2D multi-part geometry, aka multi-domain or multi-
phase geometry (see demo14-17).
News:
Version 2.45 can export polygonal boundaries as
dxf
file (CAD).
Function
plotMeshes
become more powerful, providing a few plot style settings (see demo 08).
Version 2.2.0 can use Gmsh as mesh generator (unstructured quadrilateral mesh).
Version 2.1.6 updates the DOI. Im2mesh is now citable.
Features:
Accurately preserve the contact details between different phases.
Incorporates polyline smoothing and simplification
Able to edit polygonal boundary before mesh generation.
Support phase selection and local mesh refinement.
4 mesh generators are available for selection: MESH2D, generateMesh, Gmsh, and pixelMesh.
Graphical user interface (GUI) version is available as a MATLAB app and as a standalone desktop application.
Generated mesh can be exported as:
inp
file with boundary node set (Abaqus)
bdf
file (Nastran bulk data, compatible with COMSOL),
msh
file (Gmsh mesh format)
MATLAB PDE model object
For other formats (such as
stl
and
vtk
), you can import the generated
msh
file into software Gmsh and then export.
When using Im2mesh package or Im2mesh_GUI in MATLAB, you need to install MATLAB and the following MATLAB
toolboxes: Image Processing Toolbox, Mapping Toolbox.
When using Im2mesh_GUI as a standalone desktop application, there is no need to install MATLAB or any MATLAB
toolboxes. You can download the installer for standalone desktop app from: link
Im2mesh_GUI: MATLAB R2017b or later; version higher than R2018b is preferred.
Im2mesh package: MATLAB R2017b or later. GNU Octave 9.3.0 or later.
Gmsh: tested with version 4.13.1.
After downloading Im2mesh package (releases), I suggest you start with Im2mesh_GUI app in the folder, which will help you
understand the workflow and parameters of Im2mesh. A detailed tutorial is provided in Im2mesh_GUI Tutorial.pdf.
Then, you can learn to use Im2mesh package in the folder "Im2mesh_Matlab" or "Im2mesh_Octave". 16 examples are
provided.
If you're using MATLAB, examples are live script
mlx
files (
demo01.mlx
~
demo18.mlx
). If you find some text in the
mlx
file is missing, please read the
html
file instead. Note that
demo02.mlx
requires MATLAB Partial Differential Equation
Im2mesh (2D image to finite element mesh)
Dependencies
Version compatibility
How to start