Table of Contents

Class BezierCurve

Namespace
iText.Kernel.Geom
Assembly
itext.kernel.dll

Represents a Bezier curve.

public class BezierCurve : IShape
Inheritance
BezierCurve
Implements
Inherited Members

Constructors

BezierCurve(IList<Point>)

Constructs new bezier curve.

public BezierCurve(IList<Point> controlPoints)

Parameters

controlPoints IList<Point>

Curve's control points.

Fields

curveCollinearityEpsilon

If the distance between a point and a line is less than this constant, then we consider the point lies on the line.

public static double curveCollinearityEpsilon

Field Value

double

distanceToleranceManhattan

The Manhattan distance is used in the case when either the line ((x1, y1), (x4, y4)) passes through both (x2, y2) and (x3, y3) or (x1, y1) = (x4, y4).

public static double distanceToleranceManhattan

Field Value

double

Remarks

The Manhattan distance is used in the case when either the line ((x1, y1), (x4, y4)) passes through both (x2, y2) and (x3, y3) or (x1, y1) = (x4, y4). The essential observation is that when the curve is a uniform speed straight line from end to end, the control points are evenly spaced from beginning to end. Our measure of how far we deviate from that ideal uses distance of the middle controls: point 2 should be halfway between points 1 and 3; point 3 should be halfway between points 2 and 4.

distanceToleranceSquare

In the case when neither the line ((x1, y1), (x4, y4)) passes through both (x2, y2) and (x3, y3) nor (x1, y1) = (x4, y4) we use the square of the sum of the distances mentioned below in compare to this field as the criterion of good approximation.

public static double distanceToleranceSquare

Field Value

double

Remarks

In the case when neither the line ((x1, y1), (x4, y4)) passes through both (x2, y2) and (x3, y3) nor (x1, y1) = (x4, y4) we use the square of the sum of the distances mentioned below in compare to this field as the criterion of good approximation.

  1. The distance between the line and (x2, y2)
  2. The distance between the line and (x3, y3)

Methods

GetBasePoints()

public virtual IList<Point> GetBasePoints()

Returns

IList<Point>

GetPiecewiseLinearApproximation()

You can adjust precision of the approximation by varying the following parameters: curveCollinearityEpsilon , distanceToleranceSquare , distanceToleranceManhattan.

public virtual IList<Point> GetPiecewiseLinearApproximation()

Returns

IList<Point>

containing points of piecewise linear approximation for this bezier curve.