SplineVec Class ReferenceΒΆ

Splines: SplineVec Class Reference
Splines
Inheritance diagram for SplineVec:

Public Member Functions

function SplineVec ()
 
function setup (in self, in P)
 
function knots (in self, in t)
 
function get_knots (in self)
 
function chordal (in self)
 
function centripetal (in self)
 
function CatmullRom (in self)
 
function eval (in self, in x)
 
function eval_D (in self, in x)
 
function eval_DD (in self, in x)
 
function eval_DDD (in self, in x)
 
function curvature (in self, in x)
 
function curvature_D (in self, in x)
 
function tmin (in self, in x)
 
function tmax (in self, in x)
 

Protected Member Functions

function copyElement (in self)
 

Detailed Description

MATLAB class wrapper for the underlying C++ class

The construction of the spline is done as follows

  • instantiate the spline object
spl = SplineVec();
  • load the points as a matrix dim x npts where dim is the space dimension and npts is the number of poinst
spl.setup( P ); % P is a dim x npts matrix
  • build or load the knots
spl.knots( T ); % vector of knots
spl.chordal(); % build knots using chordal distance
spl.centripetal(; % build knots centripetal
  • build the spline, for the moment only Catmull Rom
spl.CatmullRom();

Constructor & Destructor Documentation

◆ SplineVec()

function SplineVec::SplineVec ( )

Build an empty parametric spline:

spl = SplineVec();

Member Function Documentation

◆ CatmullRom()

function SplineVec::CatmullRom ( in self)

Build the spline using Catmull Rom algorithm

P = [ 0, 0; 1.34, 5; 5, 8.66; 10, 10; 10.6, 10.4; 10.7, 12; ...
10.7, 28.6; 10.8, 30.2; 11.4, 30.6; 19.6, 30.6; ...
20.2, 30.2; 20.3, 28.6; 20.3, 12; 20.4, 10.4; ...
21, 10; 26, 8.66; 29.66, 5; 31, 0 ];
S = SplineVec(); % initialize spline
S.setup(P.'); % load points
S.centripetal(); % setup knots
% plot interpolation points
hold off;
plot( P(:,1), P(:,2), 'o','Color','red', ...
'MarkerSize',10,'MarkerFaceColor','blue','MarkerEdgeColor','green');
hold on;
% sample spline for plotting
t = linspace(S.tmin(),S.tmax(),1000);
PP = S.eval(t);
% plot curve
plot( PP(1,:), PP(2,:), '-', 'Color', 'blue', 'Linewidth', 3);

\html_imega{exampleVec.png,width=80%}

◆ centripetal()

function SplineVec::centripetal ( in self)

Build the knots using centripetal parametrization

\begin{eqnarray*} t_0 = 0, \qquad t_k = t_{k-1} + || \mathbf{p}_k - \mathbf{p}_{k-1} ||^{1/2} \end{eqnarray*}

◆ chordal()

function SplineVec::chordal ( in self)

Build the knots using chordal distance

\begin{eqnarray*} t_0 = 0, \qquad t_k = t_{k-1} + || \mathbf{p}_k - \mathbf{p}_{k-1} || \end{eqnarray*}

◆ copyElement()

function SplineVec::copyElement ( in self)
protected

Make a deep copy of a curve object

Usage

B = A.copy();

where A is the curve object to be copied.

◆ curvature()

function SplineVec::curvature ( in self,
in x )

Evaluate spline curvature at x

kappa = obj.curvature( x );

◆ curvature_D()

function SplineVec::curvature_D ( in self,
in x )

Evaluate spline curvature derivative at x

kappa = obj.curvature_D( x );

◆ eval()

function SplineVec::eval ( in self,
in x )

Evaluate spline at x

p = obj.eval( x );

◆ eval_D()

function SplineVec::eval_D ( in self,
in x )

Evaluate spline derivative at x

p_D = obj.eval_D( x );

◆ eval_DD()

function SplineVec::eval_DD ( in self,
in x )

Evaluate spline second derivative at x

p_DD = obj.eval_DD( x );

◆ eval_DDD()

function SplineVec::eval_DDD ( in self,
in x )

Evaluate spline third derivative at x

p_DDD = obj.eval_DDD( x );

◆ get_knots()

function SplineVec::get_knots ( in self)

Get the knots of the spline

t = spl.get_knots();

◆ knots()

function SplineVec::knots ( in self,
in t )

Setup the knots of the spline

spl.knots( t );

◆ setup()

function SplineVec::setup ( in self,
in P )

Setup the point of the spline

spl.setup( P );

◆ tmax()

function SplineVec::tmax ( in self,
in x )

Return initial t-coordinate of the spline

t = obj.tmax();

◆ tmin()

function SplineVec::tmin ( in self,
in x )

Return initial t-coordinate of the spline

t = obj.tmin();

The documentation for this class was generated from the following file:
  • /Users/enrico/Ricerca/develop/PINS/pins-mechatronix/LibSources/submodules/Splines/toolbox/lib/SplineVec.m