bbi.math.spline_curve¶
- class Interpolatable(*args, **kwargs)¶
Bases:
Protocol
- class ReparamPoint(distance: float, param: float)¶
Bases:
objectA 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:
objectLegendre 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:
objectContains the mathematical operations for a spline defined via a list of points and (optionally) tangents.
- get_spline_length() float¶
- 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:
- 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.