// GEAR / Helical 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, 100> angle 15 look_at <-1.9, 5, -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 og 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; union { object {Cogw46 (1.3, 2.5, 0.97, 1, 20, 4, 3, 30, T, Rw1, Cp1) translate x*Cp1} object {Cogw46 (1.3, 2.5, 0.97, 1, 12, 4, 3, -30, 0.5-T, Rw2, Cp2) translate x*-Cp2} rotate y*140 rotate z*-15 translate <2.8,0,1.3> 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>}