Im2mesh (2D image to finite element mesh)
- Version 2.51 can generate and export voxel-based hexahedral mesh (brick element). See demo19.
- Version 2.45 can export image boundaries as dxf file (CAD).
- Version 2.2.0 can use Gmsh as mesh generator (unstructured quadrilateral mesh).
- Version 2.1.6 updates the DOI. Im2mesh is now citable.
- 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.
- inp file with boundary node set (Abaqus)
- bdf file (Nastran bulk data, compatible with COMSOL),
- msh file (Gmsh mesh format)
- stl file
- MATLAB PDE model object
- For other formats (such as vtk), you can import the generated msh file into software Gmsh and then export.
- If you're using MATLAB, examples are live script mlx files (demo01.mlx ~ demo19.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 (PDE) Toolbox. If you don't have PDE Toolbox, you can skip demo02.mlx.
- If you're using Octave, examples are m files (demo1.m ~ demo10.m).
- Examples are also available as html files in the folder "demo_html".
- demo01 - Demonstrate function im2mesh, which use MESH2D as mesh generator.
- demo02 - Demonstrate function im2meshBuiltIn, which use MATLAB built-in function generateMesh as mesh generator.
- demo03 - Export: save mesh as inp, bdf, msh, and stl file; save image boundary as dxf file, geo file, or PSLG data.
- demo04 - What is inside im2mesh.
- demo05 - Avoid sharp corner
- demo06 - Thresholds in polyline smoothing
- demo07 - Parameter hmax and grad_limit in mesh generation
- demo08 - Function plotMeshes
- demo09 - How to select phases for meshing
- demo10 - Different polyline smoothing techniques
- demo11 - Find node sets at the interface and boundary
- demo12 - Function pixelMesh (pixel-based quadrilateral mesh)
- demo13 - Use Gmsh as mesh generator
- demo14 - Use polyshape to define geometry for mesh generation
- demo15 - Edit polygonal boundaries before meshing
- demo16 - Add mesh seeds/nodes
- demo17 - Refine mesh
- demo18 - Create tetrahedral mesh based on 2d image
- demo19 - Function voxelMesh (voxel-based hexahedral mesh)
- MESH2D by Darren Engwirda
- dpsimplify by Wolfgang Schwanghart
- p_poly_dist by Michael Yoshpe
- MeshQualityQuads by Allan Peter Engsig-Karup
- ccma by UniBwTAS
Cite As
Ma, Jiexian, and Yuanyuan Li. Im2mesh: A MATLAB/Octave Package for Generating Finite Element Mesh Based on 2D Multi-Phase Image. Zenodo, 2025, https://doi.org/10.5281/ZENODO.14847059.
Once my paper is published, I will update a new DOI here.
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > Images > Convert Image Type >
Tags
Acknowledgements
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 2.51 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/v2.51 |
||
| 2.49 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/v2.49 |
||
| 2.47 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/v2.47 |
||
| 2.45 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/v2.45 |
||
| 2.42 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/v2.42 |
||
| 2.40 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/v2.40 |
||
| 2.36 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/v2.36 |
||
| 2.35 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/v2.35 |
||
| 2.33 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/v2.33 |
||
| 2.30 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/v2.30 |
||
| 2.26 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/v2.26 |
||
| 2.2.3 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/v2.2.3 |
||
| 2.2.1 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/2.2.1 |
||
| 2.2.0 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/2.2.0 |
||
| 2.1.9 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/2.1.9 |
||
| 2.1.8 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/2.1.8 |
||
| 2.1.6 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/2.1.6 |
||
| 2.1.5 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/2.1.5 |
||
| 2.1.1 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/2.1.1 |
||
| 2.1.0 | See release notes for this release on GitHub: https://github.com/mjx888/im2mesh/releases/tag/2.1.0 |
||
| 1.88 | Update Description |
||
| 1.87 | Update Description |
||
| 1.86 | add note |
||
| 1.85 | Add comments & description |
||
| 1.84 | Revise Description |
||
| 1.83 | Revise summary |
||
| 1.82 | Update description |
||
| 1.81 | Update description |
||
| 1.80 | Add im2meshBuiltIn.m, poly2meshBuiltIn.m
|
||
| 1.76 | improve getCtrlPnts
|
||
| 1.75 | Add new parameter 'select_phase' |
||
| 1.71 | Revise description |
||
| 1.7 | Add two new parameters for mesh generation |
||
| 1.6 | make im2Bounds() more readable using getExactBounds() |
||
| 1.5 | improve im2Bounds.m and getCtrlPnts.m
|
||
| 1.1.1 | update description |
||
| 1.1 | revise demo(), add examples
|
||
| 0.9 | Improve time efficiency of getCtrlPnts(). Faster. Add new parameter - tf_avoid_sharp_corner. Able to avoid non-convergence when meshing.
|
||
| 0.8.2 | new image for cover |
||
| 0.8.1 | revise getCtrlPnts() for time efficiency |
||
| 0.8.0 | debug
|
||
| 0.7.0 | debug
|
||
| 0.6.2 | update description |
||
| 0.6.1 | update description |
||
| 0.6.0 |
