DENSIFYPOLYGON Add several points on each edge of the polygon.

   POLY2 = densifyPolygon(POLY, N)
   POLY is a NV-by-2 array containing polygon coordinates. The function
   iterates on polygon edges, divides it into N subedges (by inserting N-1
   new vertices on each edges), and return the resulting polygon.
   The new polygon POLY has therefore N*NV vertices.

   Example
     % Densifies a simple polygon
     poly = [0 0 ; 10 0;5 10;15 15;5 20;-5 10];
     poly2 = densifyPolygon(poly, 10);
     figure; drawPolygon(poly); axis equal
     hold on; drawPoint(poly2);

   See also
     drawPolygon, edgeToPolyline


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2011-11-25,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2011 INRA - Cepia Software Platform.

Package: matgeom