r2: added part of the foliage code, refs #552