Plotting a 3D millstone with surfaces

4 visualizaciones (últimos 30 días)
Markus Reichel
Markus Reichel el 22 de Jun. de 2022
Comentada: Star Strider el 22 de Jun. de 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.

Respuesta aceptada

Star Strider
Star Strider el 22 de Jun. de 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 comentarios
Markus Reichel
Markus Reichel el 22 de Jun. de 2022
thank you that´s exactly what i needed!
Star Strider
Star Strider el 22 de Jun. de 2022
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by