// Last edited on 2023-12-30 09:59:46 by stolfi #declare tx_gaiola = texture { pigment{ color rgb < 0.200, 0.400, 0.000 > } finish{ diffuse 0.3 ambient 0.7 } } #macro gaiola(cmin,cmax) #local R = 0.5*vlength(cmax-cmin); #local r = 0.003*R; #local p000 = < cmin.x, cmin.y, cmin.z >; #local p001 = < cmin.x, cmin.y, cmax.z >; #local p010 = < cmin.x, cmax.y, cmin.z >; #local p011 = < cmin.x, cmax.y, cmax.z >; #local p100 = < cmax.x, cmin.y, cmin.z >; #local p101 = < cmax.x, cmin.y, cmax.z >; #local p110 = < cmax.x, cmax.y, cmin.z >; #local p111 = < cmax.x, cmax.y, cmax.z >; union{ sphere{ p000, r } sphere{ p001, r } sphere{ p010, r } sphere{ p011, r } sphere{ p100, r } sphere{ p101, r } sphere{ p110, r } sphere{ p111, r } cylinder{ p000, p001, r } cylinder{ p010, p011, r } cylinder{ p100, p101, r } cylinder{ p110, p111, r } cylinder{ p000, p010, r } cylinder{ p100, p110, r } cylinder{ p001, p011, r } cylinder{ p101, p111, r } cylinder{ p000, p100, r } cylinder{ p001, p101, r } cylinder{ p010, p110, r } cylinder{ p011, p111, r } texture{ tx_gaiola } } #end #macro gaipiso(cmin,cmax) #local tad = 0.005*vlength(cmax-cmin); #local tx_piso = texture { pigment { color rgb < 1.000, 0.800, 0.500 > } finish { diffuse 0.7 ambient 0.3 } } box{ cmin - 2*tad*z, < cmax.x, cmax.y, cmin.z > - tad*z texture{ tx_piso }} #end #macro gaichao(cmin,cmax) #local bmin = 3.5*cmin-2.5*cmax; #local bmax = 3.5*cmax-2.5*cmin; #local tad = 0.005*vlength(cmax-cmin); #local tx_chao = texture { pigment { color rgb < 0.800, 0.900, 0.700 > } finish { diffuse 0.9 ambient 0.1 } } box{ < bmin.x, bmin.y, cmin.z-2*tad >, < bmax.x, bmax.y, cmin.z-tad > texture{ tx_chao }} #end