Object TCubicBezierCurve

Unit

Declaration

type TCubicBezierCurve = object(TObject)

Description

Definition of a Bézier curve of order 3. It has two control points c1 and c2. Those are not reached by the curve in general.

Hierarchy

Overview

Fields

Public c1: TPointF;
Public c2: TPointF;
Public p1: TPointF;
Public p2: TPointF;

Methods

Public function ComputeLength(AAcceptedDeviation: single = 0.1): single;
Public function ComputePointAt(t: single): TPointF;
Public function GetBounds: TRectF;
Public function ToPoints(AAcceptedDeviation: single = 0.1; AIncludeFirstPoint: boolean = true): ArrayOfTPointF;
Public procedure CopyToPath(ADest: IBGRAPath);
Public procedure Split(out ALeft, ARight: TCubicBezierCurve);

Description

Fields

Public c1: TPointF;

First control point (not reached by the curve)

Public c2: TPointF;

Second control point (not reached by the curve)

Public p1: TPointF;

Starting point (reached)

Public p2: TPointF;

Ending point (reached)

Methods

Public function ComputeLength(AAcceptedDeviation: single = 0.1): single;

Compute an approximation of the length of the curve. AAcceptedDeviation indicates the maximum orthogonal distance that is ignored and approximated by a straight line.

Public function ComputePointAt(t: single): TPointF;

Computes the point at time t, varying from 0 to 1

Public function GetBounds: TRectF;

Computes the rectangular bounds

Public function ToPoints(AAcceptedDeviation: single = 0.1; AIncludeFirstPoint: boolean = true): ArrayOfTPointF;

Computes a polygonal approximation of the curve. AAcceptedDeviation indicates the maximum orthogonal distance that is ignored and approximated by a straight line. AIncludeFirstPoint indicates if the first point must be included in the array

Public procedure CopyToPath(ADest: IBGRAPath);

Copy the curve to the given path

Public procedure Split(out ALeft, ARight: TCubicBezierCurve);

Split the curve in two such that ALeft.p2 = ARight.p1