opensurgsim
|
collects the utilities to do Cardinal Splines interpolation. More...
Go to the source code of this file.
Namespaces | |
SurgSim | |
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui needs glew but we need to call glewInit() from a osg callback, using this call we avoid getting warnings about redefinitions. | |
Functions | |
void | SurgSim::Math::CardinalSplines::extendControlPoints (const SurgSim::DataStructures::VerticesPlain &points, std::vector< SurgSim::Math::Vector3d > *result) |
Function to add two 'ghost' points to 'points' at the beginning and the end, prepare 'points' for Cardinal Splines interpolation. More... | |
void | SurgSim::Math::CardinalSplines::interpolate (size_t subdivisions, const std::vector< Math::Vector3d > &controlPoints, std::vector< Math::Vector3d > *points, double tau=0.4) |
Run Cardinal Splines interpolation on 'controlPoints'. More... | |
collects the utilities to do Cardinal Splines interpolation.
void SurgSim::Math::CardinalSplines::extendControlPoints | ( | const SurgSim::DataStructures::VerticesPlain & | points, |
std::vector< SurgSim::Math::Vector3d > * | result | ||
) |
Function to add two 'ghost' points to 'points' at the beginning and the end, prepare 'points' for Cardinal Splines interpolation.
points | List of points to be interpolated. | |
[out] | result | List of points with two ghost points added, one at the beginning and another at the end of 'points'. |
void SurgSim::Math::CardinalSplines::interpolate | ( | size_t | subdivisions, |
const std::vector< Math::Vector3d > & | controlPoints, | ||
std::vector< Math::Vector3d > * | points, | ||
double | tau = 0.4 |
||
) |
Run Cardinal Splines interpolation on 'controlPoints'.
See https://en.wikipedia.org/wiki/Centripetal_Catmull-Rom_spline https://en.wikipedia.org/wiki/Cubic_Hermite_spline https://people.cs.clemson.edu/~dhouse/courses/405/notes/splines.pdf https://www.cs.utexas.edu/~fussell/courses/cs384g/lectures/lecture16-Interpolating_curves.pdf for more details.
subdivisions | Number of interpolated points between each pair of control points. | |
controlPoints | List of points to be interpolated. | |
[out] | points | List of interpolated points, not including the control points. |
tau | Defines the tension, affects how sharply the curve bends at the control points. |