bbi.math.spline_curve

class Interpolatable(*args, **kwargs)

Bases: Protocol

class ReparamPoint(distance: float, param: float)

Bases: object

A point along the spline with a known param and distance from the first point. Used to find the point on the spline given a distance.

distance: float
param: float
class LegendreGaussCoefficient(abscissa: float, weight: float)

Bases: object

Legendre Gauss quadrature coefficients. Used to compute the length of the spline.

abscissa: float
weight: float
static five_point_coefficients() list[LegendreGaussCoefficient]
class SplineCurve(points: list[Vector3], tangents: list[Vector3] | None = None)

Bases: object

Contains the mathematical operations for a spline defined via a list of points and (optionally) tangents.

get_spline_length() float
get_position(t: float) Vector3
get_direction_along_spline(t: float) Vector3

Get the direction (roll, pitch, yaw) along the spline at a given distance proportion.

The rotation is computed from the normalized derivative (tangent) of the spline at the given point, which represents the direction of travel along the curve.

Parameters:

t (float) – Proportion of the spline in distance, in the range [0, 1].

Returns:

Rotation vector (roll, pitch, yaw) at the given point.

Return type:

Vector3

get_value_along_spline(values: list[T], t: float) T

Get an interpolated value at a given distance proportion.

Given a list of values corresponding to each point on the spline, this function finds a pair of values that t lies between, then linearly interpolates between those values depending on the distance of the spline at t.