필터 지우기
필터 지우기

plot 2-dimention sphere in 3-D space

조회 수: 17 (최근 30일)
jia
jia 2024년 7월 5일
답변: Benjamin Kraus 2024년 8월 14일 18:23
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
William Rose
William Rose 2024년 7월 5일
편집: William Rose 2024년 7월 5일
Use sphere() with appropriate values and offsets, as demontrrated in the examples. But it does use surf().
And see this answer from Walter Roberson which does not use surf().

댓글을 달려면 로그인하십시오.

답변 (1개)

Benjamin Kraus
Benjamin Kraus 2024년 8월 14일 18:23
I wonder if what you are looking for is the alphaShape command. Check out the documentation and see if it satisfies your requirements.
Specifically, one example is titled Alpha Shape from 3-D Point Cloud, which I've copied here:
[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

카테고리

Help CenterFile Exchange에서 Bounding Regions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by