// GEAR / Chevron Gear '09.04 // By Tsutomu HIGO URL: http://www.asahi-net.or.jp/~nj2t-hg/index.htm #version 3.6; global_settings { max_trace_level 5 assumed_gamma 2.2 } #declare T = -0.3; //#declare T = clock; camera { location <150, 50, -150> angle 16 look_at <-5, -6, -0> } light_source {<54, 36, -170> color rgb <0.8, 0.9, 1>} #macro Cogw46 (K1, K2, Rd, Rc, Nc, Wc, Daxis, Da, Na, Rw, Rwo) #declare Rw = Rc/sin(pi/2/Nc); #declare Rwo = Rw*cos(pi/2/Nc); #declare Rco = Rc*(1/tan(pi/2/Nc)-K2*sqrt(K1*K1-1)); #declare Rct = Rco+K1*K2*Rd*Rc; #declare Rctc = Rct-0.05*Rc; #declare Rci = 2*Rwo-Rct; intersection { cylinder {<0, -Wc-0.01, 0>, <0, +Wc+0.01, 0>, Daxis inverse} // a hole for the axis of the gear cylinder {<0, -Wc/2, 0>, <0, +Wc/2, 0>, Rctc} //the external diameter of the gear merge { #declare Nm = 0; #while (Nm < Nc) cylinder {<0, -Wc, 0>, <0, +Wc, 0>, Rc*K1*Rd scale rotate x*Da translate x*Rco rotate y*360/Nc*Nm} //cog of the gear #declare Nm = Nm+1; #end cylinder {<0, -Wc, 0>, <0, +Wc, 0>, Rci} //Body of the gear } rotate y*360/Nc*Na } #end #declare Rw1 = 0; #declare Rw2 = 0; #declare Cp1 = 0; #declare Cp2 = 0; merge { #declare N = 1; #while (N < 8) object {Cogw46 (1.3, 2.5, 0.97, 1, 20, 2.01, 3, 30, T*N, Rw1, Cp1) translate x*Cp1 translate y*2*(N+1)} object {Cogw46 (1.3, 2.5, 0.97, 1, 12, 2.01, 3, -30, 0.5-T*N, Rw2, Cp2) translate x*-Cp2 translate y*2*(N+1)} #declare N = N+1; #end #declare N = 1; #while (N < 8) object {Cogw46 (1.3, 2.5, 0.97, 1, 20, 2.01, 3, -30, T*N, Rw1, Cp1) translate x*Cp1 translate y*-2*(N+1)} object {Cogw46 (1.3, 2.5, 0.97, 1, 12, 2.01, 3, 30, 0.5-T*N, Rw2, Cp2) translate x*-Cp2 translate y*-2*(N+1)} #declare N = N+1; #end intersection { cylinder {<-Cp2, -2*8-3, 0>, <-Cp2, 2*8+3, 0>, 3 inverse} //a hole for the axis of the gear cylinder {<-Cp2, -2*8-2, 0>, <-Cp2, 2*8+2, 0>, 5} //the external diameter of the gear } intersection { cylinder {, , 3 inverse} //a hole for the axis of the gear cylinder {, , 9} //the external diameter of the gear } rotate y*70 rotate z*-105 texture { pigment {color rgbt <0.7, 0.7, 0, 0.8>} finish { ambient 0.5 phong 0.3 reflection 0.6 specular 0.8 brilliance 1 } } } background {color rgb <0.02, 0.08, 0.15>}