中の歯車の形状

 中の歯車の形状を定義します。

 //**********************************************************************************

  #local Lw=40;

  #local Cogwheel_m =

  union {

   difference {

   cylinder { 0,y,Lw }

   #local Ei=pi*Lw/2.6; #local Si=0; #while( Si < Ei )

    sphere { 0,2 scale < 2,1,1 > translate Lw*x rotate 360*Si/Ei*y }

   #local Si=Si+1; #end

   cylinder { -0.01*y,(1+0.01)*y,Lw-10 }

   }

   #local Ei=5; #local Si=0; #while( Si < Ei )

   box { < Lw/2-5,0,-5 >,< Lw-5,1,5 > rotate 360*Si/Ei*y }

   #local Si=Si+1; #end

   cylinder {0,y,Lw/2 }

   cylinder { -1*y,2*y,Lw/2-10 }

   cylinder { -5*y,4*y,Lw/8 }

  }

 //**********************************************************************************