#declare m = 100; #declare cm = m/100; #declare mm = cm/10; global_settings { noise_generator 3 photons {spacing exp(-4) load_file "Invisible20.photons"} radiosity { media on error_bound 1.2 count 50 nearest_count 8 } } camera { location <-12*cm, +20*cm, -35*cm> look_at <0, 0, 0> } light_source {<+10*cm, +30*cm, -35*cm>, colour rgb 1} // Define drawing macros... #include "transforms.inc" #declare Radius = 2*mm; #macro DrawPoly(Points) #local A = Points[0]; #local B = Points[1]; #local C = Points[2]; #local AB = B - A; #local AC = C - A; #local Norm = vnormalize(vcross(AB, AC)); #local V1 = Norm; #local V2 = vnormalize(AB); #local V3 = vcross(V1, V2); prism { linear_sweep linear_spline -Radius, +Radius, dimension_size(Points, 1), #local lp = 0; #while (lp < dimension_size(Points, 1)) #local lp = lp + 1; #end translate +y*vdot(A, Norm) Reorient_Trans(y, Norm) } #end #macro DrawPrism(Points) #local X1 = Points[0].x; #local Y1 = Points[0].y; #local lp = 1; #while (lp < dimension_size(Points, 1)) sphere {, Radius} sphere {, Radius} cylinder {, , Radius} #local X2 = Points[lp].x; #local Y2 = Points[lp].y; cylinder {, , Radius} cylinder {, , Radius} #local Poly = array[4] {, , , } DrawPoly(Poly) #local X1 = X2; #local Y1 = Y2; #local lp = lp + 1; #end prism { linear_sweep linear_spline -1*cm - Radius, +1*cm + Radius, dimension_size(Points, 1), #local lp = 0; #while (lp < dimension_size(Points, 1)) #local lp = lp + 1; #end rotate -90*x } #end #declare PointsI = array[13] { <-4*cm, -5*cm>, <+4*cm, -5*cm>, <+4*cm, -3*cm>, <+1*cm, -3*cm>, <+1*cm, +3*cm>, <+4*cm, +3*cm>, <+4*cm, +5*cm>, <-4*cm, +5*cm>, <-4*cm, +3*cm>, <-1*cm, +3*cm>, <-1*cm, -3*cm>, <-4*cm, -3*cm>, <-4*cm, -5*cm> }; #declare PointsN = array[11] { <-4*cm, -5*cm>, <-4*cm, +5*cm>, <-2*cm, +5*cm>, <+2*cm, -2*cm>, <+2*cm, +5*cm>, <+4*cm, +5*cm>, <+4*cm, -5*cm>, <+2*cm, -5*cm>, <-2*cm, +2*cm>, <-2*cm, -5*cm>, <-4*cm, -5*cm> }; #declare PointsV = array[8] { <-4*cm, +5*cm>, <-1*cm, -5*cm>, <+1*cm, -5*cm>, <+4*cm, +5*cm>, <+2*cm, +5*cm>, < 0*cm, -2*cm>, <-2*cm, +5*cm>, <-4*cm, +5*cm> }; #declare ObjectS_Top = merge { difference { merge { difference { merge { cylinder {<0*cm, +2*cm, -1*cm>, <0*cm, +2*cm, +1*cm>, 3*cm + Radius} // Outside (Middle) cylinder {<0*cm, +2*cm, -1*cm - Radius>, <0*cm, +2*cm, +1*cm + Radius>, 3*cm} // Outside (Edges) torus {3*cm, Radius rotate +90*x translate <0*cm, +2*cm, -1*cm>} // Front outer rounding torus {3*cm, Radius rotate +90*x translate <0*cm, +2*cm, +1*cm>} // Back outer rounding } cylinder {<0*cm, +2*cm, -2*cm>, <0*cm, +2*cm, +2*cm>, 1*cm - Radius} // Center cylinder {<0*cm, +2*cm, -1*cm>, <0*cm, +2*cm, -2*cm>, 1*cm} // Front edge cylinder {<0*cm, +2*cm, +1*cm>, <0*cm, +2*cm, +2*cm>, 1*cm} // Back edge } torus {1*cm, Radius rotate +90*x translate <0*cm, +2*cm, -1*cm>} // Front inner rounding torus {1*cm, Radius rotate +90*x translate <0*cm, +2*cm, +1*cm>} // Back inner rounding } box {<0*cm, -5*cm, -2*cm>, <+5*cm, +2*cm, +2*cm>} // Cutout } sphere {<+1*cm, +2*cm, -1*cm>, Radius} // Front Left Corner sphere {<+3*cm, +2*cm, -1*cm>, Radius} // Front Right Corner sphere {<+1*cm, +2*cm, +1*cm>, Radius} // Back Left Corner sphere {<+3*cm, +2*cm, +1*cm>, Radius} // Back Right Corner cylinder {<+1*cm, +2*cm, -1*cm>, <+3*cm, +2*cm, -1*cm>, Radius} // Front Edge cylinder {<+1*cm, +2*cm, +1*cm>, <+3*cm, +2*cm, +1*cm>, Radius} // Back Edge cylinder {<+1*cm, +2*cm, -1*cm>, <+1*cm, +2*cm, +1*cm>, Radius} // Inside Edge cylinder {<+3*cm, +2*cm, -1*cm>, <+3*cm, +2*cm, +1*cm>, Radius} // Outside Edge box {<+1*cm, +2*cm - Radius, -1*cm>, <+3*cm, +2*cm, +1*cm>} } #declare ObjectS = merge { object {ObjectS_Top} object {ObjectS_Top rotate 180*z} } #declare ObjectI = merge {DrawPrism(PointsI)} #declare ObjectN = merge {DrawPrism(PointsN)} #declare ObjectV = merge {DrawPrism(PointsV)} object { union { object {ObjectI translate -20*cm*x} object {ObjectN translate -10*cm*x} object {ObjectV translate +0*cm*x} object {ObjectI translate +10*cm*x} object {ObjectS translate +20*cm*x} object {ObjectI translate +30*cm*x} } hollow texture { pigment {rgbt 1} finish { ambient 0 specular 0.8 reflection {0.2, 0.8 fresnel} conserve_energy } } interior { ior 1.5 media {absorption rgb <0.05, 0.02, 0.0>} } photons { target on collect off reflection on refraction on } } // Ground object { plane {+y, -5.1*cm} texture { /*pigment { wrinkles colour_map { [0 colour rgb <0.4, 0.4, 0.4>] [1 colour rgb <0.9, 0.9, 0.9>] } scale 5*cm }*/ pigment{rgb 1} finish { ambient 0 } } } // Sky object { sphere {0, 10*m} hollow texture { pigment { gradient y colour_map { [0 colour rgb <0.9, 1.0, 1.0>] [1 colour rgb <0.7, 0.8, 0.9>] } scale 10*m translate -5*cm } finish { ambient 1 diffuse 0 } } }