58 #define ACG_BEZIERCURVE_C
63 #include "BezierCurveT.hh"
75 template <
class Po
int>
81 std::vector<Point> b(*
this);
83 unsigned int n = b.size()-1, k;
84 Scalar t0(1.0-_t), t1(_t);
90 for (j=0, k=n-i; j<k; ++j)
91 b[j] = t0*b[j] + t1*b[j+1];
101 template <
class Po
int>
107 std::vector<Point> b(*
this);
110 Scalar t0(1.0-_t), t1(_t);
114 _curve0.reserve(n+1);
116 _curve1.reserve(n+1);
118 std::vector<Point> tmp;
126 _curve0.push_back(b[0]);
127 tmp.push_back(b[n-i]);
129 for (j=0, k=n-i; j<k; ++j)
130 b[j] = t0*b[j] + t1*b[j+1];
133 _curve0.push_back(b[0]);
138 _curve1.push_back(tmp[i]);
141 assert(_curve0.
degree() == n);
142 assert(_curve1.
degree() == n);
unsigned int degree() const
return degree (= size()-1)
Point operator()(Scalar _t) const
evaluate curve at parameter _t using deCasteljau
Namespace providing different geometric functions concerning angles.
void subdivide(Scalar _t, Self &_curve0, Self &_curve1) const