How to creat 3D mesh about superellipse hole in a cube

조회 수: 5 (최근 30일)
KOU DU
KOU DU 2018년 11월 2일
댓글: KOU DU 2018년 11월 5일
The equation of the superellipse is (x/a)^p+(y/b)^p+(z/c)^p=1. p<2.a,b,c are constant. I want to draw a 3D mesh of the cube include this superellipse. I download iso2mesh which can generate 3D mesh but not succeed.

답변 (1개)

KSSV
KSSV 2018년 11월 2일
th = linspace(-pi/2,pi/2) ;
phi = linspace(-pi,pi) ;
[T,P ] =meshgrid(th,phi) ;
a = 2; b = 2; c = 1 ;
X = a*cos(T).*cos(P) ;
Y = b*cos(T).*sin(P) ;
Z = c*sin(T) ;
surf(X,Y,Z)
  댓글 수: 1
KOU DU
KOU DU 2018년 11월 5일
thank you for you answer. But I don't want to mesh a ellipse.You can see in my question, I give the equation of the hole: (x/a)^p+(y/b)^p+(z/c)^p=1. I want to draw a cube with a hole in the center.

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

카테고리

Help CenterFile Exchange에서 Other Formats에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by