This class represents a cubic bezier segment between two points Instance variables: via1, via2 <Point> The additional control points (OFF the curve)
bounds
Return the bounds containing the receiver
valueAt:
| p1 p2 p3 | p1 _ start interpolateTo: via1 at: t. p2 _ via1 interpolateTo: via2 at: t. p3 _ via2 interpolateTo: end at: t. p1 _ p1 interpolateTo: p2 at: t. p2 _ p2 interpolateTo: p3 at: t. ^ p1 interpolateTo: p2 at: t
via1:
via2:
asBezierShape
Demote a cubic bezier to a set of approximating quadratic beziers. Should convert to forward differencing someday
asPointArray
bezier2SegmentCount:
Compute the number of quadratic bezier segments needed to approximate this cubic with no more than a specified error
from:via:and:to:
bezier2SegmentCount
Compute the number of quadratic bezier segments needed to approximate this cubic with less than a 1-pixel error
example1
example2
draws a cubic bezier on the screen
from:to:
convertBezier3ToBezier2: