geomc 1.0
A c++ linear algebra template library
Loading...
Searching...
No Matches
CatromSplinePath< T, N > Class Template Reference

An extendable path which passes through a sequence of knots. More...

#include <geomc/shape/CubicPath.h>

Inheritance diagram for CatromSplinePath< T, N >:
SplinePath< T, N, CatromSpline< T, N >, CatromSplinePath< T, N > > Dimensional< T, N >

Public Types

using elem_t
 The coordinate type of this object.
 
using Knot = VecType<T,N>
 
using point_t
 The type of a point in this object's space.
 
using Spline
 

Public Member Functions

 CatromSplinePath ()=default
 Construct an empty path.
 
 CatromSplinePath (const CatromSpline< T, N > &segment)
 Construct a path having a single segment.
 
 CatromSplinePath (const std::initializer_list< VecType< T, N > > knots)
 Construct a path from a sequence of knots.
 
VecType< T, Nacceleration (T s) const
 Evaluate the second derivative of the path at s, with respect to s.
 
Rect< T, Nbounds () const
 Compute the axis-aligned bounding box of the path.
 
size_t n_segments () const
 Return the number of complete segments in the path.
 
VecType< T, Noperator() (T s) const
 Evaluate the path at s.
 
std::optional< CatromSpline< T, N > > operator[] (size_t i) const
 Return the ith segment in the path.
 
std::optional< size_t > segment (T s) const
 Return the index of the segment containing s.
 
VecType< T, Nvelocity (T s) const
 Evaluate the derivative of the path at s, with respect to s.
 

Public Attributes

std::vector< VecType< T, N > > knots
 The sequence of knots which the path passes through.
 

Static Public Attributes

static constexpr index_t N
 The dimension of this object.
 

Detailed Description

template<typename T, index_t N>
class geom::CatromSplinePath< T, N >

An extendable path which passes through a sequence of knots.

CatromSplinePaths are defined by sequence of knots, where each Catmull-Rom spline segment is defined by four consecutive knots in the sequence.

Catmull-Rom splines are C1 continuous. The first and last knots are not part of the curve.

Member Typedef Documentation

◆ point_t

using point_t
inherited

The type of a point in this object's space.

An N-vector of T if N > 1, otherwise a T.

Member Function Documentation

◆ acceleration()

VecType< T, N > acceleration ( T s) const
inlineinherited

Evaluate the second derivative of the path at s, with respect to s.

The range of s is the same as for operator().

◆ bounds()

Rect< T, N > bounds ( ) const
inlineinherited

Compute the axis-aligned bounding box of the path.

O(n) on the number of segments.

◆ n_segments()

template<typename T, index_t N>
size_t n_segments ( ) const
inline

Return the number of complete segments in the path.

A single segment is defined by four consecutive control points.

◆ operator()()

VecType< T, N > operator() ( T s) const
inlineinherited

Evaluate the path at s.

Segment i is evaluated for s in the range [i, i + 1]. If s is outside the range [0, n_segments()], the path is extrapolated using the first or last segment.

◆ operator[]()

template<typename T, index_t N>
std::optional< CatromSpline< T, N > > operator[] ( size_t i) const
inline

Return the ith segment in the path.

If there are no complete segments in the path, return std::nullopt.

◆ segment()

std::optional< size_t > segment ( T s) const
inlineinherited

Return the index of the segment containing s.

If there are no complete segments in the path, return std::nullopt.

◆ velocity()

VecType< T, N > velocity ( T s) const
inlineinherited

Evaluate the derivative of the path at s, with respect to s.

The range of s is the same as for operator().


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