457
457
//#################################################################################
460
* Converts all segments in all paths to Geom::LineSegment or Geom::HLineSegment or
461
* Geom::VLineSegment or Geom::CubicBezier or Geom::EllipticalArc.
464
pathv_to_linear_and_cubic_beziers_and_arcs( Geom::PathVector const &pathv )
466
Geom::PathVector output;
468
for (Geom::PathVector::const_iterator pit = pathv.begin(); pit != pathv.end(); ++pit) {
469
output.push_back( Geom::Path() );
470
output.back().setStitching(true);
471
output.back().start( pit->initialPoint() );
473
for (Geom::Path::const_iterator cit = pit->begin(); cit != pit->end_open(); ++cit) {
474
if (is_straight_curve(*cit)) {
475
Geom::LineSegment l(cit->initialPoint(), cit->finalPoint());
476
output.back().append(l);
478
Geom::EllipticalArc const *arc = dynamic_cast<Geom::EllipticalArc const *>(&*cit);
480
output.back().append(arc->duplicate());
483
Geom::BezierCurve const *curve = dynamic_cast<Geom::BezierCurve const *>(&*cit);
484
if (curve && curve->order() == 3) {
485
Geom::CubicBezier b((*curve)[0], (*curve)[1], (*curve)[2], (*curve)[3]);
486
output.back().append(b);
488
// convert all other curve types to cubicbeziers
489
Geom::Path cubicbezier_path = Geom::cubicbezierpath_from_sbasis(cit->toSBasis(), 0.1);
490
cubicbezier_path.close(false);
491
output.back().append(cubicbezier_path);
496
output.back().close( pit->closed() );
460
502
* Converts all segments in all paths to Geom::LineSegment or Geom::HLineSegment or
461
503
* Geom::VLineSegment or Geom::CubicBezier.