generating random , non uniform fiber distribution of circle in square

16 ビュー (過去 30 日間)
DIVAKAR RAJU P V
DIVAKAR RAJU P V 2021 年 1 月 20 日
編集済み: Adam Danz 2021 年 1 月 26 日
I wanted to generate the square filled with circles of equal radius. Distribution should be random, non uniform and geomtrically periodic(meaning cut out portion of the circles on boundaries of square should be on the opposite side of the square). Though many people posted this question, no answer so far. can someone help me in it.
on esuggestion got to follow the Random sequential expansion(RSE) algorithm.

採用された回答

Adam Danz
Adam Danz 2021 年 1 月 20 日
編集済み: Adam Danz 2021 年 1 月 20 日
Using bubblebath() from the file exchange (see another demo here),
figure('Color','w')
ax = axes();
axis off
S.axisHandle = ax;
S.frameSize = [100,100]; % axis size, centered at (0,0)
S.circSize = 2; % circle radius
S.nSizes = NaN;
S.edgeType = 2; % Frame should cut off circle edges
S.supressWarning = true;
S.drawFrame = true; % show the black axis frame
[circData, circHandles] = bubblebath(S);
% View the first 5 rows of circle (x,y) coordinates and radii
circData(1:5,:)
% ans =
% 29.88 -32.97 2
% 13.043 -30.441 2
% -45.91 1.8186 2
% 33.429 45.709 2
% 35.57 -19.943 2
  5 件のコメント
Adam Danz
Adam Danz 2021 年 1 月 22 日
編集済み: Adam Danz 2021 年 1 月 22 日
@DIVAKAR RAJU P V download vs 2.3.0 of bubblebath(). This version supports edge wrapping. The section of circles that expand beyond an axis border are wrapped to the other side. If a circle expands beyond two axis borders at a corner, both its x and y components are wrapped. Note that this function relies on random processes and intentionally uses a low-level, unsophisticated algorithm which is different from circle-packing and its wrapping feature may differ from the algorithm in the paper you shared.
Example:
rng('default') % for reproducibility
S = struct();
S.frameSize = [30 30];
S.circSize = 4;
S.nSizes = NaN;
S.edgeType = 3; % <-- flag to wrap edges
S.supressWarning = true;
bubblebath(S)
Adam Danz
Adam Danz 2021 年 1 月 25 日
編集済み: Adam Danz 2021 年 1 月 26 日
@DIVAKAR RAJU P V Have you tried to new version after I updated it for you and your question?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by