Table of Contents

Method Chamfer

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

Chamfer(GeoPolygon2, double)

Chamfers every corner of a polygon that has room for it, cutting the same distance along both edges, using the default tolerance.

public static GeoPolygon2 Chamfer(GeoPolygon2 polygon, double distance)

Parameters

polygon GeoPolygon2

The polygon.

distance double

How far back along each edge the cut is measured.

Returns

GeoPolygon2

The chamfered polygon.

Chamfer(GeoPolygon2, double, Tolerance)

Chamfers every corner of a polygon that has room for it, cutting the same distance along both edges, within a tolerance.

public static GeoPolygon2 Chamfer(GeoPolygon2 polygon, double distance, Tolerance tolerance)

Parameters

polygon GeoPolygon2
distance double
tolerance Tolerance

Returns

GeoPolygon2

Chamfer(GeoPolygon2, double, double)

Chamfers every corner of a polygon that has room for it, using the default tolerance.

public static GeoPolygon2 Chamfer(GeoPolygon2 polygon, double distance1, double distance2)

Parameters

polygon GeoPolygon2

The polygon.

distance1 double

How far back along the edge running into the corner.

distance2 double

How far back along the edge running out of it.

Returns

GeoPolygon2

The chamfered polygon.

Chamfer(GeoPolygon2, double, double, Tolerance)

Chamfers every corner of a polygon that has room for it, within a tolerance.

public static GeoPolygon2 Chamfer(GeoPolygon2 polygon, double distance1, double distance2, Tolerance tolerance)

Parameters

polygon GeoPolygon2

The polygon.

distance1 double

How far back along the edge running into the corner.

distance2 double

How far back along the edge running out of it.

tolerance Tolerance

The tolerance: a corner straighter than EqualAngleRad is left alone.

Returns

GeoPolygon2

The chamfered polygon: a corner that was cut becomes two vertices, one that was left alone stays one.

Remarks

Which way round the two distances go follows the way the polygon runs, so reversing it swaps them. A corner is left alone when its cut would not fit, and what was skipped and why is written to GeometryHelperLog; see the class remarks for the rules.

Exceptions

ArgumentNullException

Thrown when the polygon is null.

ArgumentOutOfRangeException

Thrown when either distance is not a positive number.

Chamfer(GeoPolyline2, double)

Chamfers every corner of a chain that has room for it, cutting the same distance along both edges, using the default tolerance.

public static GeoPolyline2 Chamfer(GeoPolyline2 polyline, double distance)

Parameters

polyline GeoPolyline2
distance double

Returns

GeoPolyline2

Chamfer(GeoPolyline2, double, Tolerance)

Chamfers every corner of a chain that has room for it, cutting the same distance along both edges, within a tolerance.

public static GeoPolyline2 Chamfer(GeoPolyline2 polyline, double distance, Tolerance tolerance)

Parameters

polyline GeoPolyline2
distance double
tolerance Tolerance

Returns

GeoPolyline2

Chamfer(GeoPolyline2, double, double)

Chamfers every corner of a chain that has room for it, using the default tolerance.

public static GeoPolyline2 Chamfer(GeoPolyline2 polyline, double distance1, double distance2)

Parameters

polyline GeoPolyline2
distance1 double
distance2 double

Returns

GeoPolyline2

Chamfer(GeoPolyline2, double, double, Tolerance)

Chamfers every corner of a chain that has room for it, within a tolerance.

public static GeoPolyline2 Chamfer(GeoPolyline2 polyline, double distance1, double distance2, Tolerance tolerance)

Parameters

polyline GeoPolyline2

The chain.

distance1 double

How far back along the edge running into the corner.

distance2 double

How far back along the edge running out of it.

tolerance Tolerance

The tolerance: a corner straighter than EqualAngleRad is left alone.

Returns

GeoPolyline2

The chamfered chain, which keeps both of its end points exactly where they were.

Remarks

A chain has corners only where it turns, so its two end points are never touched.

Exceptions

ArgumentNullException

Thrown when the chain is null.

ArgumentOutOfRangeException

Thrown when either distance is not a positive number.

Chamfer(GeoPolylineArc2, double, double, Tolerance)

Chamfers every corner of a chain that has room for it, within a tolerance.

public static GeoPolylineArc2 Chamfer(GeoPolylineArc2 polyline, double distance1, double distance2, Tolerance tolerance)

Parameters

polyline GeoPolylineArc2

The chain.

distance1 double

How far back along the edge running into the corner.

distance2 double

How far back along the edge running out of it.

tolerance Tolerance

The tolerance.

Returns

GeoPolylineArc2

The chamfered chain, its arcs untouched.

Exceptions

ArgumentNullException

Thrown when the chain is null.

ArgumentOutOfRangeException

Thrown when either distance is not a positive number.

Chamfer(GeoPolygonArc2, double, double, Tolerance)

Chamfers every corner of a loop that has room for it, within a tolerance.

public static GeoPolygonArc2 Chamfer(GeoPolygonArc2 polygon, double distance1, double distance2, Tolerance tolerance)

Parameters

polygon GeoPolygonArc2
distance1 double
distance2 double
tolerance Tolerance

Returns

GeoPolygonArc2

The chamfered loop, its arcs untouched.

Exceptions

ArgumentNullException

Thrown when the loop is null.

ArgumentOutOfRangeException

Thrown when either distance is not a positive number.