The vtkDistancePolyDataFilter (http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/DistancePolyDataFilter) does this (and in a much more "elegant" way). Should this project be abandoned?