- Exactly reserve the contact detail between different phases.
- Able to avoid sharp corners when simplifying polyline.
- Support phase selection before meshing (see demo10.m)
- Generated mesh can be exported as inp file (Abaqus), bdf file (Nastran bulk data, compatible with COMSOL), and .node/.ele file.
- 10 examples are presented in demo1.m ~ demo10.m.
- demo1.m - Demonstrate function im2meshBuiltIn, which use matlab built-in function generateMesh() to generate mesh from geometry.
- demo2.m - Demonstrate function im2mesh, which use MESH2D to generate mesh from geometry.
- demo3.m - Demonstrate how to export mesh as inp, bdf, and .node/.ele file.
- demo4.m - Demonstrate what is inside function im2mesh.
- demo5.m - Demonstrate the case of 'tolerance = eps'.
- demo6.m and demo7.m - Demonstrate parameter 'tolerance'.
- demo8.m - Demonstrate parameter 'tf_avoid_sharp_corner'.
- demo9.m - Demonstrate parameter 'grad_limit'.
- demo10.m - Demonstrate parameter 'select_phase'.
- 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-triangular-meshes?tab=discussions#discussions_1692673
- To make demo2.m~demo10.m run, you need to download MESH2D from https://www.mathworks.com/matlabcentral/fileexchange/25555-mesh2d-delaunay-based-unstructured-mesh-generation, and add the folder (mesh2d-master) to your path. After that, you can start with demo2.m~demo10.m in im2mesh. Check images in the folder (im2mesh\images\...).
引用格式
Jiexian Ma (2024). Im2mesh (2D image to triangular meshes) (https://www.mathworks.com/matlabcentral/fileexchange/71772-im2mesh-2d-image-to-triangular-meshes), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux类别
- MATLAB > Graphics > Images > Convert Image Type >
标签
致谢
参考作品: MESH2D: Delaunay-based unstructured mesh-generation, Line Simplification, Trace perimeter of binary image with line segments (bwperimtrace)
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
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 |