Draw partial spheroid include a spheroid
Mostrar comentarios más antiguos
I want to draw 1/8 spheroid include a small spheroid and output the geometry for mesh. But my current coding always have discontinue in the cutting plan.

Can anyone help provide a idea of cutting the spheroid in 1/8 not for showing but get the data.
Respuesta aceptada
Más respuestas (2)
darova
el 19 de Ag. de 2019
Use patch() to generate planes
clc,clear
R = 10;
r = 3;
t = linspace(0,pi/2,20);
x = [r*cos(t) fliplr(R*cos(t))];
y = [r*sin(t) fliplr(R*sin(t))];
patch(x,y,x*0,'b')
hold on
patch(x,x*0,y,'b')
patch(x*0,x,y,'b')
hold off
alpha(0.5)
view(3)
13 comentarios
KOU DU
el 19 de Ag. de 2019
darova
el 19 de Ag. de 2019
What format of data output should be?
KOU DU
el 19 de Ag. de 2019
KOU DU
el 21 de Ag. de 2019
KOU DU
el 21 de Ag. de 2019
darova
el 21 de Ag. de 2019
Use surf() to draw 1/8 of sphere and patch() to create a planes
KOU DU
el 21 de Ag. de 2019
darova
el 21 de Ag. de 2019
Are your shapes (sphere and ellispoid?) always centered? Are their centers in origin?
KOU DU
el 22 de Ag. de 2019
darova
el 22 de Ag. de 2019
Here we go
darova
el 22 de Ag. de 2019
Don't know how introduce 'p' parameter in that form
KOU DU
el 22 de Ag. de 2019
KOU DU
el 22 de Ag. de 2019
Abhisek Pradhan
el 7 de Ag. de 2019
Following code may be used as an alternative to draw a sphere. Theta and Phi can be varied to get the desired result.
R=10;
Phi=linspace(-pi,pi);
Theta=linspace(0,2*pi);
[Phi,Theta]=meshgrid(Phi,Theta);
Z=R*sin(Phi);
X=R*cos(Phi).*cos(Theta);
Y=R*cos(Phi).*sin(Theta);
hSurface = surf(X,Y,Z);
set(hSurface,'FaceColor',[0 0 1], 'FaceAlpha',0.5,'FaceLighting','gouraud','EdgeColor','none');
1 comentario
KOU DU
el 19 de Ag. de 2019
Categorías
Más información sobre Surface and Mesh Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


