patch mesh kdtree