Expand description
Basis spline curves.
BSpline support all flavours or B-Splines, such as uniform (equidistant) and non-uniform B-Splines
as well as the most generalized version: NURBS (Non-Uniform Rational B-SPlines).
The easist way to create a bspline is by using the builder pattern of BSplineBuilder.
let bspline = BSpline::builder()
.clamped()
.elements([0.0,5.0,3.0,10.0,7.0])
.equidistant::<f64>()
.degree(3)
.normalized()
.constant::<4>()
.build()?;
let results = [0.0,2.346,3.648,4.302,4.704,5.25,6.2,7.27,8.04,8.09,7.0];
for (value,result) in bspline.take(results.len()).zip(results.iter().copied()){
assert_f64_near!(value, result);
}BSplines can be seen as many bezier curves put together. They have most properties of bezier curves but changing an element in a bspline only affects a local area of the curve, not the whole curve, like it is in bezier curves. BSplines allow you to define curves with a lot of control points without increasing the degree of the curve.
Structs§
- BSpline
- BSpline curve.
- BSpline
Builder - Builder for bspline interpolation.
- BSpline
Director - Builder for bspline interpolation.
- Border
Buffer - Chain Adaptor which repeats its first and last element
nmore times. - Border
Deletion - Chain Adaptor which deletes the first and last element.
- Incongruous
Elements Degree - Error returned when the number of elements and the degree are ill-matched.
- Incongruous
Elements Knots - Error returned when the number of elements and knots are ill-matched.
- Invalid
Degree - Error returned if the number of elements and the number of knots are not matching.
- NotSorted
- Error returned if the given knots are not sorted.
- TooFew
Elements - Error returned if the elements are to few for the specific interpolation.
- TooSmall
Workspace - Error returned when the workspace is too small.
Enums§
- BSpline
Error - Errors which could occur when using or creating a linear interpolation.