/* Greenhouse macro. 6/29/1001 Oliver Knill, Harvard University Given 8 Points P1,P2, ... P8, build a glasshouse open one one side +--------------------------------------+ / P8 /| P7 nz / / | / / | P4 +--------------------------------------+ P3| | | | | P5 D---- C | + P6 ny + | | + / | A-----B | / | |/ P1 +--------------------------------------+ P2 nx */ #declare glass_1001 = texture { pigment { color rgbf<1.0, 1.0, 1.0, 0.7> } finish { specular 1 roughness 0.001 ambient 0 diffuse 0 reflection 0.1 } } #declare white_wood = texture { pigment { color rgb<1.0, 1.0, 1.0> } finish { specular 1 ambient 0 diffuse 0.3 reflection 0.7 } } #macro window(P1,P2,P3,P4,nx,ny,r) union { #local i=0; #while (i; // normal to roof #local dd=vdot(NN,PP3)/sqrt(vdot(NN,NN)); // distance of roof to origin window(PP2,PP6,PP8,PP3,nz,ny,r) window1(PP3,PP8,PP7,PP10,nz,ny,r,NN,dd) union { sphere{ PP1, r } sphere{ PP2, r } sphere{ PP3, r } sphere{ PP4, r } sphere{ PP5, r } sphere{ PP6, r } sphere{ PP8, r } sphere{ PP7, r } texture { white_wood } } #end