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?

 채택된 답변

John D'Errico
John D'Errico 2015년 2월 19일
편집: John D'Errico 2015년 2월 19일

1 개 추천

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.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Delaunay Triangulation에 대해 자세히 알아보기

질문:

2015년 2월 19일

편집:

2015년 2월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by