A library of distance and occlusion generation routines