Voronoi Diagram Boundaries with a given width
조회 수: 6 (최근 30일)
이전 댓글 표시
I had a problem with Voronoi function now. I wish that I can remain a width, say, x(a variable) for each grid.Here is my code but that's wrong. Attached please find a pic that exactly shows what I want to do with Voronoi Diagram.
A = [3,7,2,8,5];
B = [6,1,0,8,1];
x=2;
Voronoi(A,B,"LineWidth",x);
There is a pic telling what I need.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/226520/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/226520/image.jpeg)
댓글 수: 1
Bruno Lopes
2022년 2월 20일
A good option for voronoi is the following code: https://it.mathworks.com/matlabcentral/fileexchange/34428-voronoilimit-varargin
It is the best code I found on the internet. It is really complete.
채택된 답변
KSSV
2019년 6월 27일
A = [3,7,2,8,5];
B = [6,1,0,8,1];
x=2;
h = Voronoi(A,B);
for i = 1:length(h)
h(i).LineWidth = x ;
end
추가 답변 (1개)
Preetham Manjunatha
2022년 2월 8일
편집: Preetham Manjunatha
2022년 2월 8일
If I understand your problem correctly, are you looking to bound the Voronoi region? If so, here is the link function to clip the extending edges of the Voronoi Diagram for rectangular or square region. Rigorously tested on the random points, this function can process an input data set of 2000 seed points in 2D in about 0.015 seconds on average.
댓글 수: 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!