Plotting a 3D millstone with surfaces
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Markus Reichel
le 22 Juin 2022
Commenté : Star Strider
le 22 Juin 2022
I need to plot a Millstone with given radius (outside and inside), aswell as a given thickness.
As seen below I can plot the circles but don´t know how to produce the surfaces.
any help would be much appreciated.
0 commentaires
Réponse acceptée
Star Strider
le 22 Juin 2022
I am not certain what you want.
Try something like this —
[X1,Y1,Z1] = cylinder(0.2,50);
[X2,Y2,Z2] = cylinder(1.0,50);
Z1 = 0.25*Z1;
Z2 = 0.25*Z2;
C = [1 1 1]*0.5;
figure
hs1 = surf(X1, Y1, Z1, 'FaceColor',C, 'EdgeColor','none');
hold on
hs2 = surf(X2, Y2, Z2, 'FaceColor',C, 'EdgeColor','none');
hp1 = patch([X1(1,:) flip(X2(1,:))], [Y1(1,:) flip(Y2(1,:))], [Z1(1,:) flip(Z2(1,:))], C, 'EdgeColor','none');
hp2 = patch([X1(2,:) flip(X2(2,:))], [Y1(2,:) flip(Y2(2,:))], [Z1(2,:) flip(Z2(2,:))], C, 'EdgeColor','none');
hc1 = plot3(X1(1,:), Y1(1,:), Z1(1,:), '-', 'Color',[1 1 1]*0.3);
hc2 = plot3(X1(2,:), Y1(2,:), Z1(2,:), '-', 'Color',[1 1 1]*0.3);
hold off
material('dull')
lightangle(gca,-45,30)
lighting('gouraud')
axis('equal')
rotate([hs1,hs2,hp1,hp2,hc1,hc2], [0 1 0], 90)
Make appropriate changes to get the result you want. The ‘hc1’ and ‘hc2’ plot3 calls outline the centre void a bit more distinctly.
.
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Line Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!