Method Create
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
Create(IEnumerable<DxfCurve>, IEnumerable<IEnumerable<DxfCurve>>, Tolerance)
Makes the shape of one flat face from the curves of its outer loop and of each hole. The curves of a loop may come in any order and any way round, the lines and arcs of a loop joining end to end within the point tolerance; a circle, a whole ellipse or a closed polyline is a loop of itself. The outer loop is made to run counter-clockwise about the normal of its plane (+Z for a loop that lies flat on the XY plane) and a hole clockwise.
public static DxfRegionShape Create(IEnumerable<DxfCurve> outer, IEnumerable<IEnumerable<DxfCurve>> holes, Tolerance tolerance)
Parameters
outerIEnumerable<DxfCurve>The curves of the outer loop: DxfLine, DxfArc, DxfCircle, DxfEllipse, DxfPolyline or DxfPolyline2d, the polylines with their bulges.
holesIEnumerable<IEnumerable<DxfCurve>>The curves of each hole, or null for none. A hole is not checked to lie inside the outer loop.
toleranceToleranceThe tolerance: two ends within its point tolerance meet, and a point within it of the plane lies in it.
Returns
- DxfRegionShape
The shape.
Examples
A box 40 by 30 with a hole of radius 5: DxfRegionShape.Create(new[] { box }, new[] { new[] { circle } },
Tolerance.Default) has area 1 121.46.
Exceptions
- ArgumentNullException
Thrown when the outer curves or a curve is null.
- ArgumentException
Thrown when a curve is of a type that cannot bound a region (a spline, a ray, a polyline of one vertex), a loop does not close, or the loops do not lie in one plane.