plot 2-dimention sphere in 3-D space
5 次查看(过去 30 天)
显示 更早的评论
How can quickly obtain the 3D lattice in matlab for many datas that the lattice is ball.
I know the scatter3 can quickly plot points in 3D space, but i want to get the ball rather than point, and if i use the 'surf' and 'for' loop, the run time is large!
回答(1 个)
Benjamin Kraus
2024-8-14
I wonder if what you are looking for is the alphaShape command. Check out the documentation and see if it satisfies your requirements.
[x1,y1,z1] = sphere(24);
x1 = x1(:);
y1 = y1(:);
z1 = z1(:);
x2 = x1+5;
P = [x1 y1 z1; x2 y1 z1];
P = unique(P,'rows');
plot3(P(:,1),P(:,2),P(:,3),'.')
axis equal
grid on
shp = alphaShape(P(:,1),P(:,2),P(:,3),1);
plot(shp)
axis equal
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!