geomc 1.0
A c++ linear algebra template library
|
An extendable path defined by a sequence of knots and tangent velocities. More...
#include <geomc/shape/CubicPath.h>
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, 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< HermiteSpline< 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< Knot > | 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 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.
|
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.
Each 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()
.