The define of "dual" delaunay triangle from Voronoi diagram
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Ronit
le 23 Sep 2024
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 commentaires
Voir également
Catégories
En savoir plus sur Voronoi Diagram dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!