// GEAR / Spiral Bevel 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.25; //#declare T = clock; camera { location <-50, 120, 80> angle 13 look_at <9, -12, -2> } light_source {<54, 36, -170> color rgb <0.8, 0.9, 1>} #macro Cogw48 (K1, K2, Rd, Rc, Nc, Wc, Daxis, Na, Rw, Rwo, Az, Ac) #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; merge { intersection { cone {<0, -Wc, 0>, (Rco+(Rctc-Rco)/cos(Az/180*pi))*(Rco/tan(Az/180*pi)+Wc)/(Rco/tan(Az/180*pi)), <0, Rco/tan(Az/180*pi), 0>, 0} //the external diameter of the gear cone {<0, -Wc*tan(Az/180*pi)*sin(Az/180*pi), 0>, Rco-Wc*tan(Az/180*pi)*cos(Az/180*pi), <0, 2*Wc, 0>, Rco+2*Wc/tan(Az/180*pi)} //body's bottom of the gear cone {<0, Wc*cos(Az/180*pi)-(Rco/tan(Az/180*pi)-Wc)*tan(Az/180*pi/3)*sin(Az/180*pi), 0>, Rco-Wc*sin(Az/180*pi)-(Rco/tan(Az/180*pi)-Wc)*tan(Az/180*pi/3)*cos(Az/180*pi), <0, Wc*cos(Az/180*pi)+2*Wc, 0>, Rco-Wc*sin(Az/180*pi)+2*Wc/tan(Az/180*pi) inverse} //body's top of the gear cylinder {<0, -2*Wc, 0>, <0, 3*Wc, 0>, Daxis inverse} //hole for the axis of the gear merge { #declare Nm = 0; #while (Nm < Nc) cone {, Rc*K1*Rd*(K2), <0, Rco/tan(Az/180*pi), 0>, 0 scale <1, 1, 1/K2*cos(Ac/180*pi)> rotate x*Ac rotate y*360/Nc*Nm} //cog of the gear #declare Nm = Nm+1; #end cone {<0, -Wc, 0>, (Rco+(Rci-Rco)/cos(Az/180*pi))*(Rco/tan(Az/180*pi)+Wc)/(Rco/tan(Az/180*pi)), <0, Rco/tan(Az/180*pi), 0>, 0} //body of the gear } } intersection { cylinder {<0, -3*Wc, 0>, <0, 3*Wc, 0>, Daxis inverse} //hole for the axis of the gear cylinder {<0, -1.6*Wc, 0>, <0, 0, 0>, Rco-Wc*tan(Az/180*pi)*cos(Az/180*pi)+1} } rotate y*360/Nc*Na } #end #declare Rw1 = 0; #declare Rw2 = 0; #declare Cp1 = 0; #declare Cp2 = 0; union { object {Cogw48 (1.3, 2.5, 0.97, 1, 20, 4, 3, T, Rw1, Cp1, 50, 30) translate x*Cp1} object {Cogw48 (1.3, 2.5, 0.97, 1, 12, 4, 2.4, 0.5-T, Rw2, Cp2, 40, -30) translate x*-Cp2+0.1 rotate z*-90} rotate y*300 rotate z*25 texture { pigment {color rgbt <0.7, 0.7, 0, 0.8>} finish { ambient 0.5 phong 0.1 reflection 0.9 specular 0.8 brilliance 1 } } } background { color rgb <0.02, 0.08, 0.15> }