Path.FitCurves Method (Single)

Applies to: Graphics Mill 12.1, 6.x-12.x (may differ)

Replaces the polylines of the path with cubic Bezier curves.

Namespace: Aurigma.GraphicsMill.Drawing
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
public void FitCurves(
	float tolerance
)

Parameters

tolerance

Type: System.Single

The largest allowed distance from the curves to the points of the polylines, in path units. Must be greater than 0.

Remarks

A point where the direction turns by 60 degrees or more stays a sharp corner. See the FitCurves(Single, Single) overload for details.

Examples

C#
// A polyline: a straight edge and an arc made of short segments.
var path = new Path();
path.MoveTo(35, 15);
path.LineTo(35, 135);
for (int i = 1; i < 12; i++)
{
    double angle = System.Math.PI / 2 - i * System.Math.PI / 12;
    path.LineTo(35 + 85 * (float)System.Math.Cos(angle), 75 + 60 * (float)System.Math.Sin(angle));
}
path.Close();

var original = new Path(path);

// Replace the polyline with Bezier curves. The two corners of the straight edge stay sharp.
path.FitCurves(1f);

The original path and the path with fitted curves.

The original path and the path with fitted curves.

Exceptions

Exception Condition
System.ArgumentOutOfRangeException The tolerance is not greater than 0.

See Also

Reference

Manual