#macro house(hwidth,hdepth,hheight,pitch)

  #local p1 = <hwidth/2,0>;
  #local p2 = <-hwidth/2,0>;
  #local p4 = <0,hheight>;
  #local p3 = <-hwidth/2,hheight-pitch>;
  #local p5 = <hwidth/2,hheight-pitch>;

  #local pa = 1.1*(p3-p4)+p4;
  #local pb = p4;
  #local pc = 1.1*(p5-p4)+p4;
  
  union{
    prism{
      hdepth/2,-hdepth/2,6
      p1,p2,p3,p4,p5,p1
      }
    prism{
      1.1*hdepth/2,-1.1*hdepth/2,7
      pa,pb,pc,pc+<0,.05>,pb+<0,.05>,pa+<0,.05>,pa
      }
    texture{ bark_tex }
    rotate -90*x
  }
  
#end
       