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
circleGeoCircle2The circle.
distancedoubleHow far the circumference moves: outward when positive.
resultGeoCircle2The 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
circleGeoCircle2The circle.
distancedoubleHow far the circumference moves: outward when positive.
resultGeoCircle2The concentric circle, or the circle unchanged when the method returns false.
toleranceToleranceThe 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
rectangleGeoRectangle2The rectangle.
distancedoubleHow far each side moves: outward when positive.
resultGeoRectangle2The 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
rectangleGeoRectangle2The rectangle.
distancedoubleHow far each side moves: outward when positive.
resultGeoRectangle2The rectangle with the same center and angle, or the rectangle unchanged when the method returns false.
toleranceToleranceThe 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.