global_settings { assumed_gamma 1.0 max_trace_level 255 } camera { location <0, 14, -20> direction z right x*image_width/image_height look_at <0, 1, 0> } plane { y, 0 texture{ pigment{ gradient z color_map{ [0.0 rgb 0.5] [0.05 rgb 0.5] [0.05 rgb 1] [1.0 rgb 1] } scale 5*z translate 2*z } finish{ambient 0 diffuse 1} } texture{ pigment{ gradient x color_map{ [0.0 rgb 0.5] [0.05 rgb 0.5] [0.05 rgbt 1] [1.0 rgbt 1] } scale 5*x } finish{ambient 0 diffuse 1} } translate -0.01*y } sphere { 0,1 texture { pigment { color rgb 1 } finish { diffuse 0 ambient 0.1 } } hollow on no_shadow scale 10000 } sphere { 0,5 texture { pigment { color rgb 1 } finish { diffuse 0 ambient 4.5 } } translate 18*y+18*x-3*z } #macro rouleau(height,out_radius,corner_radius) merge { torus { out_radius-corner_radius, corner_radius translate height*y-corner_radius*y } cylinder { height*y-2*corner_radius*y, height*y, out_radius-corner_radius } cylinder { corner_radius*y, height*y-corner_radius*y, out_radius } cylinder { 0, 2*corner_radius*y, out_radius-corner_radius } torus { out_radius-corner_radius, corner_radius translate corner_radius*y } } #end #declare hole_radius = 1.5; #declare max_radius = 4.0; #declare max_height = 4.0; #declare round_radius = 0.2; #declare space = 0.3; #macro the_obj(texture_body,texture_rouleau) union { object { rouleau(max_height,hole_radius-space/2,round_radius) texture { texture_rouleau } translate max_radius/2*x } object { rouleau(max_height,hole_radius-space/2,round_radius) texture { texture_rouleau } translate max_radius/2*x rotate 360/3*y } object { rouleau(max_height,hole_radius-space/2,round_radius) texture { texture_rouleau } translate max_radius/2*x rotate 360*2/3*y } object { difference { rouleau(max_height,max_radius,0.2) cylinder { -0.001*y, max_height*y+0.001*y, hole_radius translate max_radius/2*x } cylinder { -0.001*y, max_height*y+0.001*y, hole_radius translate max_radius/2*x rotate 360/3*y } cylinder { -0.001*y, max_height*y+0.001*y, hole_radius translate max_radius/2*x rotate 360*2/3*y } } texture { texture_body } interior { ior 1.33 } } } #end #declare simple_texture = 0; #declare texture_rouleau_1 = texture { pigment { color rgb <0.9,0.6,0.6> } #if (simple_texture) finish { ambient 0 diffuse 1 } #else finish { reflection { 0.1, 0.8 fresnel on } ambient 0 diffuse 1 } #end } #declare texture_body_1 = texture { pigment { color rgb <0.6,0.6,0.9> } finish { ambient 0 diffuse 1 } } #declare texture_rouleau_2 = texture { pigment { color rgb <0.9,0.9,0.2> } finish { ambient 0 diffuse 1 } } #declare texture_body_2 = texture { #if (simple_texture) pigment { color rgb <0.9,0.6,0.6> } finish { ambient 0 diffuse 1 } #else pigment { color rgbf <0.9,0.9,0.9,0.9> } finish { reflection { 0.1, 0.8 fresnel on } ambient 0 diffuse 0 } #end } #declare texture_rouleau_3 = texture { pigment { color rgb <0.6,0.9,0.6> } #if (simple_texture) finish { ambient 0 diffuse 1 } #else finish { reflection { 0.1, 0.8 fresnel on } ambient 0 diffuse 1 } #end } #declare texture_body_3 = texture { #if (simple_texture) pigment { color rgb <0.9,0.9,0.9> } finish { ambient 0 diffuse 1 } #else pigment { color rgb <0.9,0.9,0.9> } finish { reflection {1.0} ambient 0 diffuse 0 } #end } object { the_obj(texture_body_1,texture_rouleau_1) } object { the_obj(texture_body_2,texture_rouleau_2) rotate 33*y rotate -35*z rotate -20*x translate 6.5*x+2.5*y translate -max_height/2*z } object { the_obj(texture_body_3,texture_rouleau_3) translate -max_height/2*y rotate 90*x translate max_radius*y translate -max_radius*2*x+max_height/2*z rotate -45*y }