Path.Smooth Method

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

Smooths every subpath of the path along its length.

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

Syntax

C#
public void Smooth(
	float sigma
)

Parameters

sigma

Type: System.Single

The standard deviation of the Gaussian smoothing, in path units. Must be greater than 0.

Remarks

Corners become round over a distance of a few sigma. The ends of open subpaths stay in place. Curves are converted to polylines first.

Like any such smoothing, it moves a curve towards its center of curvature by about sigma * sigma / (2 * radius). So a convex outline shrinks a little.

Examples

C#
// A five-pointed star.
var path = new Path();
for (int i = 0; i < 10; i++)
{
    double angle = i * System.Math.PI / 5 - System.Math.PI / 2;
    float radius = i % 2 == 0 ? 65 : 28;
    float x = 75 + radius * (float)System.Math.Cos(angle);
    float y = 80 + radius * (float)System.Math.Sin(angle);

    if (i == 0)
        path.MoveTo(x, y);
    else
        path.LineTo(x, y);
}
path.Close();

var original = new Path(path);

// Round off the corners.
path.Smooth(6f);

The original path and the smoothed path.

The original path and the smoothed path.

Exceptions

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

See Also

Reference

Manual