struct

Lottie::Bezier

Inherits Struct < Value < Object

Cubic bezier over Float32 — a faithful port of rlottie's VBezier including its approximations, because animated positions with "to"/"ti" tangents interpolate ALONG the bezier by arc length (Value<Position>::at → tAtLength), and tAtLength's bisection tolerance is 0.01 LENGTH UNITS with alpha-max/beta-min hypot (≈7% error) — the exact numeric behavior is part of the twin contract, not just an implementation detail.

Constructors

from_points(p1 : Vec2, p2 : Vec2, p3 : Vec2, p4 : Vec2) : Bezier
Source
new(x1 : Float32, y1 : Float32, x2 : Float32, y2 : Float32, x3 : Float32, y3 : Float32, x4 : Float32, y4 : Float32)
Source

Instance methods

length
Source
point_at(t : Float32) : Vec2

De Casteljau, ordered like VBezier::pointAt ("numerically more stable").

Source
split

VBezier::split — both halves.

Source
split_left(t : Float32) : Tuple(Bezier, Bezier)

VBezier::parameterSplitLeft — returns {left, remaining-right}.

Source
t_at_length(l : Float32, total_length : Float32) : Float32

VBezier::tAtLength — bisection over the split parameter with a 0.01 length-unit stop tolerance.

Source