Simbody  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SimTK::Geodesic Class Reference

This class stores a geodesic curve after it has been determined. More...

Public Member Functions

 Geodesic ()
 Construct an empty geodesic. More...
 
int getNumPoints () const
 
const Array_< Transform > & getFrenetFrames () const
 Frenet frame of geodesic at arc length s: More...
 
Array_< Transform > & updFrenetFrames ()
 
void addFrenetFrame (const Transform &Kf)
 
Array_< Real > & updArcLengths ()
 
const Array_< Real > & getArcLengths () const
 
void addArcLength (Real s)
 
Array_< Real > & updCurvatures ()
 
const Array_< Real > & getCurvatures () const
 
void addCurvature (Real kappa)
 
Array_< Vec2 > & updDirectionalSensitivityPtoQ ()
 
const Array_< Vec2 > & getDirectionalSensitivityPtoQ () const
 
void addDirectionalSensitivityPtoQ (const Vec2 &jP)
 
Array_< Vec2 > & updDirectionalSensitivityQtoP ()
 
const Array_< Vec2 > & getDirectionalSensitivityQtoP () const
 
void addDirectionalSensitivityQtoP (const Vec2 &jQ)
 
Array_< Vec2 > & updPositionalSensitivityPtoQ ()
 
const Array_< Vec2 > & getPositionalSensitivityPtoQ () const
 
void addPositionalSensitivityPtoQ (const Vec2 &jtP)
 
Array_< Vec2 > & updPositionalSensitivityQtoP ()
 
const Array_< Vec2 > & getPositionalSensitivityQtoP () const
 
void addPositionalSensitivityQtoP (const Vec2 &jtQ)
 
void setTorsionAtP (Real tauP)
 
void setTorsionAtQ (Real tauQ)
 
void setBinormalCurvatureAtP (Real muP)
 
void setBinormalCurvatureAtQ (Real muQ)
 
Real getLength () const
 Return the total arc length of this geodesic curve. More...
 
Real calcLengthDot (const Vec3 &xdotP, const Vec3 &xdotQ) const
 Given the time derivatives of the surface coordinates of P and Q, calculate the rate of change of length of this geodesic. More...
 
const Vec3getPointP () const
 Return the location on the surface of the geodesic's starting point P, measured and expressed in the surface frame S. More...
 
const Vec3getPointQ () const
 Return the location on the surface of the geodesic's ending point Q, measured and expressed in the surface frame S. More...
 
const UnitVec3getNormalP () const
 Return the surface outward unit normal at P, which is aligned with the curve normal there but will have opposite sign if the geodesic curvature is positive at P. More...
 
const UnitVec3getNormalQ () const
 Return the surface outward unit normal at Q, which is aligned with the curve normal there but will have opposite sign if the geodesic curvature is positive at Q. More...
 
const UnitVec3getTangentP () const
 Return the unit tangent to the geodesic at P, pointing in the direction of increasing arc length parameters (i.e., towards Q). More...
 
const UnitVec3getTangentQ () const
 Return the unit tangent to the geodesic at Q, pointing in the direction of increasing arc length parameters (i.e., away from P). More...
 
const UnitVec3getBinormalP () const
 Return the unit binormal vector to the curve at P, defined as bP = tP X nP. More...
 
const UnitVec3getBinormalQ () const
 Return the unit binormal vector to the curve at Q, defined as bQ = tQ X nQ. More...
 
Real getCurvatureP () const
 Return the geodesic normal curvature at P, defined to be positive when the surface is convex in the curve tangent direction at P, negative if the surface is concave in that direction. More...
 
Real getCurvatureQ () const
 Return the geodesic normal curvature at Q, defined to be positive when the surface is convex in the curve tangent direction at Q, negative if the surface is concave in that direction. More...
 
Real getTorsionP () const
 Return the geodesic torsion at P, that is, the twisting of the Frenet frame as you move along the tangent towards Q. More...
 
Real getTorsionQ () const
 Return the geodesic torsion at Q, that is, the twisting of the Frenet frame as you move along the tangent away from P, that is, off the end of the geodesic. More...
 
Real getBinormalCurvatureP () const
 Return the surface curvature in the binormal direction at P; don't confuse this with the geodesic torsion at P. More...
 
Real getBinormalCurvatureQ () const
 Return the surface curvature in the binormal direction at Q; don't confuse this with the geodesic torsion at Q. More...
 
Real getJacobiP () const
 Return jP, the Jacobi field term giving the sensitivity of the P end of the geodesic to changes in tangent direction at the Q end, assuming the geodesic length is fixed. More...
 
Real getJacobiQ () const
 Return jQ, the Jacobi field term giving the sensitivity of the Q end of the geodesic to changes in tangent direction at the P end, assuming the geodesic length is fixed. More...
 
Real getJacobiPDot () const
 Return the derivative of jP with respect to s, the arc length of the geodesic (which always runs from P to Q). More...
 
Real getJacobiQDot () const
 Return the derivative of jQ with respect to s, the arc length of the geodesic. More...
 
Real getJacobiTransP () const
 
Real getJacobiTransQ () const
 
Real getJacobiTransPDot () const
 
Real getJacobiTransQDot () const
 
void clear ()
 Clear the data in this geodesic, returning it to its default-constructed state, although memory remains allocated. More...
 
void setIsConvex (bool isConvex)
 
void setIsShortest (bool isShortest)
 
void setInitialStepSizeHint (Real sz)
 
void setAchievedAccuracy (Real acc)
 
bool isConvex () const
 
bool isShortest () const
 
Real getInitialStepSizeHint () const
 
Real getAchievedAccuracy () const
 
void dump (std::ostream &o) const
 

Detailed Description

This class stores a geodesic curve after it has been determined.

The curve is represented by a discrete set of Frenet frames along its arc length, with each frame providing a point on the curve, the tangent along the curve there, surface normal, and binormal. The number of points is determined by the accuracy to which the geodesic was calculated and the complexity of the surface. For analytical geodesics, we'll sample the curve to generate enough points for visualization but the accuracy will be machine precision. The first point is at arclength s=0, the last is at the actual length of the geodesic. We call the first point P and the last point Q, and the geodesic arc length increases from P to Q, with the tangent always pointing in the direction of increasing arc length.

Constructor & Destructor Documentation

SimTK::Geodesic::Geodesic ( )
inline

Construct an empty geodesic.

Member Function Documentation

int SimTK::Geodesic::getNumPoints ( ) const
inline
const Array_<Transform>& SimTK::Geodesic::getFrenetFrames ( ) const
inline

Frenet frame of geodesic at arc length s:

  • origin: point on geodesic at s
  • z axis: outward surface (unit) normal n at s
  • y axis: unit tangent t at s in direction of increasing arc length
  • x axis: unit binormal at s: b=t X n (x=y X z)

Note that this convention is different from that of a curve, because our normal vector always points outwards from the surface.

Array_<Transform>& SimTK::Geodesic::updFrenetFrames ( )
inline
void SimTK::Geodesic::addFrenetFrame ( const Transform Kf)
inline
Array_<Real>& SimTK::Geodesic::updArcLengths ( )
inline
const Array_<Real>& SimTK::Geodesic::getArcLengths ( ) const
inline
void SimTK::Geodesic::addArcLength ( Real  s)
inline
Array_<Real>& SimTK::Geodesic::updCurvatures ( )
inline
const Array_<Real>& SimTK::Geodesic::getCurvatures ( ) const
inline
void SimTK::Geodesic::addCurvature ( Real  kappa)
inline
Array_<Vec2>& SimTK::Geodesic::updDirectionalSensitivityPtoQ ( )
inline
const Array_<Vec2>& SimTK::Geodesic::getDirectionalSensitivityPtoQ ( ) const
inline
void SimTK::Geodesic::addDirectionalSensitivityPtoQ ( const Vec2 jP)
inline
Array_<Vec2>& SimTK::Geodesic::updDirectionalSensitivityQtoP ( )
inline
const Array_<Vec2>& SimTK::Geodesic::getDirectionalSensitivityQtoP ( ) const
inline
void SimTK::Geodesic::addDirectionalSensitivityQtoP ( const Vec2 jQ)
inline
Array_<Vec2>& SimTK::Geodesic::updPositionalSensitivityPtoQ ( )
inline
const Array_<Vec2>& SimTK::Geodesic::getPositionalSensitivityPtoQ ( ) const
inline
void SimTK::Geodesic::addPositionalSensitivityPtoQ ( const Vec2 jtP)
inline
Array_<Vec2>& SimTK::Geodesic::updPositionalSensitivityQtoP ( )
inline
const Array_<Vec2>& SimTK::Geodesic::getPositionalSensitivityQtoP ( ) const
inline
void SimTK::Geodesic::addPositionalSensitivityQtoP ( const Vec2 jtQ)
inline
void SimTK::Geodesic::setTorsionAtP ( Real  tauP)
inline
void SimTK::Geodesic::setTorsionAtQ ( Real  tauQ)
inline
void SimTK::Geodesic::setBinormalCurvatureAtP ( Real  muP)
inline
void SimTK::Geodesic::setBinormalCurvatureAtQ ( Real  muQ)
inline
Real SimTK::Geodesic::getLength ( ) const
inline

Return the total arc length of this geodesic curve.

Will return zero if no curve has been calculated.

Real SimTK::Geodesic::calcLengthDot ( const Vec3 xdotP,
const Vec3 xdotQ 
) const
inline

Given the time derivatives of the surface coordinates of P and Q, calculate the rate of change of length of this geodesic.

Only the components of xdotP and xdotQ along the curve tangent directions can affect its length; moves in the normal or binormal direction leave the length unchanged.

const Vec3& SimTK::Geodesic::getPointP ( ) const
inline

Return the location on the surface of the geodesic's starting point P, measured and expressed in the surface frame S.

const Vec3& SimTK::Geodesic::getPointQ ( ) const
inline

Return the location on the surface of the geodesic's ending point Q, measured and expressed in the surface frame S.

const UnitVec3& SimTK::Geodesic::getNormalP ( ) const
inline

Return the surface outward unit normal at P, which is aligned with the curve normal there but will have opposite sign if the geodesic curvature is positive at P.

const UnitVec3& SimTK::Geodesic::getNormalQ ( ) const
inline

Return the surface outward unit normal at Q, which is aligned with the curve normal there but will have opposite sign if the geodesic curvature is positive at Q.

const UnitVec3& SimTK::Geodesic::getTangentP ( ) const
inline

Return the unit tangent to the geodesic at P, pointing in the direction of increasing arc length parameters (i.e., towards Q).

const UnitVec3& SimTK::Geodesic::getTangentQ ( ) const
inline

Return the unit tangent to the geodesic at Q, pointing in the direction of increasing arc length parameters (i.e., away from P).

const UnitVec3& SimTK::Geodesic::getBinormalP ( ) const
inline

Return the unit binormal vector to the curve at P, defined as bP = tP X nP.

const UnitVec3& SimTK::Geodesic::getBinormalQ ( ) const
inline

Return the unit binormal vector to the curve at Q, defined as bQ = tQ X nQ.

Real SimTK::Geodesic::getCurvatureP ( ) const
inline

Return the geodesic normal curvature at P, defined to be positive when the surface is convex in the curve tangent direction at P, negative if the surface is concave in that direction.

This is a scalar kappaP=-dot(DtP/ds,nP). Note that the geodesic curvature is the same as the surface curvature in the curve tangent direction.

Real SimTK::Geodesic::getCurvatureQ ( ) const
inline

Return the geodesic normal curvature at Q, defined to be positive when the surface is convex in the curve tangent direction at Q, negative if the surface is concave in that direction.

This is a scalar kappaQ=-dot(DtQ/ds,nQ). Note that the geodesic curvature is the same as the surface curvature in the curve tangent direction, and remember that the curve tangent at Q points away from P, that is, off the end of the geodesic.

Real SimTK::Geodesic::getTorsionP ( ) const
inline

Return the geodesic torsion at P, that is, the twisting of the Frenet frame as you move along the tangent towards Q.

The sign follows the right hand rule with your thumb directed along the tangent. This is a scalar tauP=-dot(DbP/Ds,nP).

Real SimTK::Geodesic::getTorsionQ ( ) const
inline

Return the geodesic torsion at Q, that is, the twisting of the Frenet frame as you move along the tangent away from P, that is, off the end of the geodesic.

The sign follows the right hand rule with your thumb directed along the tangent. This is a scalar tauQ=-dot(DbQ/Ds,nQ).

Real SimTK::Geodesic::getBinormalCurvatureP ( ) const
inline

Return the surface curvature in the binormal direction at P; don't confuse this with the geodesic torsion at P.

Surface curvature in a direction is a property of the surface independent of any curve.

Real SimTK::Geodesic::getBinormalCurvatureQ ( ) const
inline

Return the surface curvature in the binormal direction at Q; don't confuse this with the geodesic torsion at Q.

Surface curvature in a direction is a property of the surface independent of any curve.

Real SimTK::Geodesic::getJacobiP ( ) const
inline

Return jP, the Jacobi field term giving the sensitivity of the P end of the geodesic to changes in tangent direction at the Q end, assuming the geodesic length is fixed.

This is a scalar jP=dot(DP/DthetaQ,bP) where thetaQ is a right-hand-rule rotation about the normal nQ at Q. Caution: jP and jQ have opposite signs.

Real SimTK::Geodesic::getJacobiQ ( ) const
inline

Return jQ, the Jacobi field term giving the sensitivity of the Q end of the geodesic to changes in tangent direction at the P end, assuming the geodesic length is fixed.

This is a scalar jQ=-dot(DQ/DthetaP,bQ) where thetaP is a right-hand-rule rotation about the normal nP at P. Note that jQ has the opposite sign from jP.

Real SimTK::Geodesic::getJacobiPDot ( ) const
inline

Return the derivative of jP with respect to s, the arc length of the geodesic (which always runs from P to Q).

That is jPDot = d/ds jP.

Real SimTK::Geodesic::getJacobiQDot ( ) const
inline

Return the derivative of jQ with respect to s, the arc length of the geodesic.

That is, jQDot = d/ds jQ.

Real SimTK::Geodesic::getJacobiTransP ( ) const
inline
Real SimTK::Geodesic::getJacobiTransQ ( ) const
inline
Real SimTK::Geodesic::getJacobiTransPDot ( ) const
inline
Real SimTK::Geodesic::getJacobiTransQDot ( ) const
inline
void SimTK::Geodesic::clear ( )
inline

Clear the data in this geodesic, returning it to its default-constructed state, although memory remains allocated.

void SimTK::Geodesic::setIsConvex ( bool  isConvex)
inline
void SimTK::Geodesic::setIsShortest ( bool  isShortest)
inline
void SimTK::Geodesic::setInitialStepSizeHint ( Real  sz)
inline
void SimTK::Geodesic::setAchievedAccuracy ( Real  acc)
inline
bool SimTK::Geodesic::isConvex ( ) const
inline
bool SimTK::Geodesic::isShortest ( ) const
inline
Real SimTK::Geodesic::getInitialStepSizeHint ( ) const
inline
Real SimTK::Geodesic::getAchievedAccuracy ( ) const
inline
void SimTK::Geodesic::dump ( std::ostream &  o) const

The documentation for this class was generated from the following file: