Allolib  1.0
C++ Components For Interactive Multimedia
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
al::Frenet< Vec3 > Struct Template Reference

Frenet frame generator. More...

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/spatial/al_Curve.hpp>

Public Member Functions

 Frenet (const Vec3 &p2=Vec3(0, -0.01, 0), const Vec3 &p1=Vec3(0, 0, 0))
 
const Vec3 & point () const
 Get point one ahead of currently stored frame.
 
const Vec3 & db () const
 Get backward first difference.
 
const Vec3 & df () const
 Get forward first difference.
 
Vec3 d2 () const
 Get (central) second difference.
 
void operator() (const Vec3 &p0)
 Compute Frenet frame one point back from input point.
 
template<bool NormalizeT, bool NormalizeN, bool NormalizeB, bool ComputeN, bool ComputeB>
void next (const Vec3 &p0)
 Compute Frenet frame one point back from input point. More...
 
void init (const Vec3 &p2, const Vec3 &p1)
 (Re)initialize with previous two points
 

Public Attributes

Vec3 T
 Tangent vector of current frame.
 
Vec3 N
 Normal vector of current frame.
 
Vec3 B
 Binormal vector of current frame.
 

Protected Attributes

Vec3 mp1
 
Vec3 mdb
 
Vec3 mdf
 

Detailed Description

template<class Vec3>
struct al::Frenet< Vec3 >

Frenet frame generator.

This class generates a sequence of Frenet frames given a corresponding sequence of discrete points along a curve. A Frenet frame is computed from a run of three consecutive points and corresponds to the middle point. A Frenet frame is an orthonormal reference frame describing the local tangent (T), normal (N), and binormal (B) unit vectors of a curve. The frame is based on a right-handed coordinate system so that T = N x B, N = B x T, and B = T x N.

Template Parameters
Vec33-vector type

Definition at line 75 of file al_Curve.hpp.

Constructor & Destructor Documentation

◆ Frenet()

template<class Vec3 >
al::Frenet< Vec3 >::Frenet ( const Vec3 &  p2 = Vec3(0, -0.01, 0),
const Vec3 &  p1 = Vec3(0, 0, 0) 
)
inline
Parameters
[in]p2two points back
[in]p1one point back

Definition at line 82 of file al_Curve.hpp.

Member Function Documentation

◆ next()

template<class Vec3 >
template<bool NormalizeT, bool NormalizeN, bool NormalizeB, bool ComputeN, bool ComputeB>
void al::Frenet< Vec3 >::next ( const Vec3 &  p0)
inline

Compute Frenet frame one point back from input point.

For best results, avoid runs of 3 or more colinear points and 2 or more duplicate points. Colinear points result in ambiguous normal and binormal vectors. Duplicated points make the first derivative undefined. Both of these situations are guaranteed to wreak numerical havok.

Definition at line 109 of file al_Curve.hpp.


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