How to find the area of a common face of voronoi cells

조회 수: 9 (최근 30일)
Vinit Nagda
Vinit Nagda 2021년 8월 29일
댓글: Vinit Nagda 2021년 8월 30일
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
Matt J
Matt J 2021년 8월 29일
편집: Matt J 2021년 8월 29일
There could possibly be more than one face common to two cells.
I don't think so. That would violate the convexity of the cells.

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

채택된 답변

Matt J
Matt J 2021년 8월 29일
편집: Matt J 2021년 8월 29일
The general procedure would be
  1. Given the output [v,c]=voronoin(P) select two cells i and j
  2. Find the vertices in comon between cells i and j using intersect(c{i},c{j})
  3. If there are more than 2 intersecting vertices, fit a plane to them and project them into a 2D coordinate system on the plane.
  4. 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
  댓글 수: 1
Vinit Nagda
Vinit Nagda 2021년 8월 30일
@Matt J Thank you very much for your response. I should now be able to calculate the area of common face with your code.
I am not sure about the number of common faces but I will check that and let you know.
Thanks for your time and support.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Voronoi Diagram에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by