git.ucc.asn.au
/
ipdf
/
code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some quadtree stuff: bugfix + mutation
[ipdf/code.git]
/
src
/
bezier.cpp
diff --git
a/src/bezier.cpp
b/src/bezier.cpp
index
99611dc
..
67b384c
100644
(file)
--- a/
src/bezier.cpp
+++ b/
src/bezier.cpp
@@
-54,9
+54,11
@@
static void CubicSolveSegment(vector<Real> & 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))
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))
- return;
+ Debug("Discarding segment (no roots) l = %f (%f), u = %f (%f)", tl, l, tu, u);
+ //return;
bool negative = (u < l); // lower point > 0, upper point < 0
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);
while (tu - tl > delta)
{
Real t(tu+tl);
while (tu - tl > delta)
{
Real t(tu+tl);
@@
-87,7
+89,7
@@
vector<Real> SolveCubic(const Real & a, const Real & b, const Real & c, const Re
Real tu(max);
Real tl(min);
vector<Real> turns(SolveQuadratic(a*3, b*2, c));
Real tu(max);
Real tl(min);
vector<Real> 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];
for (unsigned i = 1; i < turns.size(); ++i)
{
tu = turns[i];
UCC
git Repository :: git.ucc.asn.au