How to do this with Delaunay Triangulation?

I have X_0, Y_0 coordinates as column vectors and they can be plotted like in the following figure:
I am trying to create a Delaunay Triangulation with
DT = delaunayTriangulation(X_0,Y_0);
figure(1)
triplot(DT,'.-',"LineWidth",2,"MarkerSize",20);
and the result is the following:
As you can see there are many unnecessary lines and triangles in the circled area. What can I do to not have triangles in that area?

1 commentaire

John D'Errico
John D'Errico le 26 Fév 2021
What can you do? Don't use a delaunay triangulation. A delaunaytriangulation will result in a triangulation of the convex hull of the data. Those extra edges you see are a consequence of that.
You might try using a polyshape to describe the boundary of the region, as a non-convex polygon. Now use the triangulation method to form a triangulation of the domain.
Or, you might decide to form a constrained triangulation, where you force delaunayTriangulation to use specific edges. The result will still be convex. But now you can go in and delete the triangles with long edges.

Connectez-vous pour commenter.

Réponses (2)

Bjorn Gustavsson
Bjorn Gustavsson le 26 Fév 2021

0 votes

You'll have to go through DT.ConnectivityList and remove the triangles you don't like. The function returns a convex set of triangles so the triangulation you got is what's to be expected. You might also automate this by checking the side-lengths of the triangles and discard those that have to long sides, if that's what you prefer.
HTH
YISONG PENG
YISONG PENG le 18 Juil 2021

0 votes

You can try alphaShape
https://www.mathworks.com/help/matlab/ref/alphashape.html

Catégories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by