Method Subtract
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
Subtract(IEnumerable<DxfRegionShape>, IEnumerable<DxfRegionShape>, Tolerance)
Gets what the shapes cover less what the tools cover: a box 40 by 30 less a circle of radius 10 centred on its right edge has area 1 042.92 and perimeter 151.42, the circle a notch of one arc in the right side; less a circle of radius 5 inside it, a face of two loops, the circle a hole.
public static DxfRegionShape Subtract(IEnumerable<DxfRegionShape> shapes, IEnumerable<DxfRegionShape> tools, Tolerance tolerance)
Parameters
shapesIEnumerable<DxfRegionShape>The shapes to take from, in one plane; their union is what is taken from.
toolsIEnumerable<DxfRegionShape>The shapes taken away, in the same plane.
toleranceToleranceThe tolerance, as Unite(IEnumerable<DxfRegionShape>, Tolerance) says.
Returns
- DxfRegionShape
The shape; null where nothing is left.
Exceptions
- ArgumentNullException
Thrown when the shapes, the tools or one of them is null.
- ArgumentException
Thrown when there is no shape to take from, or the shapes and tools do not lie in one plane.