chrono::geometry::ChBasisToolsBspline Class Reference

Description

Tools for evaluating basis functions for B-splines, parametrized with parameter u (as lines) These bases are often called "N" in literature.

#include <ChBasisToolsBspline.h>

Static Public Member Functions

static int FindSpan (const int p, const double u, const ChVectorDynamic<> &knotU)
 Find the knot span of a b-spline given the parameter u, the order p, the knot vector knotU. More...
 
static void ComputeKnotUniformMultipleEnds (ChVectorDynamic<> &knotU, const int p, double kstart=0.0, double kend=1.0)
 Compute uniformly-spaced k knots (in range [kstart, kend]) for open Bsplines, with order p. More...
 
static void ComputeKnotUniform (ChVectorDynamic<> &knotU, const int p, double kstart=0.0, double kend=1.0)
 Compute uniformly-spaced k knots (in range [kstart, kend]) for Bsplines, with order p. More...
 
static void BasisEvaluate (const int p, const int i, const double u, const ChVectorDynamic<> &knotU, ChVectorDynamic<> &N)
 Compute vector of bases N. More...
 
static void BasisEvaluateDeriv (const int p, const int i, const double u, const ChVectorDynamic<> &knotU, ChMatrixDynamic<> &DN)
 Compute bases and first n-th derivatives of bases dN/du and ddN/ddu etc, arranged in a matrix. More...
 

Member Function Documentation

◆ BasisEvaluate()

static void chrono::geometry::ChBasisToolsBspline::BasisEvaluate ( const int  p,
const int  i,
const double  u,
const ChVectorDynamic<> &  knotU,
ChVectorDynamic<> &  N 
)
inlinestatic

Compute vector of bases N.

Evaluate ALL the p+1 nonzero basis functions N of a b-spline, at the i-th knot span, given the parameter u, the order p, the knot vector knotU. Results go into the row vector N = { N1, N2, N3.... N_(p+1) }

Parameters
porder
iknot span, assume aready computed via FindSpan()
uparameter
knotUknot vector
Nhere return basis functions N evaluated at u, that is: N(u)

◆ BasisEvaluateDeriv()

static void chrono::geometry::ChBasisToolsBspline::BasisEvaluateDeriv ( const int  p,
const int  i,
const double  u,
const ChVectorDynamic<> &  knotU,
ChMatrixDynamic<> &  DN 
)
inlinestatic

Compute bases and first n-th derivatives of bases dN/du and ddN/ddu etc, arranged in a matrix.

Evaluate derivatives of ALL the p+1 nonzero basis functions N of a b-spline, at the i-th knot span, given the parameter u, the order p, the knot vector knotU. Results go into the ChMatrixDynamic<> , where j-th derivative is j-th row: DN = | N1, N2, N3, ...., N_(p+1) | | dN1/du, dN2/du, dN3/du, ...., dN_(p+1)/du | | ddN1/ddu, ddN2/ddu, ddN3/ddu ...., ddN_(p+1)/ddu | The derivative order ranges from 0 (no derivative) to d, where d is the number of rows of the passed DN matrix. Usually two rows, for N and their shape derivatives.

Parameters
porder of spline
iknot span, assume aready computed via FindSpan()
uparameter
knotUknot vector
DNhere return derivatives evaluated at u, that is: dN/du(u)

◆ ComputeKnotUniform()

static void chrono::geometry::ChBasisToolsBspline::ComputeKnotUniform ( ChVectorDynamic<> &  knotU,
const int  p,
double  kstart = 0.0,
double  kend = 1.0 
)
inlinestatic

Compute uniformly-spaced k knots (in range [kstart, kend]) for Bsplines, with order p.

If you need that the spline starts and ends exactly at the 1st and last control point, use ComputeKnotUniformMultipleEnds instead. This is often used when creating closed splines, where the last and first p control points will overlap.

Parameters
knotUknot vector
porder
kstartrange start
kendrange end

◆ ComputeKnotUniformMultipleEnds()

static void chrono::geometry::ChBasisToolsBspline::ComputeKnotUniformMultipleEnds ( ChVectorDynamic<> &  knotU,
const int  p,
double  kstart = 0.0,
double  kend = 1.0 
)
inlinestatic

Compute uniformly-spaced k knots (in range [kstart, kend]) for open Bsplines, with order p.

Assuming the size of knotU is already k=n+p+1 for n control points. The p+1 initial and end knots are made multiple.

Parameters
knotUknot vector
porder
kstartrange start
kendrange end

◆ FindSpan()

static int chrono::geometry::ChBasisToolsBspline::FindSpan ( const int  p,
const double  u,
const ChVectorDynamic<> &  knotU 
)
inlinestatic

Find the knot span of a b-spline given the parameter u, the order p, the knot vector knotU.

Parameters
porder
uparameter
knotUknot vector

The documentation for this class was generated from the following file:
  • /builds/uwsbel/chrono/src/chrono/geometry/ChBasisToolsBspline.h