The define of "dual" delaunay triangle from Voronoi diagram
4 ビュー (過去 30 日間)
古いコメントを表示
p=dlmread('knot.pts'); where p is Nx3 ,matrix dt=DelaunayTri(p); [V R]=dt.voronoiDiagram(); According to Voronoi concepts ,"the delaunay triangle are dual to voronoi edge". It is possible I define the "dual triangle" of voronoi edge by based on R or V ? As i not wrong , the dt is based on dt.x and R is also based on dt.x. Second questions , [V R]=dt.voronoiDiagram() command has provide any method to define Voronoi edge? Thank you
0 件のコメント
回答 (1 件)
Ronit
2024 年 9 月 23 日
Hi Renoald,
To define the "Dual Triangle" of a Voronoi edge, it is essential to recognize that each Voronoi edge corresponds to an edge of a Delaunay triangle. The "Dual Triangle" of a Voronoi edge can be identified by finding the Delaunay triangle whose circumcenter is represented by the Voronoi vertex to which the edge is connected.
[V, R] = dt.voronoiDiagram()
The above function gives Voronoi vertices "V" and regions "R". To get Voronoi edges, connect consecutive vertices in each region from "R". This must be done manually since the function does not directly provide edges.
% Assuming V and R are obtained from the voronoiDiagram function
voronoiEdges = [];
for i = 1:length(R)
region = R{i};
if all(region ~= 1) % Ignore infinite regions
% Connect each pair of consecutive vertices in the region
edges = [region(:), region([2:end, 1])'];
voronoiEdges = [voronoiEdges; edges];
end
end
% voronoiEdges now contains pairs of indices into V that represent edges
Please refer to the MATLAB's documentation of "voronoiDiagram" for better undeerstanding:
Hope it helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Voronoi Diagram についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!