Mesh from common files
An alternative option is to use the mesh generation tools provided by the Partial Differential Toolbox
in Matlab. Such function is also included in Mesh.generate
. SDFs can also be used in this process, although an intermediate step is required. For two-dimensional domains, SDFs are first converted into binary images and then the image boundary detection is used to convert them to either a linear mesh Tri3
or a quadratic mesh Tri6
. Direct input of black-and-white .jpg
or .png
images is also supported. For three-dimensional domains, SDF functions are converted to an .stl
file using the Marching Cube algorithm1 and then provided to the Matlab PDE toolbox to generate the tessellation. Importing and exporting .stl
or .obj
files directly is also possible.
Example: Mesh from image file
1 2 3 4 5 6 7 8 9 |
|
For Sorotoki
to use .png
/.jpg
, the background must be white and foreground black!
Example: Mesh from STL file
1 2 3 4 5 6 7 8 9 10 |
|
-
William E. Lorensen and Harvey E. Cline. Marching cubes: A high resolution 3D surface construction algorithm. In ACM SIGGRAPH Computer Graphics, volume 21, pages 163–169. Association for Computing Machinery, New York, NY, USA, 1987. doi:10.1145/37401.37422. ↩