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
polygonGeoPolygon2The polygon.
distancedoubleHow 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
polygonGeoPolygon2distancedoubletoleranceTolerance
Returns
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
polygonGeoPolygon2The polygon.
distance1doubleHow far back along the edge running into the corner.
distance2doubleHow 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
polygonGeoPolygon2The polygon.
distance1doubleHow far back along the edge running into the corner.
distance2doubleHow far back along the edge running out of it.
toleranceToleranceThe 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
polylineGeoPolyline2distancedouble
Returns
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
polylineGeoPolyline2distancedoubletoleranceTolerance
Returns
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
polylineGeoPolyline2distance1doubledistance2double
Returns
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
polylineGeoPolyline2The chain.
distance1doubleHow far back along the edge running into the corner.
distance2doubleHow far back along the edge running out of it.
toleranceToleranceThe 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
polylineGeoPolylineArc2The chain.
distance1doubleHow far back along the edge running into the corner.
distance2doubleHow far back along the edge running out of it.
toleranceToleranceThe 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
polygonGeoPolygonArc2distance1doubledistance2doubletoleranceTolerance
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.