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

An extendable path defined by a sequence of knots and tangent velocities. More...

#include <geomc/shape/CubicPath.h>

Inheritance diagram for HermitePath< T, N >:
SplinePath< T, N, HermiteSpline< T, N >, HermitePath< T, N > > Dimensional< T, N >

Classes

struct  Knot
 A knot in a Hermite path, along with its tangent velocity. More...
 

Public Types

using elem_t
 The coordinate type of this object.
 
using point_t
 The type of a point in this object's space.
 
using Spline
 

Public Member Functions

 HermitePath ()=default
 Construct an empty path.
 
 HermitePath (const HermiteSpline< T, N > &segment)
 Construct a path having a single segment.
 
 HermitePath (const std::initializer_list< Knot > 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< HermiteSpline< 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< Knotknots
 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::HermitePath< T, N >

An extendable path defined by a sequence of knots and tangent velocities.

Hermite paths are concatenated cubic Hermite splines, where the first knot of each segment is the last knot of the previous segment. Each knot has an associated tangent velocity.

Hermite curves are C1 continuous, and pass through their knots.

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.

Each 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< HermiteSpline< 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: