Extract a portion of a polyline.
POLY2 = polylineSubcurve(POLYLINE, 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] = polylineSubcurve(POLYLINE, POS0, POS1)
Also returns the indices of the original polyline that were selected.
The size of the array INDS may be smaller than the array POLY, due to
the addition of new vertices at the extremities.
Example
Nv = 100;
poly = circleAsPolygon([10 20 30], Nv);
poly2 = polylineSubcurve(poly, 15, 65);
drawCurve(poly2);
See also
polygons2d, polygonSubCurve
Package: matgeom