Table of Contents

Method Subtract

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

Subtract(GeoPolygonArc2, GeoPolygonArc2)

Gets the subject with the tool taken out of it, with the arcs cut into straight pieces first.

public static GeoFace2[] Subtract(GeoPolygonArc2 subject, GeoPolygonArc2 tool)

Parameters

subject GeoPolygonArc2

The first loop, which may curve.

tool GeoPolygonArc2

The second loop, which may curve.

Returns

GeoFace2[]

The faces of the result, straight throughout.

Remarks

Each arc is cut finely enough to stray no further than the automatic share of its radius, about a fifth of a percent. Use the overload that names a chord tolerance when that is not fine enough.

Exceptions

ArgumentNullException

Thrown when either loop is null.

Subtract(GeoPolygonArc2, GeoPolygonArc2, Tolerance)

Gets the subject with the tool taken out of it, with the arcs cut into straight pieces first, within a tolerance.

public static GeoFace2[] Subtract(GeoPolygonArc2 subject, GeoPolygonArc2 tool, Tolerance tolerance)

Parameters

subject GeoPolygonArc2
tool GeoPolygonArc2
tolerance Tolerance

Returns

GeoFace2[]

Exceptions

ArgumentNullException

Thrown when either loop is null.

Subtract(GeoPolygonArc2, GeoPolygonArc2, double)

Gets the subject with the tool taken out of it, cutting the arcs no further than a chord tolerance from the curve.

public static GeoFace2[] Subtract(GeoPolygonArc2 subject, GeoPolygonArc2 tool, double chordTolerance)

Parameters

subject GeoPolygonArc2

The first loop, which may curve.

tool GeoPolygonArc2

The second loop, which may curve.

chordTolerance double

The largest gap allowed between a piece and the arc it replaces, in drawing units. Zero picks the automatic share of each radius.

Returns

GeoFace2[]

The faces of the result, straight throughout.

Exceptions

ArgumentNullException

Thrown when either loop is null.

Subtract(GeoPolygonArc2, GeoPolygonArc2, double, Tolerance)

Gets the subject with the tool taken out of it, cutting the arcs no further than a chord tolerance from the curve, within a tolerance.

public static GeoFace2[] Subtract(GeoPolygonArc2 subject, GeoPolygonArc2 tool, double chordTolerance, Tolerance tolerance)

Parameters

subject GeoPolygonArc2
tool GeoPolygonArc2
chordTolerance double
tolerance Tolerance

Returns

GeoFace2[]

Exceptions

ArgumentNullException

Thrown when either loop is null.

Subtract(GeoPolygonArc2, GeoPolygon2)

Gets the subject with the tool taken out of it where one of them is already straight, cutting the arcs of the other.

public static GeoFace2[] Subtract(GeoPolygonArc2 subject, GeoPolygon2 tool)

Parameters

subject GeoPolygonArc2
tool GeoPolygon2

Returns

GeoFace2[]

Exceptions

ArgumentNullException

Thrown when either loop is null.

Subtract(GeoPolygonArc2, GeoPolygon2, double, Tolerance)

Gets the subject with the tool taken out of it where one of them is already straight, cutting the arcs of the other, within a tolerance.

public static GeoFace2[] Subtract(GeoPolygonArc2 subject, GeoPolygon2 tool, double chordTolerance, Tolerance tolerance)

Parameters

subject GeoPolygonArc2
tool GeoPolygon2
chordTolerance double
tolerance Tolerance

Returns

GeoFace2[]

Exceptions

ArgumentNullException

Thrown when either loop is null.

Subtract(GeoPolygon2, GeoPolygonArc2)

Gets the subject with the tool taken out of it where the subject is already straight, cutting the arcs of the other.

public static GeoFace2[] Subtract(GeoPolygon2 subject, GeoPolygonArc2 tool)

Parameters

subject GeoPolygon2
tool GeoPolygonArc2

Returns

GeoFace2[]

Exceptions

ArgumentNullException

Thrown when either loop is null.

Subtract(GeoPolygon2, GeoPolygonArc2, double, Tolerance)

Gets the subject with the tool taken out of it where the subject is already straight, cutting the arcs of the other, within a tolerance.

public static GeoFace2[] Subtract(GeoPolygon2 subject, GeoPolygonArc2 tool, double chordTolerance, Tolerance tolerance)

Parameters

subject GeoPolygon2
tool GeoPolygonArc2
chordTolerance double
tolerance Tolerance

Returns

GeoFace2[]

Exceptions

ArgumentNullException

Thrown when either loop is null.

Subtract(GeoPolygonArc2, GeoPolygon2, Tolerance)

Gets the result where one shape is already straight, within a tolerance.

public static GeoFace2[] Subtract(GeoPolygonArc2 subject, GeoPolygon2 tool, Tolerance tolerance)

Parameters

subject GeoPolygonArc2
tool GeoPolygon2
tolerance Tolerance

Returns

GeoFace2[]

Exceptions

ArgumentNullException

Thrown when either loop is null.

Subtract(GeoPolygonArc2, GeoPolygon2, double)

Gets the result where one shape is already straight, cutting the arcs no further than a chord tolerance from the curve.

public static GeoFace2[] Subtract(GeoPolygonArc2 subject, GeoPolygon2 tool, double chordTolerance)

Parameters

subject GeoPolygonArc2
tool GeoPolygon2
chordTolerance double

Returns

GeoFace2[]

Exceptions

ArgumentNullException

Thrown when either loop is null.

Subtract(GeoPolygon2, GeoPolygonArc2, Tolerance)

Gets the result where the subject is already straight, within a tolerance.

public static GeoFace2[] Subtract(GeoPolygon2 subject, GeoPolygonArc2 tool, Tolerance tolerance)

Parameters

subject GeoPolygon2
tool GeoPolygonArc2
tolerance Tolerance

Returns

GeoFace2[]

Exceptions

ArgumentNullException

Thrown when either loop is null.

Subtract(GeoPolygon2, GeoPolygonArc2, double)

Gets the result where the subject is already straight, cutting the arcs no further than a chord tolerance from the curve.

public static GeoFace2[] Subtract(GeoPolygon2 subject, GeoPolygonArc2 tool, double chordTolerance)

Parameters

subject GeoPolygon2
tool GeoPolygonArc2
chordTolerance double

Returns

GeoFace2[]

Exceptions

ArgumentNullException

Thrown when either loop is null.

Subtract(GeoPolygon2, GeoPolygon2)

Gets the region of one polygon with another taken out of it, using default tolerance.

public static GeoFace2[] Subtract(GeoPolygon2 subject, GeoPolygon2 tool)

Parameters

subject GeoPolygon2
tool GeoPolygon2

Returns

GeoFace2[]

Subtract(GeoPolygon2, GeoPolygon2, Tolerance)

Gets the region of one polygon with another taken out of it, within tolerance.

public static GeoFace2[] Subtract(GeoPolygon2 subject, GeoPolygon2 tool, Tolerance tolerance)

Parameters

subject GeoPolygon2

The polygon cut from.

tool GeoPolygon2

The polygon taken out.

tolerance Tolerance

The tolerance.

Returns

GeoFace2[]

The faces left: a tool lying wholly inside the subject leaves a hole.

Exceptions

ArgumentNullException

Thrown when a polygon is null.

Subtract(GeoFace2, GeoFace2)

Gets the region of one face with another taken out of it, using default tolerance.

public static GeoFace2[] Subtract(GeoFace2 subject, GeoFace2 tool)

Parameters

subject GeoFace2
tool GeoFace2

Returns

GeoFace2[]

Subtract(GeoFace2, GeoFace2, Tolerance)

Gets the region of one face with another taken out of it, within tolerance. The tool's own holes are not taken out, since they are not part of it.

public static GeoFace2[] Subtract(GeoFace2 subject, GeoFace2 tool, Tolerance tolerance)

Parameters

subject GeoFace2
tool GeoFace2
tolerance Tolerance

Returns

GeoFace2[]

Exceptions

ArgumentNullException

Thrown when a face is null.

Subtract(GeoPolygon2, IEnumerable<GeoPolygon2>)

Gets the region of a polygon with every one of a set of polygons taken out of it, using default tolerance.

public static GeoFace2[] Subtract(GeoPolygon2 subject, IEnumerable<GeoPolygon2> tools)

Parameters

subject GeoPolygon2
tools IEnumerable<GeoPolygon2>

Returns

GeoFace2[]

Subtract(GeoPolygon2, IEnumerable<GeoPolygon2>, Tolerance)

Gets the region of a polygon with every one of a set of polygons taken out of it, within tolerance: a slab with its openings cut, in one call.

public static GeoFace2[] Subtract(GeoPolygon2 subject, IEnumerable<GeoPolygon2> tools, Tolerance tolerance)

Parameters

subject GeoPolygon2

The polygon cut from.

tools IEnumerable<GeoPolygon2>

The polygons taken out; none leaves the subject whole.

tolerance Tolerance

The tolerance.

Returns

GeoFace2[]

The faces left.

Exceptions

ArgumentNullException

Thrown when the subject, the sequence or one of its polygons is null.

Subtract(GeoFace2, IEnumerable<GeoFace2>)

Gets the region of a face with every one of a set of faces taken out of it, using default tolerance.

public static GeoFace2[] Subtract(GeoFace2 subject, IEnumerable<GeoFace2> tools)

Parameters

subject GeoFace2
tools IEnumerable<GeoFace2>

Returns

GeoFace2[]

Subtract(GeoFace2, IEnumerable<GeoFace2>, Tolerance)

Gets the region of a face with every one of a set of faces taken out of it, within tolerance.

public static GeoFace2[] Subtract(GeoFace2 subject, IEnumerable<GeoFace2> tools, Tolerance tolerance)

Parameters

subject GeoFace2

The face cut from.

tools IEnumerable<GeoFace2>

The faces taken out; none leaves the subject whole.

tolerance Tolerance

The tolerance.

Returns

GeoFace2[]

The faces left.

Exceptions

ArgumentNullException

Thrown when the subject, the sequence or one of its faces is null.