![]() |
Trax3 3.1.0
trax track library
|
Curve with evenly (with respect to arc length) rotating tangent vector. More...
#include <C:/Trend/Development/Trax3/Code/trax/Curve.h>

Classes | |
| struct | Data |
| Data definig the curve. More... | |
Public Member Functions | |
| virtual spat::SquareMatrix< Real, 3 > | Jacobian (Length s) const =0 |
| Returns the partial derivatives of the position P to the parameters a, b and s in a matrix, customly called a 'Jacobian matrix'. | |
| virtual common::Interval< Length > | Create (const Data &data)=0 |
| Create the curve from data set for which it is guaranteed, that no calculational drift will happen e.g. in write/read cycles. | |
| virtual const Data & | GetData () const noexcept=0 |
| Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant. | |
| Public Member Functions inherited from trax::Curve | |
| virtual const char * | TypeName () const noexcept=0 |
| virtual CurveType | GetCurveType () const noexcept=0 |
| virtual bool | IsValid () const noexcept=0 |
| virtual AnglePerLength | Curvature (Length s) const =0 |
| virtual AnglePerLength | Torsion (Length s) const =0 |
| virtual bool | IsFlat () const noexcept=0 |
| virtual void | Transition (Length s, spat::Position< Length > &pos) const =0 |
| Copies the 3D Position at the specified location to pos. | |
| virtual void | Transition (Length s, spat::Vector< One > &tan) const =0 |
| Copies the 3D tangential vector at the specified location to tan. | |
| virtual void | Transition (Length s, spat::VectorBundle< Length, One > &bundle) const =0 |
| Copies the 3D Position and tangential vector at the specified location to bundle. | |
| virtual void | Transition (Length s, spat::VectorBundle2< Length, One > &bundle) const =0 |
| Copies the 3D Position and tangential and normal vectors at the specified location to bundle. | |
| virtual void | Transition (Length s, spat::Frame< Length, One > &frame) const =0 |
| Copies the 3D TBN-Frame at the specified location to frame. | |
| virtual std::vector< Length > | ZeroSet () const =0 |
| Returns a list of parameters at which the normal vector flips from one side to the other. | |
| virtual common::Interval< Length > | Range () const =0 |
| virtual spat::Vector< One > | LocalUp () const =0 |
| Gives the Curve's idiosyncratic up direction. Some curves maintain some idea about where they have their upside, either because of their form (e.g Helix) or because it is extra defined (e.g. for Line). Some curves maintain no such notion (e.g. many Cubics). | |
| virtual spat::Frame< Length, One > | GetCurveLocalTransformation () const =0 |
| virtual std::unique_ptr< Curve > | Clone () const =0 |
| make an exact copy of this curve. | |
| virtual bool | Mirror (const spat::VectorBundle< Length, One > &mirrorPlane)=0 |
| Make a Curve with mirrored geometry (but of course one thet returns right handed frames). | |
| virtual bool | Equals (const Curve &toCurve, common::Interval< Length > range, Length epsilon_length=epsilon__length, Angle epsilon_angle=epsilon__angle) const =0 |
| Comparison. | |
| Curve (Curve &&)=delete | |
| Curve & | operator= (const Curve &)=delete |
| Curve & | operator= (Curve &&)=delete |
Static Public Member Functions | |
| static dclspc std::unique_ptr< Rotator > | Make (CurveType type=CurveType::Rotator) noexcept |
| Makes a Rotator object. | |
Additional Inherited Members | |
| Public Types inherited from trax::Curve | |
| enum class | CurveType { none = 0 , Line , Arc , Helix , LineP , ArcP , HelixP , Clothoid , Cubic , Spline , Rotator , RotatorWithOffset , RotatorChain , PolygonalChain , SampledCurve , Parallel , EEPCurve , EEPResidual , EEPAlternative , Unknown , UserDefined } |
| Curve type identification values. More... | |
| Protected Member Functions inherited from trax::Curve | |
| Curve (const Curve &)=default | |
Curve with evenly (with respect to arc length) rotating tangent vector.
The curve starts at origin with tangent in Ex direction and will rotate its tangent around Ez by a*s and around T x Ez by b*s.
By definition it is:
/// /// ( cos(a(s)) cos(b(s)) ) /// dP/ds = D1 = ( sin(a(s)) cos(b(s)) ) /// ( sin(b(s)) ) /// ///
With some arbitray functions a(s), b(s). Since D1² = 1, the solution of the above differential equation, P(s), will be parameterized by arc length. So we have to solve the following integral:
/// s s ( cos(a) cos(b) ) /// P(s) = I dP(t)/dt dt = I ( sin(a) cos(b) ) dt = /// 0 0 ( sin(b) ) /// /// Bronstein 1991 /// 2.5.2.1.3. /// s ( cos(a-b) + cos(a+b) ) /// = 1/2 I ( sin(a-b) + sin(a+b) ) dt /// 0 ( 2 sin(b) ) /// ///
If we redefine a = a*s and b = b*s with now constant a,b, we get:
/// /// s ( cos((a-b)t) + cos((a+b)t) ) /// = 1/2 I ( sin((a-b)t) + sin((a+b)t) ) dt /// 0 ( 2 sin(bt) ) /// /// ( sin((a-b)t)/(a-b) + sin((a+b)t)/(a+b) ) s /// = 1/2 ( -cos((a-b)t)/(a-b) - cos((a+b)t)/(a+b) ) | /// ( -2 cos(bt)/b ) 0 /// /// ( sin((a-b)s)/(a-b) + sin((a+b)s)/(a+b) - 0 ) /// = 1/2 ( -cos((a-b)s)/(a-b) - cos((a+b)s)/(a+b) + 1/(a-b) + 1/(a+b) ) /// ( -2 cos(bs)/b + 2/b ) /// /// ( sin((a-b)s)/(a-b) + sin((a+b)s)/(a+b) ) /// = 1/2 ( (1-cos((a-b)s))/(a-b) + (1-cos((a+b)s))/(a+b) ) /// ( 2 (1-cos(bs))/b ) /// ///
The Rotator has non constant curvature: k = sqrt(D2*D2) = sqrt( pow<2>(a*cos(b*s)) + pow<2>(b) ), which only for a == 0 or b == 0 becomes constant, which cases would deliver an arc with curvature b or a respectively. Note that no other values for a and b would deliver an arc or a helix and that it in general can not get Normalize() 'd.
|
pure virtual |
Create the curve from data set for which it is guaranteed, that no calculational drift will happen e.g. in write/read cycles.
| std::invalid_argument | if for a non-offest rotator a0 or b0 ain't zero. |
|
pure virtual |
Returns the partial derivatives of the position P to the parameters a, b and s in a matrix, customly called a 'Jacobian matrix'.
| s | parameter to evaluate the derivatives. |
| std::bad_alloc | on memory exhaustion. |