Contour pushing algorithm
I suggest you use a data structure for nearest neighbor search to speed up the process of finding all points in the polyline that are closer than the defined radius.  That should lead to a significant speedup.