#version unofficial MegaPov 0.7;

#declare tombstone =
#if ( tstone_qual )
  union{
    isosurface {
      function{ ( -cos(x*2.75)/5 + y - 3 & (abs(x)-1) & (abs(y)-3.5) & (abs(z)-.26) ) - noise3d(x*85, y*85, z*85)*.005 - noise3d(x*45, y*45, z*45)*.013 - noise3d(x*15, y*15, z*15)*.024  }
      threshold 0
      sign 1
      contained_by { box { <-1.5,0,-.5>, <1.5,3.3,.5> } }
      texture{ stone_main_rough }
    }
    difference{
      isosurface {
        function{ ( -cos(x*2.75)/5 + y - 2.95 & (abs(x)-.96) & (abs(y)-3.5) & (abs(z)-.32) ) }
        threshold 0
        sign 1
        contained_by { box { <-1.5,0,-.6>, <1.5,3.2,.6> } }
      }
      height_field{
        png "gravestone_main_design.png"
        smooth
        translate <-.5,-.5,-.5>
        rotate -90*x
        scale <2.2,2.4,-.5>
        translate <0,1.8,-.4>
      }
    texture{ stone_main_shiny }
  }
    isosurface {
      function{ ((abs(x)-1.1) & (abs(y)-1) & (abs(z)-.5)) - noise3d(x*85, y*85, z*85)*.003 - noise3d(x*45, y*45, z*45)*.009 - noise3d(x*15, y*15, z*15)*.018 }
      threshold 0
      sign 1
      contained_by { box { <-1.8,0,-.7>, <1.8,.6,.7> } }
      texture{ stone_main_rough translate 30*x }
    }  
  }

#else
    isosurface {
      function{ ( -cos(x*2.75)/5 + y - 2.95 & (abs(x)-.96) & (abs(y)-3.5) & (abs(z)-.285) ) }
      threshold 0
      sign 1
      contained_by { box { <-1.5,0,-.5>, <1.5,3.2,.5> } }
      texture{ stone_main_shiny }
}
#end