How to draw a generic cylinder with arbitrary orientation

8 次查看(过去 30 天)
Hi,
How to draw a generic cylinder, we have its radius, length, position of center of mass ( or bottom face center) and its orientation (using a unit vector, for example 0,0,1 for z-axis ). Any help would be appreciated.
Regards
Reza

采纳的回答

Matt J
Matt J 2023-12-4
编辑:Matt J 2023-12-4
See this File Exchange download,
[cCenter,cRadius,cHeight,cYawPitch]=...
deal([0 0 0], 2, 10, [45 -30]); %Cylinder parameters
gtCyl=cylindricalFit.groundtruth([],cCenter,cRadius,cHeight,cYawPitch); %Data-less ground truth objects
plot(gtCyl)
  1 个评论
Mohammad Reza
Mohammad Reza 2023-12-24
编辑:Mohammad Reza 2023-12-24
Thanks.
This is what I learned, in case somebody needs it as well:
Z_axis oriented cylinder: cYawPitch= [0 90]
Y_axis oriented cylinder: cYawPitch= [90 0]
X_axis oriented cylinder: cYawPitch= [0 0]

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by