kochanekBartels

fun List<Vector2>.kochanekBartels(closed: Boolean, tension: Double = 0.0, continuity: Double = 0.0, bias: Double = 0.0, polarity: YPolarity = YPolarity.CW_NEGATIVE_Y): ShapeContour(source)

Converts this polyline into a Kochanek-Bartels spline, after Kochanek and Bartels, "Interpolating splines with local tension, continuity, and bias control" (SIGGRAPH 1984): a cubic Hermite spline through all points whose tangents are shaped by a tension, continuity and bias, see TCB. With all three 0 it is the uniform Catmull-Rom spline.

At point pᵢ, with Δ₋ = pᵢ - pᵢ₋₁ and Δ₊ = pᵢ₊₁ - pᵢ, the curve arrives with tangent (1-t)(1-c)(1+b)/2·Δ₋ + (1-t)(1+c)(1-b)/2·Δ₊ and leaves with tangent (1-t)(1+c)(1+b)/2·Δ₋ + (1-t)(1-c)(1-b)/2·Δ₊. The two are equal, so the curve is C1, only for continuity 0. Every edge is parametrized over 0, 1, as in the paper without its adjustment for uneven keyframe spacing. The ends of an open polyline take the missing edge as the mirror image of the edge next to it, so with all parameters 0 the curve leaves the first point along the first edge.

Parameters

closed

whether the polyline is closed, the last point should then not repeat the first

tension

the tension at every point

continuity

the continuity at every point

bias

the bias at every point

polarity

the polarity of the resulting contour


fun List<Vector2>.kochanekBartels(closed: Boolean, parameters: List<TCB>, polarity: YPolarity = YPolarity.CW_NEGATIVE_Y): ShapeContour(source)

Converts this polyline into a Kochanek-Bartels spline with a tension, continuity and bias per point, see List.kochanekBartels.

Parameters

parameters

the tension, continuity and bias at every point


fun List<Vector3>.kochanekBartels(closed: Boolean, tension: Double = 0.0, continuity: Double = 0.0, bias: Double = 0.0): Path3D(source)

Converts this 3D polyline into a Kochanek-Bartels spline, for instance for a camera path, see List.kochanekBartels.


fun List<Vector3>.kochanekBartels(closed: Boolean, parameters: List<TCB>): Path3D(source)

Converts this 3D polyline into a Kochanek-Bartels spline with a tension, continuity and bias per point.