Class CadBoundaryFinder
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
Finds the areas HATCH and BOUNDARY fill, as AutoCAD finds them: round a point picked, the smallest area the lines, arcs, circles, polylines, ellipses and splines of a space close about it, with the islands inside it; or the loops of closed objects selected. A square 100 by 100 of four LINEs with a square 40 by 40 inside it, picked between the two, gives the outer square and the inner one as an island; picked inside the inner, the inner alone.
public static class CadBoundaryFinder
- Inheritance
-
CadBoundaryFinder
- Inherited Members
Remarks
The objects are laid out as a planar arrangement, as the library has no public region finder: every crossing and every end touching another object becomes a corner, pieces on top of each other are kept once, and pieces that end nowhere are dropped, as AutoCAD passes over a line that closes nothing. The faces are traced turning as far right as each corner allows; a face round the point is a candidate, the smallest wins. Each other group of connected objects lying inside it is an island, its outline the loop. Corners are one within the point tolerance. Ellipses and splines are drawn through 64 points. Objects of blocks, texts and hatches are not boundaries.
Methods
- Find(CadDocument, CadSpace, GeoPoint2, Tolerance, DisplayBox?, IReadOnlyCollection<string>, double)
Finds the area round a point: its outer loop and every island inside it, each with its depth; null where no closed area is round the point, as AutoCAD says "Valid hatch boundary not found.".
- FromObjects(CadDocument, IEnumerable<string>, Tolerance, out int)
Makes the loops of closed objects selected, as HATCH's Select objects takes them: a circle, a closed polyline, a whole ellipse or a closed spline each a loop, the depth of each the count of the others round it; the others passed over and counted.
- Kept(IEnumerable<CadBoundaryLoop>, DxfHatchStyle)
The loops a hatch of an island style keeps: all for Normal, the outer and the islands just inside it for Outer, the outer alone for Ignore.