#include "colors.inc" camera { location <0, .1, -30> look_at <0, 0, 0> angle 40 } background { color Gray25 } //to make the patch easier to see light_source { <300, 300, -300> White } plane { y, -12 texture { pigment { color rgb <1, 0, 0> } } } #declare a = cylinder { <0, 6, 0>, // Center of one end <0, -1, 0>, // Center of other end 3 // Radius pigment { color rgb <1,0,0> } } #declare b = plane { <0, 1, 0>, -1 pigment { checker color Black, color White } } #declare porta = cylinder { <0, -1, 3>, // Center of one end <0, -1, -3>, // Center of other end 1.0 // Radius pigment { color rgb <1,1,1> } } #declare j = 1; #declare g = seed(pi); difference{ union{ object{a} object{b} object{porta} } union { #while (j<6) #if (rand(g)<0.75) #declare i = 1; #while (i<4) #if (rand(g)<0.75) cylinder { <-2.0 + i, 0.25 + j, 3>, // Center of one end <-2.0 + i, 0.25 + j, -3>, // Center of other end 0.30 // Radius pigment { color rgb <1,1,1> } } #end #declare i = i + 1; #end #end #declare j = j + 1; #end } union { #while (j<6) #if (rand(g)<0.75) #declare i = 1; #while (i<4) #if (rand(g)<0.75) cylinder { <-2.0 + i, 0.25 + j, 3>, // Center of one end <-2.0 + i, 0.25 + j, -3>, // Center of other end 0.30 // Radius pigment { color rgb <1,1,1> } rotate 90*z } #end #declare i = i + 1; #end #end #declare j = j + 1; #end } }