MATLAB: Importing and exporting mesh data between MATLAB and MeshLab

data exportdata importMATLABmeshmeshlabtriangulation

Given a 2D surface embedded in 3D, I generate its Delaunay triangulation using MATLAB's delaunay and delaunayTriangulation methods. However, they do not produce good watertight results.
I save the triangulation mesh saved as list of vertices x in 3D and list of triangles T (each row is a triangle, in which there are 3 indices, refering to the vertices in x (e.g. T(i) = [3 7 15] is the triangle with vertices x(3), x(7) and x(15)).
I want to export this data to MeshLab, edit and fix it there, and then import the result from MeshLab back to MATLAB. Is it possible? Does MeshLab support in MATLAB? If so, how to import and export the data?

Best Answer

Using stlwrite one can write MATLAB triangulations into a STL file.
Using stlread one can read an STL file into a MATLAB triangulation.
Related Question