Unit 'GraphMath' Package
[Overview][Types][Procedures and functions][Index] [#lazutils]

BezierArcPoints

Converts an Arc and ArcLength into a Pointer to an Array of TPoints for use with Polyline or Polygon.

Declaration

Source position: graphmath.pp line 58

procedure BezierArcPoints(

  X: LongInt;

  Y: LongInt;

  Width: LongInt;

  Height: LongInt;

  Angle1: Extended;

  Angle2: Extended;

  Rotation: Extended;

  var Points: PPoint;

  var Count: LongInt

);

Arguments

X

  

Left coordinate for the rectangle where the ellipse is positioned.

Y

  

Top coordinate for the rectangle where the ellipse is positioned.

Width

  

Width for the rectangle where the ellipse is positioned.

Height

  

Height for the rectangle where the ellipse is positioned.

Angle1

  

Eccentric angle which defines the start of the arc.

Angle2

  

Eccentric angle which defines the length of the arc.

Rotation

  

Rotation angle for the ellipse specified in 1/16ths of a degree.

Points

  

Returns a pointer to the array of points with the approximation based on one or more Beziers, or Nil when Count is less than 0.

Count

  

Returns the number of points stored in the Points argument.

Description

Use BezierArcPoints to convert an elliptical arc to a pointer to an array of TPoints for use with Polyline or Polygon.

The arc is defined by a rectangle which bounds the full ellipse. The rectangle has the specified Width and Height, its top/left corner is at the point X, Y. The start of the arc is given by the eccentric Angle1, and its length is given by eccentric Angle2. Both angles are expressed in 1/16th of a degree. A full circle, for example, equals to 5760 (16*360). A positive value in Angle2 means counter-clockwise while a negative value means clockwise direction. Zero degrees is at the 3 o'clock position.

The Rotation parameter accepts a rotation angle for a rotated ellipse - for a non-rotated ellipse this value would be 0, or 360*16.

The result is an approximation based on one or more Beziers. If the angle length is greater than 90 degrees, the procedure calls PolyBezierArcPoints, otherwise it converts the angles into a Bezier by calling Arc2Bezier which then is converted to an array of points by calling Bezier2PolyLine.

If Points is not initialized or Count is less than 0, it is set to Nil and the array starts at 0, otherwise it tries to append points to the array starting at Count. Points should ALWAYS be free'd when done by calling ReallocMem(Points, 0) or FreeMem.


Version 4.4 Generated 2025-11-08 Home