Compute triangulation between a pair of 3D closed curves.

   [V, F] = triangulatePolygonPair(POLY1, POLY2)

   [V, F] = triangulatePolygonPair(..., 'recenter', FLAG)
   Where FLAG is a boolean, specifies whether the second curve should be
   translated to have the same centroid as the first curve. This can
   improve mathcing of vertices. Default is true.


   Example
     % triangulate a surface patch between two ellipses
     % create two sample curves
     poly1 = ellipseToPolygon([50 50 40 20 0], 36);
     poly2 = ellipseToPolygon([50 50 40 20 60], 36);
     poly1 = poly1(1:end-1,:);
     poly2 = poly2(1:end-1,:);
     % transform to 3D polygons / curves
     curve1 = [poly1 10*ones(size(poly1, 1), 1)];
     curve2 = [poly2 20*ones(size(poly2, 1), 1)];
     % draw as 3D curves
     figure(1); clf; hold on;
     drawPolygon3d(curve1, 'b'); drawPoint3d(curve1, 'bo');
     drawPolygon3d(curve2, 'g'); drawPoint3d(curve2, 'go');
     view(3); axis equal;
     [vertices, faces] = triangulatePolygonPair(curve1, curve2);
     % display the resulting mesh
     figure(2); clf; hold on;
     drawMesh(vertices, faces);
     drawPolygon3d(curve1, 'color', 'b', 'linewidth', 2);
     drawPolygon3d(curve2, 'color', 'g', 'linewidth', 2);
     view(3); axis equal;

   See also
     meshes3D, triangulateCurvePair, meshSurfaceArea

Package: matgeom