I want better packed sphere

4 ビュー (過去 30 日間)
ka
ka 2021 年 6 月 8 日
コメント済み: Rena Berman 2021 年 6 月 29 日
I'm trying to make a spherical shell using smaller spheres, I've reached to this point where these smaller spheres are widely spread, I want to reach at a better packing when no two smaller spheres overlap, can you all help me with this?
here is code for reference,
r = 1;
R = 10;
[x, y, z] = sphere(12);
figure;
Lim = [-R-r, R+r];
axes('NextPlot', 'add', 'XLim', Lim, 'YLim', Lim, 'ZLim', Lim);
axis equal;
view(3);
light;
for alpha = linspace(0, 2*pi,10)
for theta = linspace(0, pi, 13)
xs = sin(theta) * sin(alpha) * R;
ys = sin(theta) * cos(alpha) * R;
zs = cos(theta) * R;
surf(x * r + xs, y * r + ys, z * r + zs);
end
end
  3 件のコメント
Adam Danz
Adam Danz 2021 年 6 月 14 日
Original question before removing content:
I'm trying to make a spherical shell using smaller spheres, I've reached to this point where these smaller spheres are widely spread, I want to reach at a better packing when no two smaller spheres overlap, can you all help me with this?
here is code for reference,
r = 1;
R = 10;
[x, y, z] = sphere(12);
figure;
Lim = [-R-r, R+r];
axes('NextPlot', 'add', 'XLim', Lim, 'YLim', Lim, 'ZLim', Lim);
axis equal;
view(3);
light;
for alpha = linspace(0, 2*pi,10)
for theta = linspace(0, pi, 13)
xs = sin(theta) * sin(alpha) * R;
ys = sin(theta) * cos(alpha) * R;
zs = cos(theta) * R;
surf(x * r + xs, y * r + ys, z * r + zs);
end
end
Rena Berman
Rena Berman 2021 年 6 月 29 日
(Answers Dev) Restored edit

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

採用された回答

Adam Danz
Adam Danz 2021 年 6 月 13 日
This file exchange submission offers a method of uniform sampling along the surface of a sphere. After looking at the documentation to understand how to use the functions, all you need to do is specify a density based on the diameter of the smaller spheres. It will return the coordinates of the center points of each small circle.
  4 件のコメント
Adam Danz
Adam Danz 2021 年 6 月 14 日
From my answer, " [the function] will return the coordinates of the center points of each small circle. "
You still need to generate the spheres at those coordinates but now they will be uniformly distributed.
> if I'm using points to plot spheres I get just a half ring
I didn't understand this part. How are you generating the smaller spheres to begin with? I assume you're using sphere().
ka
ka 2021 年 6 月 14 日
I got it.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by