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), getInterf (search nodes at interface), printInp (export as Inp file). The Inp file can be imported into software Abaqus.
This tool was originally written in March 2018 for particle material with air void. The code was rewritten in 2019 so it can work for multi-phase materials. Exactly reserve the contact detail between different phases.
Note1: 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 demo() in im2mesh, and vary the parameter – tolerance to see the result. Try out the images in the folder (im2mesh\examples\...).
Note2: The current version failed for im2mesh\examples\b3.tif. I will fix this bug next week.
If you have any questions or suggestions, feel free to send me an email.
firstname.lastname@example.org, June 2019.
Jiexian Ma (2019). Im2mesh (2D image to triangular meshes) (https://www.mathworks.com/matlabcentral/fileexchange/71772-im2mesh-2d-image-to-triangular-meshes), MATLAB Central File Exchange. Retrieved .
Create scripts with code, output, and formatted text in a single executable document.