From 1cf7a951aaa34562b5adaf163f74912c39f4d1f1 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Sun, 13 Apr 2008 19:27:01 +0000 Subject: [PATCH] sync with current 2geom, split_at_discontinuities method and SVGEllipticalArc --- src/2geom/d2-sbasis.cpp | 27 ++++++++++++++++++++++++--- src/2geom/d2-sbasis.h | 6 +++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/2geom/d2-sbasis.cpp b/src/2geom/d2-sbasis.cpp index a646e2cf4..dbf4da10e 100644 --- a/src/2geom/d2-sbasis.cpp +++ b/src/2geom/d2-sbasis.cpp @@ -97,9 +97,8 @@ Piecewise > operator*(Piecewise > const &a, Matrix const & } //if tol>0, only force continuity where the jump is smaller than tol. -Piecewise > force_continuity(Piecewise > const &f, - double tol, - bool closed){ +Piecewise > force_continuity(Piecewise > const &f, double tol, bool closed) +{ if (f.size()==0) return f; Piecewise > result=f; unsigned cur = (closed)? 0:1; @@ -129,4 +128,26 @@ Piecewise > force_continuity(Piecewise > const &f, } return result; } + +std::vector > > +split_at_discontinuities (Geom::Piecewise > const & pwsbin, double tol) +{ + using namespace Geom; + std::vector > > ret; + unsigned piece_start = 0; + for (unsigned i=0; i tol){ + Piecewise > piece; + piece.cuts.push_back(pwsbin.cuts[piece_start]); + for (unsigned j = piece_start; j cross(Piecewise > const &a, Piecewise > Piecewise > operator*(Piecewise > const &a, Matrix const &m); -Piecewise > force_continuity(Piecewise > const &f, - double tol=0, - bool closed=false); +Piecewise > force_continuity(Piecewise > const &f, double tol=0, bool closed=false); + +std::vector > > split_at_discontinuities (Geom::Piecewise > const & pwsbin, double tol = .0001); class CoordIterator : public std::iterator -- 2.30.2