![]() |
![]() |
![]() |
Home Toolbox functions Sample projects Tutorials Downloads |
|
Associate geometric primitives, such as spheres, cylinder, and blocks, with the observers defined thus far. To represent the tire geometry, arrange a large collection of short cylinders along the length of the tire to give an illusion of a continuous tube. In the MAMBO toolbox, type >N:=100; Proceed similarly to represent the metal support of the wheel, including the metal rim, the spokes, and the hub. In the MAMBO toolbox, type >DefineObjects(seq([B,'Cylinder', point=MakeTranslations(b,95/100*R*cos(2*pi/N*(k-1)),95/100*R*sin(2*pi/N*(k-1)),0),orient=MakeRotations([Pi/2,1],[2*pi/N*(k-1),2]),color=white,radius=R/20,length=1.05*2*pi/N],k=1..N)); >DefineObjects(B,'Cylinder',color=red,radius=R/5,length=R/30); >DefineObjects(B,'Cylinder',point=MakeTranslations(b,0,0,R/30),color=black,radius=R/10,length=R/30); >DefineObjects(B,'Cylinder',point=MakeTranslations(b,0,0,-R/30),color=black,radius=R/10,length=R/30); >DefineObjects(B,'Cylinder',point=MakeTranslations(b,0,0,2*R/30),color=red,radius=R/20,length=R/30); >DefineObjects(B,'Cylinder',point=MakeTranslations(b,0,0,-2*R/30),color=red,radius=R/20,length=R/30); >Spokes:=12; >b1:=MakeTranslations(b,1);b2:=MakeTranslations(b,2);b3:=MakeTranslations(b,3); >w1:=MakeTranslations(w,1);w2:=MakeTranslations(w,2);w3:=MakeTranslations(w,3); >for k to Spokes do DeclarePoints(cat(Sp1,k),cat(Sp2,k)); DefinePoints(B,cat(Sp1,k),b,R/20*cos(2*Pi/Spokes*(k-1)),R/20*sin(2*Pi/Spokes*(k-1)),2*R/30); DefinePoints(B,cat(Sp2,k),b,9/10*R*cos(2*Pi/Spokes*(k-1)+Pi/3),9/10*R*sin(2*Pi/Spokes*(k-1)+Pi/3),0); temp:=FindTranslation(cat(Sp1,k),cat(Sp2,k)); t3:=(1/VectorLength(temp)) &** temp; t1:=(1/VectorLength(b3 &xx t3)) &** (b3 &xx t3); t2:=t3 &xx t1; DefineObjects(B,'Cylinder',point=(1/2) &** (FindTranslation(B,cat(Sp1,k)) &++ FindTranslation(B,cat(Sp2,k))),orient=matrix(3,3,(i,j)->cat(b,i) &oo cat(t,j)),radius=R/100,length=VectorLength(temp),color=green); od; >for k to Spokes do DeclarePoints(cat(Sp3,k),cat(Sp4,k)); DefinePoints(B,cat(Sp3,k),b,R/20*cos(2*Pi/Spokes*(k-1)),R/20*sin(2*Pi/Spokes*(k-1)),-2*R/30); DefinePoints(B,cat(Sp4,k),b,9/10*R*cos(2*Pi/Spokes*(k-1)-Pi/5),9/10*R*sin(2*Pi/Spokes*(k-1)-Pi/5),0); temp:=FindTranslation(cat(Sp3,k),cat(Sp4,k)); t3:=(1/VectorLength(temp)) &** temp; t1:=(1/VectorLength(b3 &xx t3)) &** (b3 &xx t3); t2:=t3 &xx t1; DefineObjects(B,'Cylinder',point=(1/2) &** (FindTranslation(B,cat(Sp3,k)) &++ FindTranslation(B,cat(Sp4,k))),orient=matrix(3,3,(i,j)->b.i &oo t.j),radius=R/100,length=VectorLength(temp),color=green); od; Associate a MAMBO block with the world observer to represent the horizontal plane. In the MAMBO toolbox, type >DefineObjects(W,'Block',point=MakeTranslations(w,0,0,-thickness/2),color=yellow,xlength=width,ylength=length,zlength=thickness); |
|
©2004-2017 Harry Dankowicz Mechanical Science and Engineering University of Illinois at Urbana-Champaign | Home Toolbox functions Sample projects Tutorials Downloads |