Plotting a 3D millstone with surfaces

4 ビュー (過去 30 日間)
Markus Reichel
Markus Reichel 2022 年 6 月 22 日
コメント済み: Star Strider 2022 年 6 月 22 日
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.

採用された回答

Star Strider
Star Strider 2022 年 6 月 22 日
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 件のコメント
Markus Reichel
Markus Reichel 2022 年 6 月 22 日
thank you that´s exactly what i needed!
Star Strider
Star Strider 2022 年 6 月 22 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by