필터 지우기
필터 지우기

How to make patch cylinder wheels for this semi truck?

조회 수: 3 (최근 30일)
Quincey Jones
Quincey Jones 2020년 3월 23일
댓글: Quincey Jones 2020년 3월 24일
figure
view(3)
grid on
%lorry
vertices_lorry = [0 1 0.5 ; 4 1 0.5; 6.5 1 0.5; 6.5 1 1.2; 6 1 1.3;...
5 1 1.8; 4 1 1.8; 4 1 2; 0 1 2; ... % postive y of lorry
0 -1 0.5; 4 -1 0.5; 6.5 -1 0.5; 6.5 -1 1.2; 6 -1 1.3;...
5 -1 1.8; 4 -1 1.8; 4 -1 2; 0 -1 2]; % negative y of lorry
faces_lorry_cargo = [10 1 9 18; 1 2 8 9; 8 9 18 17; 10 11 17 18; 7 8 17 16;...
1 2 11 10];
faces_lorry_driver = [7 6 15 16 16 16; 5 6 15 14 14 14; 5 4 13 14 14 14;...
3 4 13 12 12 12; 2 3 4 5 6 7; 11 12 13 14 15 16; 2 3 12 11 11 11];
patch('Faces',faces_lorry_cargo,'Vertices',vertices_lorry,'FaceColor','#86DA7D','EdgeColor','k');
patch('Faces',faces_lorry_driver,'Vertices',vertices_lorry,'FaceColor','#868686','EdgeColor','k');
I am trying to build a truck in Matlab but I cannot figure out how to place 4 different half cylinder "wheels" on the bottom. How can I do this?
The wheels should go around 180 deg from the bottom. the rear wheel is centered 1m from the back and the wheel base is 3.95. the wheels are 0.2m thick.

채택된 답변

darova
darova 2020년 3월 23일
Try this
t = linspace(0,2*pi,20)';
[x,y] = pol2cart(t,1); % create data for circle
v0 = x*0;
X = [v0 x x v0];
Z = [v0 y y v0];
Y = [v0-1 v0-1 v0+1 v0+1]*1.2;
hold on
surf(X,Y,Z,'facecolor','y') % draw wheel
surf(X+4,Y,Z,'facecolor','y') % draw wheel +4 position
hold off
axis vis3d
Experiment

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by