ViSP
2.9.0
|
#include <vpBSpline.h>
Public Member Functions | |
vpBSpline () | |
vpBSpline (const vpBSpline &bspline) | |
virtual | ~vpBSpline () |
unsigned int | get_p () const |
void | get_controlPoints (std::list< vpImagePoint > &list) const |
void | get_knots (std::list< double > &list) const |
void | get_crossingPoints (std::list< vpImagePoint > &list) const |
void | set_p (unsigned int degree) |
void | set_controlPoints (const std::list< vpImagePoint > &list) |
void | set_knots (const std::list< double > &list) |
void | set_crossingPoints (const std::list< vpImagePoint > &list) |
unsigned int | findSpan (double u) |
vpBasisFunction * | computeBasisFuns (double u) |
vpBasisFunction ** | computeDersBasisFuns (double u, unsigned int der) |
vpImagePoint | computeCurvePoint (double u) |
vpImagePoint * | computeCurveDers (double u, unsigned int der) |
Deprecated functions | |
vp_deprecated vpList< vpImagePoint > | get_controlPoints () const |
vp_deprecated vpList< double > | get_knots () const |
vp_deprecated vpList< vpImagePoint > | get_crossingPoints () const |
vp_deprecated void | set_controlPoints (vpList< vpImagePoint > &list) |
vp_deprecated void | set_knots (vpList< double > &list) |
vp_deprecated void | set_crossingPoints (vpList< vpImagePoint > &list) |
Static Public Member Functions | |
static unsigned int | findSpan (double l_u, unsigned int l_p, std::vector< double > &l_knots) |
static vpBasisFunction * | computeBasisFuns (double l_u, unsigned int l_i, unsigned int l_p, std::vector< double > &l_knots) |
static vpBasisFunction ** | computeDersBasisFuns (double l_u, unsigned int l_i, unsigned int l_p, unsigned int l_der, std::vector< double > &l_knots) |
static vpImagePoint | computeCurvePoint (double l_u, unsigned int l_i, unsigned int l_p, std::vector< double > &l_knots, std::vector< vpImagePoint > &l_controlPoints) |
static vpImagePoint * | computeCurveDers (double l_u, unsigned int l_i, unsigned int l_p, unsigned int l_der, std::vector< double > &l_knots, std::vector< vpImagePoint > &l_controlPoints) |
Class that provides tools to compute and manipulate a B-Spline curve.
The different parameters are :
The B-Spline basis functions defined as :
where and p is the degree of the B-Spline basis functions.
It is possible to compute the coordinates of a point corresponding to the knots ( ) thanks to the formula :
You can find much more information about the B-Splines and the implementation of all the methods in the Nurbs Book.
Definition at line 109 of file vpBSpline.h.
vpBSpline::vpBSpline | ( | ) |
Basic constructor.
The degree of the B-Spline basis functions is set to 3 to compute cubic B-Spline.
Definition at line 51 of file vpBSpline.cpp.
vpBSpline::vpBSpline | ( | const vpBSpline & | bspline | ) |
Copy constructor.
Definition at line 61 of file vpBSpline.cpp.
|
virtual |
Basic destructor.
Definition at line 73 of file vpBSpline.cpp.
|
static |
Compute the nonvanishing basis functions at which is in the th knot interval. All the basis functions are stored in an array such as :
N = , , , ... , , ..., , ... , , ... ,
l_u | : A real number which is between the extrimities of the knot vector |
l_i | : the number of the knot interval in which lies |
l_p | : Degree of the B-Spline basis functions. |
l_knots | : The knot vector |
Definition at line 152 of file vpBSpline.cpp.
Referenced by computeBasisFuns(), vpNurbs::computeCurvePoint(), computeCurvePoint(), vpNurbs::globalCurveApprox(), and vpNurbs::globalCurveInterp().
vpBasisFunction * vpBSpline::computeBasisFuns | ( | double | u | ) |
Compute the nonvanishing basis functions at . All the basis functions are stored in an array such as :
N = , , , ... , , ..., , ... , , ... ,
where i the number of the knot interval in which lies.
u | : A real number which is between the extrimities of the knot vector |
Definition at line 203 of file vpBSpline.cpp.
References computeBasisFuns(), and findSpan().
|
static |
Compute the kth derivatives of for .
The formula used is the following :
where is the knot interval number in which lies and is the degree of the B-Spline basis function.
l_u | : A real number which is between the extrimities of the knot vector |
l_i | : the number of the knot interval in which lies |
l_p | : Degree of the B-Spline basis functions. |
l_der | : The last derivative to be computed. |
l_knots | : The knot vector |
l_controlPoints | : the list of control points. |
Definition at line 456 of file vpBSpline.cpp.
References computeDersBasisFuns(), vpImagePoint::set_i(), vpImagePoint::set_ij(), vpImagePoint::set_j(), and vpTRACE.
vpImagePoint * vpBSpline::computeCurveDers | ( | double | u, |
unsigned int | der | ||
) |
Compute the kth derivatives of for .
The formula used is the following :
where is the knot interval number in which lies and is the degree of the B-Spline basis function.
u | : A real number which is between the extrimities of the knot vector |
der | : The last derivative to be computed. |
Definition at line 504 of file vpBSpline.cpp.
References computeDersBasisFuns(), vpImagePoint::set_i(), vpImagePoint::set_ij(), vpImagePoint::set_j(), and vpTRACE.
|
static |
Compute the coordinates of a point corresponding to the knot .
l_u | : A real number which is between the extrimities of the knot vector |
l_i | : the number of the knot interval in which lies |
l_p | : Degree of the B-Spline basis functions. |
l_knots | : The knot vector |
l_controlPoints | : the list of control points. |
return the coordinates of a point corresponding to the knot .
Definition at line 387 of file vpBSpline.cpp.
References computeBasisFuns(), vpImagePoint::set_i(), and vpImagePoint::set_j().
vpImagePoint vpBSpline::computeCurvePoint | ( | double | u | ) |
Compute the coordinates of a point corresponding to the knot .
u | : A real number which is between the extrimities of the knot vector |
return the coordinates of a point corresponding to the knot .
Definition at line 416 of file vpBSpline.cpp.
References computeBasisFuns(), vpImagePoint::set_i(), and vpImagePoint::set_j().
|
static |
Compute the nonzero basis functions and their derivatives until the th derivative. All the functions are computed at l_u.
The result is given as an array of size l_der+1 x l_p+1. The kth line corresponds to the kth basis functions derivatives.
The formula to compute the kth derivative at is :
where is the knot interval number in which lies and is the degree of the B-Spline basis function.
l_u | : A real number which is between the extrimities of the knot vector |
l_i | : the number of the knot interval in which lies |
l_p | : Degree of the B-Spline basis functions. |
l_der | : The last derivative to be computed. |
l_knots | : The knot vector |
Example : return[0] is the list of the 0th derivatives ie the basis functions. return[k] is the list of the kth derivatives.
Definition at line 233 of file vpBSpline.cpp.
References vpTRACE.
Referenced by vpNurbs::computeCurveDers(), computeCurveDers(), and computeDersBasisFuns().
vpBasisFunction ** vpBSpline::computeDersBasisFuns | ( | double | u, |
unsigned int | der | ||
) |
Compute the nonzero basis functions and their derivatives until the th derivative. All the functions are computed at u.
The result is given as an array of size der+1 x p+1. The kth line corresponds to the kth basis functions derivatives.
The formula to compute the kth derivative at is :
where is the knot interval number in which lies and is the degree of the B-Spline basis function.
u | : A real number which is between the extrimities of the knot vector |
der | : The last derivative to be computed. |
Example : return[0] is the list of the 0th derivatives ie the basis functions. return[k] is the list of the kth derivatives.
Definition at line 369 of file vpBSpline.cpp.
References computeDersBasisFuns(), and findSpan().
|
static |
Find the knot interval in which the parameter lies. Indeed
Example : The knot vector is the following with is equal to 1.
l_u | : The knot whose knot interval is seeked. |
l_p | : Degree of the B-Spline basis functions. |
l_knots | : The knot vector |
Definition at line 92 of file vpBSpline.cpp.
References vpMath::maximum(), and vpMath::round().
Referenced by computeBasisFuns(), vpNurbs::computeCurveDersPoint(), computeDersBasisFuns(), vpNurbs::curveKnotIns(), findSpan(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), and vpNurbs::refineKnotVectCurve().
unsigned int vpBSpline::findSpan | ( | double | u | ) |
Find the knot interval in which the parameter lies. Indeed
Example : The knot vector is the following with is equal to 1.
u | : The knot whose knot interval is seeked. |
Definition at line 134 of file vpBSpline.cpp.
References findSpan().
|
inline |
Gets all the control points.
list | : A std::list containing the coordinates of the control points. |
Definition at line 139 of file vpBSpline.h.
|
inline |
Definition at line 237 of file vpBSpline.h.
References vpList< type >::addRight().
|
inline |
Gets all the crossing points (used in the interpolation method)
list | : A std::list containing the coordinates of the crossing points. |
Definition at line 161 of file vpBSpline.h.
|
inline |
Definition at line 259 of file vpBSpline.h.
References vpList< type >::addRight().
|
inline |
Gets all the knots.
list | : A std::list containing the value of the knots. |
Definition at line 150 of file vpBSpline.h.
|
inline |
Definition at line 248 of file vpBSpline.h.
References vpList< type >::addRight().
|
inline |
Gets the degree of the B-Spline.
Definition at line 132 of file vpBSpline.h.
|
inline |
Sets all the control points.
list | : A std::list containing the coordinates of the control points |
Definition at line 181 of file vpBSpline.h.
|
inline |
list | : A vpList containing the coordinates of the control points |
Definition at line 270 of file vpBSpline.h.
References vpList< type >::front(), vpList< type >::nbElements(), vpList< type >::next(), and vpList< type >::value().
|
inline |
Sets all the crossing points (used in the interpolation method)
list | : A std::list containing the coordinates of the crossing points |
Definition at line 205 of file vpBSpline.h.
|
inline |
list | : A vpList containing the coordinates of the crossing points |
Definition at line 302 of file vpBSpline.h.
References vpList< type >::front(), vpList< type >::nbElements(), vpList< type >::next(), and vpList< type >::value().
|
inline |
Sets all the knots.
list | : A std::list containing the value of the knots. |
Definition at line 193 of file vpBSpline.h.
|
inline |
list | : A vpList containing the value of the knots. |
Definition at line 286 of file vpBSpline.h.
References vpList< type >::front(), vpList< type >::nbElements(), vpList< type >::next(), and vpList< type >::value().
|
inline |
Sets the degree of the B-Spline.
degree | : the degree of the B-Spline. |
Definition at line 173 of file vpBSpline.h.