Autodesk Creative Platform Core Version 1.19.0 A broad and deep collection of 2D and 3D capabilities.

# Bezier2D Overview

Inherits Classes: Curve2D

A 2D Quadtratic or Cubic Bézier Curve determined by the number of control points. If there are 2 control points specified, then it's considered a Cubic Bézier. If a single control point is specified, then it's considered a Quadratic Bézier. Higher-degree bézier curves are not supported at this time.

Introduced in Version: 1.1.0

# Class Member Details

## • Array [ Point2D ] controlPoints

Gets or sets the control points of the Bézier curve.

### 1 Example:

```// Set the control points
var controlPoints = [point1, point2];
bezier2DObj.controlPoints = controlPoints;```

## • Number distanceTo (point, [tol])

Gets the minimum distance from the Bézier curve to the given point. The first parameter is the given point, the second tolerance is optional within which the calculation is stopped. A default tolerance is used if not specified basing on the maximum calculation precision of our system.
• point: Point2D - the given point for calculating the distance to
• tol: Number - the optional tolerance within which to stop calculation | Optional

## • Point2D end

Gets or sets the end point of the Bézier curve.

### 1 Example:

```// Set the end point
var point = new Point2D(x, y);
bezier2DObj.end = point;```

## • Bezier2D move (direction, [y]) | Chainable

Moves the curve in the direction specified.
• direction: Vector2D or Number or Array [ Number ] - A direction of movement defined by a Vector2D, an Array with 2 values (X and Y), or a number repressenting the X offset.
• y: Number - The Y offset to move in, when only the X offset is specified as the first argument. | Optional

## • Bezier2D rotate (angle, [origin], [y]) | Chainable

Rotates the curve around an optionally specified point. If no origin is specified then 0,0 is assumed. Right-handed system is used implying the positive angles result in counter-clockwise orientations.
• angle: Number - The angle of rotation
• origin: Point2D or Number or Array [ Number ] - An optional origin of rotation defined by a Point2D, an Array with 2 values (X and Y), or a number repressenting the X value. | Optional
• y: Number - The Y position to rotate around, when only the X offset is specified in the previous argument. | Optional

## • Point2D start

Gets or sets the start point of the Bézier curve.

## • Bezier2D transform (matrix) | Chainable

Transforms the Bezier by a transformation matrix.