从Delaunay Triangulation获得的三角形集中获得具有共享边的三角形对

Obtaining a triangle pair that have a shared edge from triangle set obtained from Delaunay Triangulation

我想获得从Delaunay三角剖分获得的三角形集中的三角形。我写了下面的代码。我怎样才能获得彼此有切边的三角形(请看图片)?根据这个图像,我想从Delaunay Triangulation获得的三角形集中获得triangle1和2。

rng 默认值;

P = rand([32 2]);

DT = delaunayTriangulation(P);

三重奏(DT)

简答:neighbors(DT)

示例:

rng default
P = rand([12 2]);
DT = delaunayTriangulation(P);

IC = incenter(DT);

% visualize incl. ID in the center
figure
triplot(DT)
hold on
text(IC(:,1), IC(:,2), num2str([1:size(IC,1)]'))

% find all neighboring triangles
neighbors(DT)

% for the first triangle
neighbors(DT, 1)