From 5eb9b4815a12cc0dafd07905f7715a7e15a92b41 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 13 Jan 2014 00:25:39 +0100 Subject: update 2geom's copy to r2142 (bzr r12921) --- src/2geom/circle.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/2geom/circle.cpp') diff --git a/src/2geom/circle.cpp b/src/2geom/circle.cpp index 06eb4c2a1..d021882ea 100644 --- a/src/2geom/circle.cpp +++ b/src/2geom/circle.cpp @@ -88,7 +88,9 @@ void Circle::set(std::vector const& points) model.instance(*this, fitter.result(z)); } - +/** + @param inner a point whose angle with the circle center is inside the angle that the arc spans + */ EllipticalArc * Circle::arc(Point const& initial, Point const& inner, Point const& final, bool _svg_compliant) @@ -98,10 +100,8 @@ Circle::arc(Point const& initial, Point const& inner, Point const& final, return e.arc(initial, inner, final, _svg_compliant); } -void -Circle::getPath(std::vector &path_out) { - Path pb; - +D2 Circle::toSBasis() +{ D2 B; Linear bo = Linear(0, 2 * M_PI); @@ -110,6 +110,15 @@ Circle::getPath(std::vector &path_out) { B = B * m_ray + m_centre; + return B; +} + +void +Circle::getPath(std::vector &path_out) { + Path pb; + + D2 B = toSBasis(); + pb.append(SBasisCurve(B)); path_out.push_back(pb); -- cgit v1.2.3