大の歯車の形状

 大きい歯車の形状を定義します。
 //**********************************************************************************
  #local Lw=60;
  #local Cogwheel_l =
  union {
   difference {
   cylinder { 0,y,Lw }
   #local Ei=pi*Lw/2.59; #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 }
   difference {
   cylinder { -1*y,3*y,(Lw/2-10) }
   #local Ei=pi*(Lw/2-10)/2.6; #local Si=0; #while( Si < Ei )
    sphere { y,3 scale < 2,1,1 > translate (Lw/2-8)*x rotate (360*Si/Ei+20)*y }
   #local Si=Si+1; #end
   }
   cylinder { -5*y,4.5*y,Lw/8 }
  }
 //**********************************************************************************