How to find the area of a common face of voronoi cells
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Vinit Nagda
el 29 de Ag. de 2021
Comentada: Vinit Nagda
el 30 de Ag. de 2021
I have a set of 3D points from which I draw a Voronoi diagram using voronoin.
I want to find the area of a face common to two voronoi cells for neighbouring points. (There could possibly be more than one face common to two cells, so first to find number of common face and then their corresponding areas).
Can someone please help me with a function to calculate the same?
Thank you.
1 comentario
Respuesta aceptada
Matt J
el 29 de Ag. de 2021
Editada: Matt J
el 29 de Ag. de 2021
The general procedure would be
- Given the output [v,c]=voronoin(P) select two cells i and j
- Find the vertices in comon between cells i and j using intersect(c{i},c{j})
- If there are more than 2 intersecting vertices, fit a plane to them and project them into a 2D coordinate system on the plane.
- Use convhull to calculate the convex area of the 2D projected points.
Step 3 can be done easily using planarFit from this File Exchange submission
[v,c]=voronoin(P);
V=v(intersect(c{i},c{j}), :); %intersecting vertices
if size(V,1)<=2
Area=0;
else
fitobj=planarFit(V.');
[~,Area]=convhull( (V-mean(V,1))*fitobj.R(:,2:3) );
end
Más respuestas (0)
Ver también
Categorías
Más información sobre Voronoi Diagram en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!