This is the result of an assignment to make a tool for Maya. The premise is for a user to be able to create grass on an object and output renderman RIB files. It creates and outputs the selected geometry and the generated grass as separate RIB archive files that can be used separate or previewed by rendering the supplied example scene.
There are two distribution methods implemented. One that samples the topology based on area. The smallest face represents one unit and from there you can choose how many blades of grass one unit should have. The other method scans a black and white texture where you can choose the sampling definition effectively sub or over sampling the texture.