mbsim  4.0.0
MBSim Kernel
MBSim::NurbsCurve Class Reference

class that copies the nurbs++-library using the fmatvec as a basis-math-library More...

#include <nurbs_curve.h>

Public Types

enum  Method { equallySpaced = 0 , chordLength }
 

Public Member Functions

 NurbsCurve ()=default
 standard constructor
 
int degree () const
 a reference to the degree of the curve
 
const fmatvec::MatVx4 & ctrlPnts () const
 a reference to the vector of control points
 
const fmatvec::Vec4 ctrlPnts (int i) const
 a reference to one of the control points
 
const fmatvec::VecV & knot () const
 a reference to the vector of knots
 
double knot (int i) const
 the i-th knot
 
const fmatvec::VecV getuVec () const
 a reference to the parametric points
 
void setKnot (const fmatvec::VecV &U_)
 
void setCtrlPnts (const fmatvec::MatVx4 &P_)
 
void setDegree (int deg_)
 
void setu (const fmatvec::VecV &u_)
 
void resize (int n, int Deg)
 
virtual fmatvec::HPoint< 3 > operator() (double u) const
 
fmatvec::HPoint< 3 > hpointAt (double u) const
 calls operator()
 
fmatvec::HPoint< 3 > hpointAt (double u, int span) const
 
fmatvec::Point< 3 > pointAt (double u) const
 
void deriveAtH (double u, int d, fmatvec::MatVx4 &ders) const
 
fmatvec::Point< 3 > derive3D (double u, int d) const
 
fmatvec::HPoint< 3 > derive (double u, int d) const
 
fmatvec::Point< 3 > normal (double u, const fmatvec::Point< 3 > &v) const
 
fmatvec::HPoint< 3 > firstD (double u) const
 
fmatvec::HPoint< 3 > firstD (double u, int span) const
 
fmatvec::Point< 3 > firstDn (double u) const
 
fmatvec::Point< 3 > firstDn (double u, int span) const
 
void globalInterp (const std::vector< fmatvec::Point< 3 > > &Q, const std::vector< double > &uk, int d, bool updateLater=false)
 do global interpolation for given interpolation-points list and knots with the given degree
 
void globalInterp (const std::vector< fmatvec::Point< 3 > > &Q, double uMin, double uMax, int d, bool updateLater=false)
 
void globalInterp (const fmatvec::MatVx3 &Q, double uMin, double uMax, int d, bool updateLater=false)
 
void globalInterpH (const fmatvec::MatVx4 &Qw, int d, Method method=chordLength)
 
void globalInterpH (const fmatvec::MatVx4 &Qw, const fmatvec::VecV &ub, const fmatvec::VecV &Uc, int d, bool updateLater=false)
 
void globalInterpClosed (const fmatvec::MatVx3 &Q, double uMin, double uMax, int d, bool updateLater=false)
 closed interpolation of the given (not yet wrapped) points at the given knot vector "ub" in a degree of "d"
 
void update (const fmatvec::MatVx3 &Q)
 update the control points with the same matrix as before
 
void update (const fmatvec::MatVx4 &Qw)
 
void globalInterpClosedH (const fmatvec::MatVx4 &Qw, int d, Method method=chordLength)
 
void globalInterpClosedH (const fmatvec::MatVx4 &Qw, const fmatvec::VecV &ub, const fmatvec::VecV &Uc, int d, bool updateLater=false)
 
void modCP (int i, const fmatvec::HPoint< 3 > &a)
 
int findSpan (double u) const
 

Protected Member Functions

void knotAveraging (const std::vector< double > &uk, int deg)
 
double chordLengthParam (const fmatvec::MatVx3 &Q, fmatvec::VecV &ub)
 
double chordLengthParamH (const fmatvec::MatVx4 &Q, fmatvec::VecV &ub)
 
double chordLengthParamClosedH (const fmatvec::MatVx4 &Q, fmatvec::VecV &ub, int d)
 
void updateUVecs (double uMin, double uMax)
 
void knotAveragingClosed (const std::vector< double > &uk, int deg)
 
void updateUVecsClosed (double uMin, double uMax)
 

Protected Attributes

fmatvec::MatVx4 P
 
fmatvec::Vector< fmatvec::Ref, int > Aipiv
 
fmatvec::SquareMatrix< fmatvec::Ref, double > ALU
 
fmatvec::VecV u
 
fmatvec::VecV U
 
int deg {0}
 

Related Functions

(Note that these are not member functions.)

void knotAveraging (const VecV &uk, int deg, VecV &U)
 Generates a knot vector using the averaging technique. More...
 

Detailed Description

class that copies the nurbs++-library using the fmatvec as a basis-math-library

Todo:
: could/should be derived by function<Vec3(double)>

Friends And Related Function Documentation

◆ knotAveraging()

void knotAveraging ( const VecV &  uk,
int  deg,
VecV &  U 
)
related

Generates a knot vector using the averaging technique.

The technique is as follows:

  • \( u_0 = \cdots = u_{deg} = 0 \)
  • \( u_{m-deg} = \cdots = u_{m-1} = 1 \)
  • \( u_{j+deg} = \frac{1}{deg}\sum_{i=j}^{j+deg+1}\bar{u}_i\hspace{0.5in} j= 1,\ldots,n-deg-1 \)

where \(n\) is the size of the \(\bar{u}\) knot coefficient vector, \(m=n+deg+1\) is the size of the knot vector and $deg$ is the degree of the curve.

Parameters
ukthe knot coefficients
degthe degree of the curve associated with the knot vector
Uan average knot vector
Author
Philippe Lavoie
Date
24 January, 1997

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