#include <CrossTangentOffset.h>
Inheritance diagram for Go::CrossTangentOffset:
Public Member Functions | |
CrossTangentOffset (boost::shared_ptr< SplineCurve > &poscurve, boost::shared_ptr< SplineCurve > &tangcv1, boost::shared_ptr< SplineCurve > &tangcv2, boost::shared_ptr< SplineCurve > &blend1, boost::shared_ptr< SplineCurve > &blend2) | |
Constructor, taking a curve from which we take the offset, and four other curves used to calculate the offset direction and magnitude. | |
virtual | ~CrossTangentOffset () |
virtual destructor enables safe inheritance | |
virtual Point | eval (double t) const |
Evaluate a point on the curve for a given parameter. | |
virtual void | eval (double t, int n, Point der[]) const |
Evaluate a point and a certain number of derivatives on the curve for a given parameter. | |
virtual double | start () const |
Get the start parameter of the curve. | |
virtual double | end () const |
Get the end parameter of the curve. | |
virtual int | dim () const |
Get the dimension of the space in which the curve lies. | |
virtual bool | approximationOK (double par, Point approxpos, double tol1, double tol2) const |
Inherited from EvalCurve::approximationOK(). |
Definition at line 53 of file CrossTangentOffset.h.
Go::CrossTangentOffset::CrossTangentOffset | ( | boost::shared_ptr< SplineCurve > & | poscurve, | |
boost::shared_ptr< SplineCurve > & | tangcv1, | |||
boost::shared_ptr< SplineCurve > & | tangcv2, | |||
boost::shared_ptr< SplineCurve > & | blend1, | |||
boost::shared_ptr< SplineCurve > & | blend2 | |||
) |
Constructor, taking a curve from which we take the offset, and four other curves used to calculate the offset direction and magnitude.
Two of these curves are the cross-tangent curves and the two other are blending functions (dimension 1). To find the offset direction at a given point, the two cross-tangent curves are evaluated at the specified parameter, multiplied by their respective blending functions and added together. The offset length is computed by linearly interpolating the length of this blended cross-tangent at the start and end parameter of the curve.
poscurve | the curve from which we take the offset | |
tangcv1 | the first cross-tangent curve | |
tangcv2 | the second cross-tangent curve | |
blend1 | the blending function for the first cross-tangent curve | |
blend2 | the blending function for the second cross-tangent curve |
virtual Point Go::CrossTangentOffset::eval | ( | double | t | ) | const [virtual] |
Evaluate a point on the curve for a given parameter.
t | the parameter for which to evaluate the curve. |
Implements Go::EvalCurve.
virtual void Go::CrossTangentOffset::eval | ( | double | t, | |
int | n, | |||
Point | der[] | |||
) | const [virtual] |
Evaluate a point and a certain number of derivatives on the curve for a given parameter.
t | the parameter for which to evaluate the curve. | |
n | the number of derivatives (0 or more) |
der | pointer to an array of Points where the result will be written. The position will be stored first, then the first derivative (tangent), then the second, etc.. NB: For most (all) derived classes of 'EvalCurve', the implementation actually only supports the computation of one derivative, i.e. if n > 1, only one derivative will be computed anyway. |
Implements Go::EvalCurve.
virtual double Go::CrossTangentOffset::start | ( | ) | const [virtual] |
Get the start parameter of the curve.
Implements Go::EvalCurve.
virtual double Go::CrossTangentOffset::end | ( | ) | const [virtual] |
Get the end parameter of the curve.
Implements Go::EvalCurve.
virtual int Go::CrossTangentOffset::dim | ( | ) | const [virtual] |
Get the dimension of the space in which the curve lies.
Implements Go::EvalCurve.
virtual bool Go::CrossTangentOffset::approximationOK | ( | double | par, | |
Point | approxpos, | |||
double | tol1, | |||
double | tol2 | |||
) | const [virtual] |
Inherited from EvalCurve::approximationOK().
For this class, both tolerances are used.
par | the parameter at which to check the curve | |
approxpos | the position we want to check whether or not the curve approximates for parameter 'par'. | |
tol1 | spatial approximation tolerance. If the evaluated position is outside this tolerance, 'false' is returned. If it inside this tolerance "by far", 'true' is returned. Otherwise, 'tol2' is taken into account. | |
tol2 | This tolerance is taken into account when the evaluated point is within 'tol1' from 'approxpos', but not convincingly so. In that case this tolerance is used to check whether the evaluated cross tangent lies in the plane spanned by the tangent curves at this point. (It is thus an angle tolerance). |
Implements Go::EvalCurve.