template<template< size_t, class > class Point, size_t N, typename T>
class easy3d::SplineCurveInterpolation< Point, N, T >
Cubic spline curve interpolation for arbitrary dimensions.
This is a wrapper of SplineInterpolation. It can be instantiated with any point type (1D, 2D, 3D etc.).
- Template Parameters
-
Point | A templated point class that supports basic arithmetic operations (addition and scalar multiplication). It must be parameterized as Point<N, T> , where N is the number of dimensions, and T is the data type. |
N | The number of dimensions (e.g., 2 for 2D, 3 for 3D). |
T | The scalar type (e.g., float or double ). |
Example usage:
const int resolution = 1000;
for (int i = 0; i < resolution; ++i) {
const vec3 p = interpolator.
eval_f(
float(i) /
float(resolution - 1));
std::cout << p << std::endl;
}
void set_boundary(BoundaryType left, T left_value, BoundaryType right, T right_value)
Definition spline_curve_interpolation.h:137
void set_points(const std::vector< T > ¶meters, const std::vector< Point_t > &points, bool cubic_spline=true)
Definition spline_curve_interpolation.h:148
Point< N, T > eval_f(T u) const
Definition spline_curve_interpolation.h:218
SplineCurveInterpolation()
Definition spline_curve_interpolation.h:81
Vec< 3, float > vec3
A 3D point/vector of float type.
Definition types.h:44
- Examples
- Tutorial_603_Curves/main.cpp.
template<template< size_t, class > class Point, size_t N, typename T>
void set_points |
( |
const std::vector< Point_t > & | points, |
|
|
bool | cubic_spline = true ) |
This is an overload of the set_points() function. The parameters are the accumulated curve length.
Sets the position of the point samples on the curve.
- Parameters
-
points | The data points. The parameter of each point is its accumulated curve length from the first point. |
cubic_spline | true for cubic spline interpolation; false for linear interpolation. |
- Note
- The
points
have to be ordered along the curve.