Im2mesh (2D image to finite element mesh)
- Version 2.2.1 is able to edit polygonal boundary before mesh generation. Check demo14 - 16.
- Version 2.2.0 can use Gmsh as mesh generator (unstructured quadrilateral mesh).
- Version 2.1.6 updates the DOI. Im2mesh is now citable.
- Version 2.1.0 is a huge update. Im2mesh package can run on GNU Octave.
- Accurately preserve the contact details between different phases.
- Incorporates polyline smoothing and simplification
- Able to avoid sharp corners when simplifying polylines.
- Support phase selection before meshing.
- 3 mesh generators are available for selection: MESH2D, and generateMesh, and Gmsh
- Generated mesh can be exported as inp file (Abaqus) and bdf file (Nastran bulk data, compatible with COMSOL). Mesh can be exported as many formats via Gmsh, such as STL.
- Graphical user interface (GUI) version is available as a MATLAB app.
- 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 - How to export mesh as inp, bdf, and node/ele file
- demo04 - What is inside function im2mesh.
- demo05 - Parameter tf_avoid_sharp_corner
- demo06 - Thresholds in polyline smoothing
- demo07 - Parameter grad_limit for mesh generation
- demo08 - Parameter hmax for mesh generation
- demo09 - How to select phases for meshing
- demo10 - Different polyline smoothing techniques
- demo11 - How to find node sets at the interface and boundary
- demo12 - Demonstrate function pixelMesh (pixel-based quadrilateral mesh)
- demo13 - How to use Gmsh as mesh generator
- demo14 - How to use polyshape object to define multi-part geometry for mesh generation
- demo15 - How to edit polygonal boundaries before meshing
- demo16 - How to add points or nodes to polygonal boundaries before meshing
- Im2mesh program identifies different phases in a image by their grayscales. Different grayscales correspond to different phases. If you have 4 level of grayscales in a image, the resulted meshes will contain 4 phases.
- You need to do pre-processing to your image before you put the image into Im2mesh program. For example, convert to 8-bit grayscale image, noise removal, and image segmentation (e.g., Otsu's method). What Im2mesh needs is a segmented grayscale image. For those fellows who don't have any experience in digital image processing, please refer to the following information: https://www.mathworks.com/matlabcentral/fileexchange/71772-im2mesh-2d-image-to-finite-element-mesh?tab=discussions#discussions_1692673
Cite As
Ma, J., & Li, Y. (2025). Im2mesh: A MATLAB/Octave package for generating finite element mesh based on 2D multi-phase image (2.1.5). Zenodo. https://doi.org/10.5281/zenodo.14847059
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > Images > Convert Image Type >
Tags
Acknowledgements
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Im2mesh_Matlab
Im2mesh_Matlab/mesh2d-master
Im2mesh_Matlab/mesh2d-master/aabb-tree
Im2mesh_Matlab/mesh2d-master/geom-util
Im2mesh_Matlab/mesh2d-master/hfun-util
Im2mesh_Matlab/mesh2d-master/hjac-util
Im2mesh_Matlab/mesh2d-master/mesh-ball
Im2mesh_Matlab/mesh2d-master/mesh-cost
Im2mesh_Matlab/mesh2d-master/mesh-file
Im2mesh_Matlab/mesh2d-master/mesh-util
Im2mesh_Matlab/mesh2d-master/poly-test
Im2mesh_Matlab/test_script
Im2mesh_Octave
Im2mesh_Octave/mesh2d-master
Im2mesh_Octave/mesh2d-master/aabb-tree
Im2mesh_Octave/mesh2d-master/geom-util
Im2mesh_Octave/mesh2d-master/hfun-util
Im2mesh_Octave/mesh2d-master/hjac-util
Im2mesh_Octave/mesh2d-master/mesh-ball
Im2mesh_Octave/mesh2d-master/mesh-cost
Im2mesh_Octave/mesh2d-master/mesh-file
Im2mesh_Octave/mesh2d-master/mesh-util
Im2mesh_Octave/mesh2d-master/poly-test
Im2mesh_Matlab
Version | Published | Release Notes | |
---|---|---|---|
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 |