Object TQuadraticBezierCurve

Unit

Declaration

type TQuadraticBezierCurve = object(TObject)

Description

Definition of a B├ęzier curve of order 2. It has one control point

Hierarchy

Overview

Fields

Public c: TPointF;
Public p1: TPointF;
Public p2: TPointF;

Methods

Public function ComputeLength: 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: TQuadraticBezierCurve);

Description

Fields

Public c: TPointF;

Control point (not reached by the curve)

Public p1: TPointF;

Starting point (reached)

Public p2: TPointF;

Ending point (reached)

Methods

Public function ComputeLength: single;

Compute the exact length of the curve

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: TQuadraticBezierCurve);

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