Extract a portion of a polygon.

   POLY2 = polygonSubcurve(POLYGON, POS0, POS1)
   Create a new polyline, by keeping vertices located between positions
   POS0 and POS1, and adding points corresponding to positions POS0 and
   POS1 if they are not already vertices.

   [POLY2, INDS] = polygonSubcurve(POLYGON, POS0, POS1)
   Also return indices of polygon vertices comprised between POS0 and
   POS1. The array INDS may be smaller than the array POLY2.

   Example
     Nv = 100;
     poly = circleToPolygon([30 20 15], Nv);
     arc1 = polygonSubcurve(poly, 15, 45);
     arc2 = polygonSubcurve(poly, 90, 10); % contains polygon endpoints
     figure; axis equal, hold on; axis([0 50 0 50]);
     drawPolyline(arc1, 'linewidth', 4, 'color', 'g');
     drawPolyline(arc2, 'linewidth', 4, 'color', 'r');
     drawPolygon(poly, 'color', 'b');

   See also
     polygons2d, polylineSubcurve, projPointOnPolygon, polygonPoint

Package: matgeom