Voronoi Diagram Boundaries with a given width

18 ビュー (過去 30 日間)
Boxun YAN
Boxun YAN 2019 年 6 月 27 日
コメント済み: Bruno Lopes 2022 年 2 月 20 日
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.
  1 件のコメント
Bruno Lopes
Bruno Lopes 2022 年 2 月 20 日
It is the best code I found on the internet. It is really complete.

サインインしてコメントする。

採用された回答

KSSV
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 件のコメント
Boxun YAN
Boxun YAN 2019 年 6 月 28 日
Then how can I determine whether a poing(x,y) in the coodinate is in the bound line or in the region?

サインインしてコメントする。

その他の回答 (1 件)

Preetham Manjunatha
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.

カテゴリ

Help Center および File ExchangeVoronoi Diagram についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by