This tool consists of a few functions, like, im2Bounds (image to polygonal boundaries), getCtrlPnts (mark intersecting vertex between polygons, serving as fixed point for polygon simplification and meshing), simplifyBounds (simplify polygon), poly2mesh (polygon to triangular meshes, printInp (export as Inp file), and printBdf (export as Bdf file).
- Exactly reserve the contact detail between different phases.
- Able to avoid sharp corners when simplifying polyline.
- Support phase selection before meshing (see demo7.m)
- Generated mesh can be exported as inp file (Abaqus), bdf file (Nastran bulk data), and .node/.ele file.
- 7 examples are presented in demo1.m ~ demo7.m.
Note: To make this code run (especially for poly2mesh), 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 demo1.m~demo7.m in im2mesh. Check the images in the folder (im2mesh\images\...).
If you have any questions or suggestions, feel free to send me an email.
firstname.lastname@example.org, Nov 2020.
Great thanks Dr. Yang Lu providing valuable advice on this tool.
Jiexian Ma (2021). Im2mesh (2D image to triangular meshes) (https://www.mathworks.com/matlabcentral/fileexchange/71772-im2mesh-2d-image-to-triangular-meshes), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!