RESAMPLEPOLYLINEBYLENGTH Resample a polyline with a fixed sampling step.

   RES = resamplePolyline(POLY, STEP)
   Resample the input polyline POLY by distributing new vertices on the
   original polyline such that the (curvilinear) distance between the new
   vertices is approximately equal to STEP. 

   Example
     poly = [0 10;0 0;10 0; 10 10; 20 10;20 0];
     figure; drawPolyline(poly, 'k');
     poly2 = resamplePolylineByLength(poly, 4);
     hold on; 
     drawPolyline(poly2, 'm');
     drawPoint(poly2, 'mo');
     axis equal; axis([-10 30 -10 20]);
     legend('Original polyline', 'Resampled polyline');

   See also
     polygons2d, drawPolyline, resamplePolygon

Package: matgeom