Squeak Class Documentation category index | class index  
 
Bezier3Segment
  category: Balloon-Geometry
  superclass: LineSegment
  subclasses:

This class represents a cubic bezier segment between two points

Instance variables:
via1, via2 <Point> The additional control points (OFF the curve)

instance methods
  accessing
  bounds
valueAt:
via1:
via2:

  converting
  asBezierShape
asPointArray
bezier2SegmentCount:

  initialization
  from:via:and:to:

  private
  bezier2SegmentCount

class methods
  examples
  example1
example2

  instance creation
  from:to:
from:via:and:to:

  utilities
  convertBezier3ToBezier2:

instance methods
  accessing top  
 

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:


  converting top  
 

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


  initialization top  
 

from:via:and:to:


  private top  
 

bezier2SegmentCount

Compute the number of quadratic bezier segments needed to approximate
this cubic with less than a 1-pixel error


class methods
  examples top  
 

example1


 

example2

draws a cubic bezier on the screen


  instance creation top  
 

from:to:


 

from:via:and:to:


  utilities top  
 

convertBezier3ToBezier2: