Public Member Functions | List of all members
BSpline Class Reference

An implementation of B-splines. More...

Inheritance diagram for BSpline:
Inheritance graph
[legend]
Collaboration diagram for BSpline:
Collaboration graph
[legend]

Public Member Functions

 BSpline (const pointField &knots, const bool notImplementedClosed=false)
 
point position (const scalar lambda) const
 
point position (const label segment, const scalar lambda) const
 
scalar length () const
 
- Public Member Functions inherited from polyLine
 polyLine (const pointField &points, const bool notImplementedClosed=false)
 
 polyLine (const point &start, const pointField &intermediate, const point &end, const bool notImplementedClosed=false)
 
const pointFieldpoints () const noexcept
 
label nSegments () const noexcept
 
point position (const scalar) const
 
point position (const label segment, const scalar) const
 
scalar length () const noexcept
 

Additional Inherited Members

- Static Public Member Functions inherited from polyLine
static tmp< pointFieldconcat (const point &start, const pointField &intermediate, const point &end)
 
- Protected Member Functions inherited from polyLine
void calcParam ()
 
label localParameter (scalar &lambda) const
 
- Protected Attributes inherited from polyLine
pointField points_
 
scalar lineLength_
 
scalarList param_
 

Detailed Description

An implementation of B-splines.

In this implementation, the end tangents are created automatically by reflection.

In matrix form, the local interpolation on the interval t=[0..1] is described as follows:

P(t) = 1/6 * [ t^3 t^2 t 1 ] * [ -1  3 -3  1 ] * [ P-1 ]
                               [  3 -6  3  0 ]   [ P0 ]
                               [ -3  0  3  0 ]   [ P1 ]
                               [  1  4  1  0 ]   [ P2 ]

Where P-1 and P2 represent the neighbouring points or the extrapolated end points. Simple reflection is used to automatically create the end points.

The spline is discretized based on the chord length of the individual segments. In rare cases (sections with very high curvatures), the resulting distribution may be sub-optimal.

A future implementation could also handle closed splines.

See also
CatmullRomSpline
Source files

Definition at line 72 of file BSpline.H.

Constructor & Destructor Documentation

◆ BSpline()

BSpline ( const pointField knots,
const bool  notImplementedClosed = false 
)
explicit

Definition at line 27 of file BSpline.C.

Member Function Documentation

◆ position() [1/2]

Foam::point position ( const scalar  lambda) const

Definition at line 38 of file BSpline.C.

References lambda(), polyLine::localParameter(), Foam::constant::physicoChemical::mu, and polyLine::points().

Referenced by BSplineEdge::position().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ position() [2/2]

Foam::point position ( const label  segment,
const scalar  lambda 
) const

Definition at line 57 of file BSpline.C.

References Foam::constant::physicoChemical::mu, p0, and points.

◆ length()

Foam::scalar length ( ) const

Definition at line 127 of file BSpline.C.

References NotImplemented.

Referenced by BSplineEdge::length().

Here is the caller graph for this function:

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