//the vending machine declare cover= union{ //middle part object {box {<55,480,-0.00001><247,589,150>} //pigment {White} pigment{image_map { gif "battery.gif" interpolate 2 map_type 0 }scale <240,170,200> translate <30,280,-1>} } object {box {<55,480,5><247,594,145>} pigment {White} } object {cylinder {<55,589,5>,<247,589,5>, 5 }pigment {White} } object {cylinder {<55,589,145>,<247,589,145>, 5 }pigment {White} } //left part object {box {<5,480,0><55,539,150>} pigment {White} } object {box {<0,480,5><55,539,145>} pigment {White} } object {cylinder {<5,480,5>,<5,539,5>, 5 }pigment {White} } object {cylinder {<55,539,5>,<55,539,145>, 55 }pigment {White} } object {cylinder {<55,539,0>,<55,539,150>, 50 }pigment {White} } object {torus {50,5}pigment {White} rotate x*90 translate <55,539,5>} //right part object {box {<247,480,0><297,539,150>} pigment {White} } object {box {<247,480,5><302,539,150>} pigment {White} } object {cylinder {<297,480,5>,<297,539,5>, 5 }pigment {White} } object {cylinder {<247,539,5>,<247,539,145>, 55 }pigment {White} } object {cylinder {<247,539,0>,<247,539,150>, 50 }pigment {White} } object {torus {50,5}pigment {White} rotate x*90 translate <247,539,5>} } //control element #declare control=union{ //box object {box {<5,0,0><297,480,150>} object {cylinder {<0,0,0>,<302,0,0>,3 }scale y*2 translate y*480 texture {Chrome_Texture}} object {cylinder {<0,0,0>,<0,0,150>,3 }scale y*2 translate y*480 texture {Chrome_Texture}} object {cylinder {<302,0,0>,<302,0,150>,3 }scale y*2 translate y*480 texture {Chrome_Texture}} object {sphere {<0,0,0>,3}scale y*2 translate y*480 texture {Chrome_Texture} } object {sphere {<302,0,0>,3}scale y*2 translate y*480 texture {Chrome_Texture} } object {box {<165,170,-40><285,445,10>} pigment {Red} } object {box {<160,175,-40><290,440,10>} pigment {Red} } //outer frame object {cylinder {<165,175,-40>,<165,175,10>, 5 }pigment {Red} } object {cylinder {<165,440,-40>,<165,440,10>, 5 }pigment {Red} } object {cylinder {<285,175,-40>,<285,175,10>, 5 }pigment {Red} } object {cylinder {<285,440,-40>,<285,440,10>, 5 }pigment {Red} } object {cylinder {<165,175,-40>,<165,440,-40>, 5 }pigment {Red} } object {cylinder {<285,175,-40>,<285,440,-40>, 5 }pigment {Red} } object {cylinder {<165,175,-40>,<285,175,-40>, 5 }pigment {Red} } object {cylinder {<165,440,-40>,<285,440,-40>, 5 }pigment {Red} } object {sphere {<165,175,-40>,5} pigment {Red} } object {sphere {<285,175,-40>,5} pigment {Red} } object {sphere {<165,440,-40>,5} pigment {Red} } object {sphere {<285,440,-40>,5} pigment {Red} } object {object {cylinder {<180,190,-40><226,190,-40>, 5 }texture {Chrome_Texture}} } object {object {cylinder {<180,190,-40><180,216,-40>, 5 }texture {Chrome_Texture}} } object {object {cylinder {<180,216,-40><226,216,-40>, 5 }texture {Chrome_Texture}} } object {object {cylinder {<226,190,-40><226,216,-40>, 5 }texture {Chrome_Texture}} } object {sphere {<180,190,-40>,5} texture {Chrome_Texture}} object {sphere {<226,190,-40>,5} texture {Chrome_Texture}} object {sphere {<180,216,-40>,5} texture {Chrome_Texture}} object {sphere {<226,216,-40>,5} texture {Chrome_Texture}} //returned money object {object {cylinder {<250,260,-40><270,260,-40>, 3 }texture {Chrome_Texture}} } object {object {cylinder {<250,290,-40><270,290,-40>, 3 }texture {Chrome_Texture}} } object {object {cylinder {<250,260,-40><250,290,-40>, 3 }texture {Chrome_Texture}} } object {object {cylinder {<270,260,-40><270,290,-40>, 3 }texture {Chrome_Texture}} } object {sphere {<250,260,-40>,3} texture {Chrome_Texture}} object {sphere {<270,260,-40>,3} texture {Chrome_Texture}} object {sphere {<250,290,-40>,3} texture {Chrome_Texture}} object {sphere {<270,290,-40>,3} texture {Chrome_Texture}} } #declare sign1 =union{ object {cylinder {<175,430,-40>,<275,430,-40>, 3 }texture {Chrome_Texture}} object {cylinder {<175,390,-40>,<275,390,-40>, 3 }texture {Chrome_Texture}} object {box {<195,390,-41><275,430,10>} pigment {Black} pigment{image_map { gif "coins.gif" map_type 0 }scale <80,35,1>translate <35,10,0> }} object {box {<175,393,-44><195,422,-42>}texture {Chrome_Texture normal {bumps scale 0.2}}} object {cylinder {<185,422,-44>,<185,422,-42>, 10 } texture {Chrome_Texture normal {bumps scale 0.1}}} } //text #declare sign2 =union{ object {cylinder {<175,430,-40>,<275,430,-40>, 3 }texture {Chrome_Texture}} object {cylinder {<175,390,-40>,<275,390,-40>, 3 }texture {Chrome_Texture}} object {box {<175,390,-41><275,430,10>} pigment {Black} pigment{image_map { gif "drop.gif" map_type 0 }scale <100,35,1>translate <75,7.55,80> }finish {Luminous}} // -20 +20 } #declare control_plate = difference { object{control} object{ box {<180,190,-50><226,216,10>}pigment {Black}} object{ box {<250,260,-50><270,290,10>}pigment {Black}} } //assemble the body #declare body=union { object {box {<5,0,0><297,480,150>} pigment{image_map { gif "cell2.gif" map_type 0 } scale <550,550,1>translate <-95,0,0> }} object {box {<0,0,5><302,480,150>} pigment {Red}} object {cylinder {<5,0,5>,<5,480,5>, 5 }pigment {Red} } object {cylinder {<297,0,5>,<297,480,5>, 5 }pigment {Red} } } #declare lever= union{ object {cylinder {<0,0,0>,<0,30,0>,3}texture {Chrome_Texture}} object {sphere {<0,0,0>,3} scale <1.,7,3> translate <0,30,0> texture {Chrome_Texture}} object {sphere {<0,0,0>,3} texture {Chrome_Texture}} } //assemble the machine #declare vending_machine= union { object {cover} object {control_plate} object {sign2} object {sign1 translate -y*45} object {lever scale <1.5, 0.8,1> rotate -z*45 translate <195,290,-40> } object {body} }