I want to generate triangle meshes in MATLAB with the delaunay function in 2-D. So I declare
the X- and Y- values and set tri=delaunay(X,Y). Then I use triplot to plot it. However,
what does tri give me? Does it give each of my triangle a special designation number?
After reading through some of the MATLAB tutorials I still DON’T
understand it.
I want to generate triangle meshes in MATLAB with the delaunay function in 2-D.
Share
The
delaunayfunction returnstrias anMx3matrix of triangle connectivity, where each of theMtriangles is represented as an integer triplet that indexes into theX,Yvertex position arrays.It’s probably easier with a simple example:
The triangles are just numbered linearly –
tri(1,:)is the first triangle,tri(n,:)is the nth triangle etc. If you wanted to re-order the list of traingles you could permute the array, but the indexing would always have to be linear – if there areMtriangles the indexing must encompass1:M.Hope this helps.