Table of Contents

Method TryOffset

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

TryOffset(GeoCircle2, double, out GeoCircle2)

Grows a circle by a distance, or shrinks it when the distance is negative, using the default tolerance.

public static bool TryOffset(GeoCircle2 circle, double distance, out GeoCircle2 result)

Parameters

circle GeoCircle2

The circle.

distance double

How far the circumference moves: outward when positive.

result GeoCircle2

The concentric circle, or the circle unchanged when the method returns false.

Returns

bool

true if a circle is left; false if it shrinks to nothing.

TryOffset(GeoCircle2, double, out GeoCircle2, Tolerance)

Grows a circle by a distance, or shrinks it when the distance is negative, within tolerance.

public static bool TryOffset(GeoCircle2 circle, double distance, out GeoCircle2 result, Tolerance tolerance)

Parameters

circle GeoCircle2

The circle.

distance double

How far the circumference moves: outward when positive.

result GeoCircle2

The concentric circle, or the circle unchanged when the method returns false.

tolerance Tolerance

The tolerance deciding when a radius is too small to keep.

Returns

bool

true if a circle is left; false if it shrinks to nothing.

Exceptions

ArgumentOutOfRangeException

Thrown when the distance is not a finite number.

TryOffset(GeoRectangle2, double, out GeoRectangle2)

Grows a rectangle by a distance, or shrinks it when the distance is negative, keeping its corners square, using the default tolerance.

public static bool TryOffset(GeoRectangle2 rectangle, double distance, out GeoRectangle2 result)

Parameters

rectangle GeoRectangle2

The rectangle.

distance double

How far each side moves: outward when positive.

result GeoRectangle2

The rectangle with the same center and angle, or the rectangle unchanged when the method returns false.

Returns

bool

true if a rectangle is left; false if it shrinks to nothing.

TryOffset(GeoRectangle2, double, out GeoRectangle2, Tolerance)

Grows a rectangle by a distance, or shrinks it when the distance is negative, keeping its corners square, within tolerance. This is the sharp-cornered offset; round the corners with Offset(GeoPolygon2, double, OffsetJoin, Tolerance) on ToPolygon().

public static bool TryOffset(GeoRectangle2 rectangle, double distance, out GeoRectangle2 result, Tolerance tolerance)

Parameters

rectangle GeoRectangle2

The rectangle.

distance double

How far each side moves: outward when positive.

result GeoRectangle2

The rectangle with the same center and angle, or the rectangle unchanged when the method returns false.

tolerance Tolerance

The tolerance deciding when a side is too short to keep.

Returns

bool

true if a rectangle is left; false if it shrinks to nothing.

Exceptions

ArgumentOutOfRangeException

Thrown when the distance is not a finite number.