Packagecom.degrafa.geometry.utilities
Classpublic class BezierUtils



Public Properties
 PropertyDefined by
  minDistance : Number
[read-only] minDistance():Number [get] access the minimum distance
BezierUtils
Public Methods
 MethodDefined by
  
BezierUtils
  
closestPointToBezier(_curve:Geometry, _p:Point):Number
closestPointToBezier Find the closest point on a quadratic or cubic Bezier curve to an arbitrary point
BezierUtils
  
subdivide(_c:Array, _t:Number, _left:Array, _right:Array):void
subdivide( _c:Array, _t:Number, _left:Array, _right:Array ) - deCasteljau subdivision of an arbitrary-order Bezier curve
BezierUtils
  
tAtX(x0:Number, y0:Number, cx:Number, cy:Number, x1:Number, y1:Number, x:Number):Object
[static] Given control and anchor points for a quad Bezier and an x-coordinate between the initial and terminal control points, return the t-parameter(s) at the input x-coordinate or -1 if no such parameter exists.
BezierUtils
Property detail
minDistanceproperty
minDistance:Number  [read-only]

minDistance():Number [get] access the minimum distance

Implementation
    public function get minDistance():Number
Constructor detail
BezierUtils()constructor
public function BezierUtils()
Method detail
closestPointToBezier()method
public function closestPointToBezier(_curve:Geometry, _p:Point):Number

closestPointToBezier Find the closest point on a quadratic or cubic Bezier curve to an arbitrary point

Parameters
_curve:Geometry — reference that must be a quadratic or cubic Bezier3
 
_p:Point — reference to Point to which the closest point on the Bezier curve is desired

Returns
Number — Number t-parameter of the closest point on the parametric curve. Returns 0 if inputs are null or not a valid reference to a Bezier curve. This code is derived from the Graphic Gem, "Solving the Nearest-Point-On-Curve Problem", by P.J. Schneider, published in 'Graphic Gems', A.S. Glassner, ed., Academic Press, Boston, 1990, pp. 607-611.
subdivide()method 
public function subdivide(_c:Array, _t:Number, _left:Array, _right:Array):void

subdivide( _c:Array, _t:Number, _left:Array, _right:Array ) - deCasteljau subdivision of an arbitrary-order Bezier curve

Parameters
_c:Array — array of control points for the Bezier curve
 
_t:Number — t-parameter at which the curve is subdivided (must be in (0,1) = no check at this point
 
_left:Array — reference to an array in which the control points, Array of Point references, of the left control cage after subdivision are stored
 
_right:Array — reference to an array in which the control points, Array of Point references, of the right control cage after subdivision are stored
tAtX()method 
public static function tAtX(x0:Number, y0:Number, cx:Number, cy:Number, x1:Number, y1:Number, x:Number):Object

Given control and anchor points for a quad Bezier and an x-coordinate between the initial and terminal control points, return the t-parameter(s) at the input x-coordinate or -1 if no such parameter exists.

Parameters
x0:Number
 
y0:Number
 
cx:Number
 
cy:Number
 
x1:Number
 
y1:Number
 
x:Number

Returns
Object