summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7d83aca)
raw | patch | inline | side by side (parent: 7d83aca)
author | Johan Engelen <goejendaagh@zonnet.nl> | |
Wed, 28 Jul 2010 22:22:18 +0000 (00:22 +0200) | ||
committer | Johan Engelen <goejendaagh@zonnet.nl> | |
Wed, 28 Jul 2010 22:22:18 +0000 (00:22 +0200) |
src/live_effects/lpe-powerstroke.cpp | patch | blob | history |
index af5739b328e8774bc8f21f381f70b7a7c8b64d10..addddd06f25a369d01bdf37911c628a3479e8ede 100644 (file)
CubicBezierFit& operator=(const CubicBezierFit&);
};
+/// @todo invent name for this class
+class CubicBezierJohan : public Interpolator {
+public:
+ CubicBezierJohan() {};
+ virtual ~CubicBezierJohan() {};
+
+ virtual Path interpolateToPath(std::vector<Point> points) {
+ Path fit;
+ fit.start(points.at(0));
+ for (unsigned int i = 1; i < points.size(); ++i) {
+ Point p0 = points.at(i-1);
+ Point p1 = points.at(i);
+ Point dx = Point(p1[X] - p0[X], 0);
+ fit.appendNew<CubicBezier>(p0+0.2*dx, p1-0.2*dx, p1);
+ }
+ return fit;
+ };
+
+private:
+ CubicBezierJohan(const CubicBezierJohan&);
+ CubicBezierJohan& operator=(const CubicBezierJohan&);
+};
} //namespace Interpolate
} //namespace Geom
}
// create stroke path where points (x,y) = (t, offset)
- Geom::Interpolate::Linear interpolator;
+ Geom::Interpolate::CubicBezierJohan interpolator;
Path strokepath = interpolator.interpolateToPath(ts);
Path mirroredpath = strokepath.reverse() * Geom::Scale(1,-1);
strokepath.append(mirroredpath, Geom::Path::STITCH_DISCONTINUOUS);