//the great Sprock macro, building sprockets for your rear cassette // //begun 072106 dy dookiex // well, hell, the front ring too! 51 so it's divisible by 3, 101808 #version 3.6; global_settings{assumed_gamma 1.0} #include "metals.inc" // ---------------------------------------- // set a color of the background (sky) // background { color rgb <0.1, 0.0, 0.2> } //camera {location<1.7, 1, -1> look_at<0.0, 0.0, 0.0>} //back short //camera {location<-2.7, .5, -2> look_at<0.0, 0.0, 0.0>} //hole??!! camera{location<-2.4,0,0> look_at<0,0,0>} light_source { <0, 0, 0> // light's position (translated below) color rgb <.7, .5, 1.3> // light's color //translate <-3,-3,3>} // before... translate <-2,-.5,.5>} #macro DrillHoles(holeString,sizOHole,holeLoc) #declare Looper=0; #while (Looper<.052,1,2>} box{<-.02,-2,0><.052,2,2> rotate 158*x #if (Looper=8) rotate 10*x //skinny slot #end } rotate Looper*40*x #if(Teeth=11) translate x*.05 #end #if(Teeth=12) scale x*2 #end } #declare Looper=Looper+1; #end // regular slots #declare Looper=0; #while (Looper translate y*Or rotate x*Looper*(360/Teeth) //holes between teeth } box{<.4,-.03,-.2> <.1,2,.2> rotate z*10 translate y*(Or-.13) //tooth trapezoiding rotate x*(Looper+.5)*(360/Teeth) } box{<0,-.03,-.2> <-.1,2,.2> rotate z*-10 translate y*(Or-.13) rotate x*(Looper+.5)*(360/Teeth) } #declare Looper=Looper+1; #end #if (strlen(holeList)>0) DrillHoles(holeList,holeSize,Or-.22-(holeSize*1.3)) #end }//close diff }//close object #end //macro #macro SSpacer() //black spacers between sproks difference{cylinder{0, .06*x,.7} cylinder{-.01*x,.061*x,.62} #declare Looper=0; #while (Looper<3) difference{cylinder{-.01*x,.061*x,.66} box{<-.02,-1,0><.052,1,2>} box{<-.02,-2,0><.052,2,2> rotate 158*x} rotate Looper*120*x} difference{cylinder{-.01*x,.061*x,.66} box{<-.02,-1,0><.052,1,2>} box{<-.02,-2,0><.052,2,2> rotate 114*x} rotate (Looper*120+54)*x} #declare Looper=Looper+1; #end } #end // macro object{Sprock(13) texture{T_Chrome_5E}} //object{SSpacer() pigment { color rgb <.1, .1, .1>} translate x*.04} //object{Sprock(15) texture{T_Chrome_5E} translate x*.1} //object{Sprock(16) texture{T_Chrome_5E} translate x*.2} /*object{Sprock(17) texture{T_Chrome_5E} translate x*.9} */ /*object{Sprock(13) texture{T_Chrome_5E} //rotate<0,15,20> translate x*.4} */ //object{Sprock(18) texture{T_Chrome_5E} translate x*.5} // //object{Sprock(21) texture{T_Chrome_5E} translate x*.6} /* box{<-.02,-1,0><.042,1,2> pigment { color rgb <1, 1, 0>} } cylinder{-.01*x,.041*x,.66 pigment { color rgb <1, 0, 0>} } box{<-.02,-2,0><.042,2,2> rotate 160*x pigment { color rgb <1, 0, 1>}} box{<.4,-.03,-.2> <.1,2,.2> rotate z*15 translate y*(Or-.13) pigment { color rgb <1, 0, 1>}} */ /* ^ | y | /----> z / / -x v */