Class xlifepp::BSpline#
-
class BSpline : public xlifepp::Spline#
-
BSpline class (rational B-Spline)
Public Functions
-
BSpline(const std::vector<Point> &cpts, number_t degree = 3, SplineBC bcs = _undefBC, SplineBC bce = _undefBC, const std::vector<real_t> &weights = std::vector<real_t>())#
-
create B-Spline approximation
approximation or interpolation B-spline
-
BSpline(SplineSubtype sbt, const std::vector<Point> &cpts, number_t degree = 3, SplineParametrization spar = _uniformParametrization, SplineBC bcs = _undefBC, SplineBC bce = _undefBC, const std::vector<real_t> &yp0 = std::vector<real_t>(), const std::vector<real_t> &yp1 = std::vector<real_t>(), const std::vector<real_t> &weights = std::vector<real_t>())#
-
create Bspline approximation or interpolation
-
void computeB(real_t t, DiffOpType dif, number_t &j, Vector<real_t> &B, Vector<real_t> &dB, Vector<real_t> &d2B) const#
-
compute tool called by evaluate
-
void copy(const BSpline&)#
-
copy BSpline data in a cleaned BSpline (re-allocate parametrization_ pointer)
-
virtual Point evaluate(real_t t, DiffOpType d = _id) const#
-
evaluate spline or its derivative at t
evaluate B-Spline using Bernstein polynomials Q(s)= sum_{i=0,n} wi Bi,k(t) Pi /sum_{i=0,n} wi Bi,k(t) with t=t0_+s*(tf_-t0_) with Bi,k the B-spline function NEW VERSION: separate the computation of B from the construction of Q computeB may be reused, probably a little less efficient BSpline parameter t in [0,1] derivative order up to 2
-
virtual Point evaluate2(real_t t, DiffOpType d = _id) const#
-
evaluate spline or its derivative at t
evaluate B-Spline using Bernstein polynomials Q(s)= sum_{i=0,n} wi Bi,k(t) Pi(t) /sum_{i=0,n} wi Bi,k(t) with Bi,k the B-spline function OLD version
-
Vector<real_t> funParametrization(const Point &pt, Parameters &pars, DiffOpType d = _id) const#
-
parametrization
< parametrization s(t)
-
void initInterp()#
-
initialization when interpolation is selected cpts (in) : list of interpolated points Q_i cpts (out) : list of control points P_j leading to B-spline interpolating Q_i this function solve the linear system sum_j=0,m w_j*B_jk(s_i)P_j = sum_j=0,m w_j*B_jk(s_i) Q_i 0 <= i,j <=m <=> M*P=D*Q with M_ij = w_j*B_jk(s_i) D_ii = sum_j=0,m w_j*B_jk(s_i) =sum_j=0,m M_ij when B-spline is clamped at ends, first (resp.
last) two rows of system have to be modified P0 = Q0 k*w_m/w_m-1(t_m+1-t_m)*(Pm-Pm-1) = ype k*w_1/w_0(t_k+1-t_k)*(P1-P0) = yps Pm=Qm s_i is given by t(r_i)=t0+r_i*(tf-t0) where r_i are chosen using one of the rules uniform: r_i=i/m chordal: r_i=r_i-1 + |Q_i-Q_i-1|/ sum_j=1,m |Q_j-Q_i-j| , r_0=0 centripetal: r_i=r_i-1 + sqrt(|Q_i-Q_i-1|)/ sum_j=1,m sqrt(|Q_j-Q_i-j|) , r_0=0 ONLY UNIFORM IS AVAILABLE
-
Vector<real_t> invParametrization(const Point &pt, Parameters &pars, DiffOpType d = _id) const#
-
inverse of parametrization
< inverse of parametrization
-
virtual void print(std::ostream&, bool nocpt = false) const#
-
print utility
-
inline real_t toKnotsParameter(real_t t) const#
-
map t in [0,1] to knots parameter
-
BSpline(const std::vector<Point> &cpts, number_t degree = 3, SplineBC bcs = _undefBC, SplineBC bce = _undefBC, const std::vector<real_t> &weights = std::vector<real_t>())#