Draw Structural Space Frame

26 次查看(过去 30 天)
I have been trying to draw a steel space frame in MATLAB. I have the elementnodes and the nodecoordinates. The coding i have used is a follows:
nodeCoordinates=[0 0 0; 0 0 4; 4 0 4; 4 0 0; 0 5 0; 0 5 4; 4 5 4; 4 5 0; ];
elementnodes=elementNodes=[1 5;2 6;3 7; 4 8; 5 6; 6 7; 7 8; 8 5];
xx=nodeCoordinates(:,1);
yy=nodeCoordinates(:,2);
zz=nodeCoordinates(:,3);
plot3(xx,yy,zz,,'k--')
The code should have given a single storey space frame with 4 coulmns. But it gives some random straight lines. What am I doing wrong in the code

采纳的回答

Walter Roberson
Walter Roberson 2019-2-9
use patch() with 'Faces' elementnodes and 'Vertices' NodeCoordinates
  7 个评论
Walter Roberson
Walter Roberson 2020-11-25
nodeCoordinates=[0 0 0; 0 0 4; 4 0 4; 4 0 0; 0 5 0; 0 5 4; 4 5 4; 4 5 0; ];
elementNodes = [1 4 3 2; 5 8 7 6; 1 2 6 5; 3 4 8 7; 2 3 7 6; 1 5 8 4];
patch('Faces', elementNodes, 'Vertices', nodeCoordinates, 'Facecolor', 'none'); view(3)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by