summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 573d0e4)
raw | patch | inline | side by side (parent: 573d0e4)
author | jfbarraud <jfbarraud@users.sourceforge.net> | |
Sat, 8 Mar 2008 21:59:59 +0000 (21:59 +0000) | ||
committer | jfbarraud <jfbarraud@users.sourceforge.net> | |
Sat, 8 Mar 2008 21:59:59 +0000 (21:59 +0000) |
src/2geom/bezier.h | patch | blob | history | |
src/2geom/path.h | patch | blob | history | |
src/2geom/sweep.cpp | patch | blob | history |
diff --git a/src/2geom/bezier.h b/src/2geom/bezier.h
index bdc672a57545c25d100dc83dc8926d5588b51a8c..af6df0840d7bc850f19edce108937568d637cec5 100644 (file)
--- a/src/2geom/bezier.h
+++ b/src/2geom/bezier.h
Coord d_[order()+1];
unsigned nn = n_derivs;
if(nn > order())
- nn = order();
+ //nn = order();
+ nn = order()+1;
for(unsigned i = 0; i < size(); i++)
d_[i] = c_[i];
for(unsigned di = 0; di < nn; di++) {
}
inline Bezier derivative(const Bezier & a) {
- if(a.order() == 1) return Bezier(0.0);
+ //if(a.order() == 1) return Bezier(0.0);
+ if(a.order() == 1) return Bezier(a.c_[1]-a.c_[0]);
Bezier der(Bezier::Order(a.order()-1));
for(unsigned i = 0; i < a.order(); i++) {
diff --git a/src/2geom/path.h b/src/2geom/path.h
index 72c5d50fa78379f7c77a8c82a0950908471cc753..f314e6efaba722ea8f06b50bf28d736c42cb08e0 100644 (file)
--- a/src/2geom/path.h
+++ b/src/2geom/path.h
return new BezierCurve<order-1>(Geom::derivative(inner[X]), Geom::derivative(inner[Y]));
else if (order == 1) {
double dx = inner[X][1] - inner[X][0], dy = inner[Y][1] - inner[Y][0];
- if(dx == 0) return new BezierCurve<1>(Point(0,0), Point(0,0));
- double slope = dy / dx;
- Geom::Point pnt;
- if(slope == 0) pnt = Geom::Point(0, 0); else pnt = Geom::Point(slope, 1./slope);
- return new BezierCurve<1>(pnt, pnt);
+ return new BezierCurve<1>(Point(dx,dy),Point(dx,dy));
}
}
diff --git a/src/2geom/sweep.cpp b/src/2geom/sweep.cpp
index 08674ab2fa872395a2c69da985b4e101a018e4d0..b9ef71b5c0cd3cd165a066bc93599dbdee536a71 100644 (file)
--- a/src/2geom/sweep.cpp
+++ b/src/2geom/sweep.cpp
open[n].push_back(ix);
}
i[n]++;
+ if(i[n]>=events[n].size()) {break;}
n = (events[!n][i[!n]] < events[n][i[n]]) ? !n : n;
}
return pairs;