필터 지우기
필터 지우기

How to obtain a triangle pair which have a shared edge from Delaunay Triangulation

조회 수: 5 (최근 30일)
Hello everyone
I want to obtain triangles which are from triangle set obtained from Delaunay Triangulation. I wrote the following code. How can I obtain triangles which have a shred edge with each other?

채택된 답변

Chunru
Chunru 2021년 5월 30일
After you obtain DT, you can use the following command to get the ID of the triangles in DT.ConnectivityList.
P = rand([5 2]);
DT = delaunayTriangulation(P);
triplot(DT)
text(DT.Points(:,1), DT.Points(:,2), string(1:5)')
ID = edgeAttachments(1,5); % Choose edge from point 1 to point 5
ID = edgeAttachments(DT, 1,5); % Triangle IDs attached to the edge 1-5
DT.ConnectivityList(ID{:}, :) % Show the vertex ids of the attached triangles
  댓글 수: 2
Afra Mirhosseini
Afra Mirhosseini 2021년 5월 30일
Hello Chunru
Thank you for your codes. I ran your codes. Unfortunately, I faced an error!
When I ran "ID = edgeAttachments(1,5);" I faced the following error too!
Chunru
Chunru 2021년 5월 31일
edgeAttachements is Introduced in R2013a. Before testing, do the following:
clear all

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Delaunay Triangulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by