Hi
I have following X and Y points:
X = [ -0.05 -0.05 -0.05 -0.05 -0.016667 -0.016667 -0.016667 -0.016667 0.016667 0.016667 0.016667 0.016667 0.05 0.05 0.05 0.05];
Y = [ -0.025 -0.0083333 0.0083334 0.025 -0.025 -0.0083333 0.0083333 0.025 -0.025 -0.0083334 0.0083333 0.025 -0.025 -0.0083334 0.0083333 0.025];
I am using delaunay Triangulation as follows;
DT = delaunayTriangulation(X',Y')
and it gives points and connectivity list. However there should be 18 triangles but I have 20 triangles. When I checked it, I found that 2 lines are assumed as triangle and it is in Connectivity list.
You can check when you run my code:
DT.ConnectivityList
Connected points are 1-5-9 and 8-12-16 but they should not compose a triangle, they are actually on the same line.
How can I solve it?

 Akzeptierte Antwort

John D'Errico
John D'Errico am 19 Feb. 2015
Bearbeitet: John D'Errico am 19 Feb. 2015

1 Stimme

Those spurious triangles that got created have infinitesimal area.
In fact, IF I use the points you have supplied, I do get 18 triangles. But you have written out those numbers only to 5 significant digits, not the roughly 16 digits that MATLAB actually carries internally, so I cannot truly replicate what you did.
I've plotted the points you supplied. In fact, they form (roughly) a rectangular lattice.
To be honest, I'm not a big fan of using a delaunay triangulation on regular meshes, because it tends to produce a randomly oriented mesh. This is what I got from delaunayTriangulation.
The long, thin triangles that you got will typically be along the outside edge of that mesh. Here I've color coded the vertices from those two triangles with red * symbols.
plot(X,Y,'bo',X([1 5 9]),Y([1 5 9]),'r*',X([8 12 16]),Y([8 12 16]),'r*')
So, this really was not a "mistake", but just an artifact from bad data.

Weitere Antworten (0)

Kategorien

Community Treasure Hunt

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

Start Hunting!

Translated by