X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Fbezier.cpp;h=daa07360079ea818ca7050dc144b0adbbf87eb65;hb=ef0af5fd0129161a9e079bd3cd1298b53f1fe11a;hp=67b384c9716feda24ee4bf41d58f203120a6d33d;hpb=c29180e78e8a6e16145d308a4e06e874bc29ccfb;p=ipdf%2Fcode.git diff --git a/src/bezier.cpp b/src/bezier.cpp index 67b384c..daa0736 100644 --- a/src/bezier.cpp +++ b/src/bezier.cpp @@ -4,6 +4,8 @@ #include #include + + using namespace std; namespace IPDF @@ -54,11 +56,13 @@ static void CubicSolveSegment(vector & roots, const Real & a, const Real & Real l = a*tl*tl*tl + b*tl*tl + c*tl + d; Real u = a*tu*tu*tu + b*tu*tu + c*tu + d; if ((l < 0 && u < 0) || (l > 0 && u > 0)) - Debug("Discarding segment (no roots) l = %f (%f), u = %f (%f)", tl, l, tu, u); + { + //Debug("Discarding segment (no roots) l = %f (%f), u = %f (%f)", Double(tl), Double(l), Double(tu), Double(u)); //return; + } bool negative = (u < l); // lower point > 0, upper point < 0 - Debug("%ft^3 + %ft^2 + %ft + %f is negative (%f < %f) %d", a,b,c,d,u,l, negative); + //Debug("%ft^3 + %ft^2 + %ft + %f is negative (%f < %f) %d", Double(a),Double(b),Double(c),Double(d),Double(u),Double(l), negative); while (tu - tl > delta) { Real t(tu+tl); @@ -89,7 +93,7 @@ vector SolveCubic(const Real & a, const Real & b, const Real & c, const Re Real tu(max); Real tl(min); vector turns(SolveQuadratic(a*3, b*2, c)); - Debug("%u turning points", turns.size()); + //Debug("%u turning points", turns.size()); for (unsigned i = 1; i < turns.size(); ++i) { tu = turns[i]; @@ -422,3 +426,4 @@ Rect Bezier::SolveBounds() const } } // end namespace +