geomc 1.0
A c++ linear algebra template library
|
An extendable path which passes through a sequence of knots. More...
#include <geomc/shape/CubicPath.h>
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, N > | acceleration (T s) const |
Evaluate the second derivative of the path at s , with respect to s . | |
Rect< T, N > | bounds () 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, N > | operator() (T s) const |
Evaluate the path at s . | |
std::optional< CatromSpline< T, N > > | operator[] (size_t i) const |
Return the i th segment in the path. | |
std::optional< size_t > | segment (T s) const |
Return the index of the segment containing s . | |
VecType< T, N > | velocity (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. | |
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.
|
inherited |
The type of a point in this object's space.
An N-vector of T if N > 1, otherwise a T.
Evaluate the second derivative of the path at s
, with respect to s
.
The range of s
is the same as for operator()
.
Compute the axis-aligned bounding box of the path.
O(n) on the number of segments.
|
inline |
Return the number of complete segments in the path.
A single segment is defined by four consecutive control points.
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.
|
inline |
Return the i
th segment in the path.
If there are no complete segments in the path, return std::nullopt
.
|
inlineinherited |
Return the index of the segment containing s
.
If there are no complete segments in the path, return std::nullopt
.
Evaluate the derivative of the path at s
, with respect to s
.
The range of s
is the same as for operator()
.