interpolatingBSpline

fun <T : LinearType<T>> List<T>.interpolatingBSpline(degree: Int = 3, closed: Boolean = false, alpha: Double = 0.5, distance: (T, T) -> Double): BSpline<T>(source)

The B-spline of degree that passes through these points, after Piegl and Tiller, "The NURBS Book", algorithm A9.1.

Open curves are clamped. Every point gets a parameter from the lengths of the edges between them raised to alpha: 0 gives uniform, 0.5 centripetal and 1 chord-length parameters, as for Catmull-Rom splines; centripetal parameters avoid loops and cusps best. The knots are averages of p consecutive parameters, which keeps the system of equations for the control points well conditioned.

Closed curves are periodic on uniform knots, with uniform parameters: at the knots for odd degrees and halfway between them for even ones, where the cyclic system would otherwise be singular for an even number of points.

The degree is reduced where there are too few points for it.


@JvmName(name = "interpolatingBSpline2D")
fun List<Vector2>.interpolatingBSpline(degree: Int = 3, closed: Boolean = false, alpha: Double = 0.5): BSpline<Vector2>(source)

The B-spline of degree that passes through these 2D points, see interpolatingBSpline.


@JvmName(name = "interpolatingBSpline3D")
fun List<Vector3>.interpolatingBSpline(degree: Int = 3, closed: Boolean = false, alpha: Double = 0.5): BSpline<Vector3>(source)

The B-spline of degree that passes through these 3D points, see interpolatingBSpline.