![]() |
Visual Servoing Platform version 3.6.0
|
#include <vpBSpline.h>
Inheritance diagram for vpBSpline: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) |
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) |
Public Attributes | |
| : std::vector<vpImagePoint> controlPoints | |
| std::vector< double > | knots |
| unsigned int | p |
| std::vector< vpImagePoint > | crossingPoints |
Class that provides tools to compute and manipulate a B-Spline curve.
The different parameters are :







![\[ N_{i,0}(u) = \left\{\begin{array}{cc}
1 & \mbox{if } u_i \leq u \leq u_{i+1} \\ 0 & else
\end{array}\right.\]](form_11.png)
![\[ N_{i,p}(u) =
\frac{u-u_i}{u_{i+p}-u_i}N_{i,p-1}(u)+\frac{u_{i+p+1}-u}{u_{i+p+1}-u_{i+1}}N_{i+1,p-1}(u)\]](form_12.png)
where 


It is possible to compute the coordinates of a point corresponding to the knots 
![$ u \in [u_0,u_m]$](form_17.png)
![\[ C(u) =
\sum_{i=0}^n (N_{i,p}(u)P_i)\]](form_18.png)
You can find much more information about the B-Splines and the implementation of all the methods in the Nurbs Book.
Definition at line 105 of file vpBSpline.h.
| vpBSpline::vpBSpline | ( | ) |
Basic constructor.
The degree 
Definition at line 45 of file vpBSpline.cpp.
| vpBSpline::vpBSpline | ( | const vpBSpline & | bspline | ) |
Copy constructor.
Definition at line 54 of file vpBSpline.cpp.
|
virtual |
Basic destructor.
Definition at line 61 of file vpBSpline.cpp.
|
static |
Compute the nonvanishing basis functions at 

N = 






| l_u | : A real number which is between the extremities of the knot vector |
| l_i | : the number of the knot interval in which ![]() |
| l_p | : Degree of the B-Spline basis functions. |
| l_knots | : The knot vector |


Definition at line 142 of file vpBSpline.cpp.
Referenced by computeBasisFuns(), computeCurvePoint(), vpNurbs::computeCurvePoint(), computeCurvePoint(), vpNurbs::computeCurvePoint(), vpNurbs::globalCurveApprox(), and vpNurbs::globalCurveInterp().
| vpBasisFunction * vpBSpline::computeBasisFuns | ( | double | u | ) |
Compute the nonvanishing basis functions at 
N = 






where i the number of the knot interval in which 
| u | : A real number which is between the extremities of the knot vector |


Definition at line 193 of file vpBSpline.cpp.
References computeBasisFuns(), findSpan(), knots, and p.
|
static |
Compute the kth derivatives of 

The formula used is the following :
![\[ C^{(k)}(u) = \sum_{i=0}^n (N_{i,p}^{(k)}(u)P_i) \]](form_551.png)
where 


| l_u | : A real number which is between the extremities of the knot vector |
| l_i | : the number of the knot interval in which ![]() |
| 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 445 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 

The formula used is the following :
![\[ C^{(k)}(u) = \sum_{i=0}^n (N_{i,p}^{(k)}(u)P_i) \]](form_551.png)
where 


| u | : A real number which is between the extremities of the knot vector |
| der | : The last derivative to be computed. |


Definition at line 492 of file vpBSpline.cpp.
References computeDersBasisFuns(), p, vpImagePoint::set_i(), vpImagePoint::set_ij(), vpImagePoint::set_j(), and vpTRACE.
|
static |
Compute the coordinates of a point 

| l_u | : A real number which is between the extremities of the knot vector |
| l_i | : the number of the knot interval in which ![]() |
| 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 375 of file vpBSpline.cpp.
References computeBasisFuns(), vpImagePoint::set_i(), and vpImagePoint::set_j().
| vpImagePoint vpBSpline::computeCurvePoint | ( | double | u | ) |
Compute the coordinates of a point 

| u | : A real number which is between the extremities of the knot vector |
return the coordinates of a point corresponding to the knot 
Definition at line 404 of file vpBSpline.cpp.
References computeBasisFuns(), p, vpImagePoint::set_i(), and vpImagePoint::set_j().
|
static |
Compute the nonzero basis functions and their derivatives until the 


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 
![\[ N_{i,p}^{(k)}(u) =p \left( \frac{N_{i,p-1}^{(k-1)}}{u_{i+p}-u_i} -
\frac{N_{i+1,p-1}^{(k-1)}}{u_{i+p+1}-u_{i+1}} \right) \]](form_544.png)
where 


| l_u | : A real number which is between the extremities of the knot vector |
| l_i | : the number of the knot interval in which ![]() |
| 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 228 of file vpBSpline.cpp.
References vpTRACE.
Referenced by computeCurveDers(), vpNurbs::computeCurveDers(), computeCurveDers(), vpNurbs::computeCurveDers(), and computeDersBasisFuns().
| vpBasisFunction ** vpBSpline::computeDersBasisFuns | ( | double | u, |
| unsigned int | der | ||
| ) |
Compute the nonzero basis functions and their derivatives until the 


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 
![\[ N_{i,p}^{(k)}(u) =p \left( \frac{N_{i,p-1}^{(k-1)}}{u_{i+p}-u_i} -
\frac{N_{i+1,p-1}^{(k-1)}}{u_{i+p+1}-u_{i+1}} \right) \]](form_544.png)
where 


| u | : A real number which is between the extremities 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 358 of file vpBSpline.cpp.
References computeDersBasisFuns(), findSpan(), knots, and p.
|
static |
Find the knot interval in which the parameter 

Example : The knot vector is the following 




| 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 79 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 

Example : The knot vector is the following 




| u | : The knot whose knot interval is seeked. |

Definition at line 123 of file vpBSpline.cpp.
References findSpan(), knots, and p.
|
inline |
Gets all the control points.
| list | : A std::list containing the coordinates of the control points. |
Definition at line 135 of file vpBSpline.h.
|
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 162 of file vpBSpline.h.
|
inline |
Gets all the knots.
| list | : A std::list containing the value of the knots. |
Definition at line 148 of file vpBSpline.h.
|
inline |
Gets the degree of the B-Spline.
Definition at line 127 of file vpBSpline.h.
|
inline |
Sets all the control points.
| list | : A std::list containing the coordinates of the control points |
Definition at line 182 of file vpBSpline.h.
|
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 209 of file vpBSpline.h.
|
inline |
Sets all the knots.
| list | : A std::list containing the value of the knots. |
Definition at line 195 of file vpBSpline.h.
|
inline |
Sets the degree of the B-Spline.
| degree | : the degree of the B-Spline. |
Definition at line 175 of file vpBSpline.h.
| vpBSpline::__pad0__ |
Definition at line 105 of file vpBSpline.h.
| std::vector<vpImagePoint> vpBSpline::crossingPoints |
Vector wich contains the points used during the interpolation method.
Definition at line 115 of file vpBSpline.h.
Referenced by vpNurbs::globalCurveApprox(), and vpNurbs::globalCurveInterp().
| std::vector<double> vpBSpline::knots |
Vector which contain the knots 
Definition at line 111 of file vpBSpline.h.
Referenced by computeBasisFuns(), vpNurbs::computeCurveDersPoint(), computeDersBasisFuns(), vpNurbs::curveKnotIns(), findSpan(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), vpNurbs::globalCurveInterp(), vpNurbs::globalCurveInterp(), vpNurbs::globalCurveInterp(), vpNurbs::refineKnotVectCurve(), and vpNurbs::removeCurveKnot().
| unsigned int vpBSpline::p |
Degree of the B-Spline basis functions.
Definition at line 113 of file vpBSpline.h.
Referenced by computeBasisFuns(), computeCurveDers(), vpNurbs::computeCurveDers(), vpNurbs::computeCurveDersPoint(), computeCurvePoint(), vpNurbs::computeCurvePoint(), computeDersBasisFuns(), vpNurbs::curveKnotIns(), findSpan(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), vpNurbs::globalCurveInterp(), vpNurbs::globalCurveInterp(), vpNurbs::globalCurveInterp(), vpNurbs::refineKnotVectCurve(), vpNurbs::removeCurveKnot(), and vpNurbs::vpNurbs().