Method Explode
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
Explode()
Gets the lines a HATCH filled with a pattern breaks into, as AutoCAD's EXPLODE breaks one: the dashes of each line of
its pattern (GetPatternDefinitionAt(int)), as the HATCH holds them, cut by its loops, each a LINE with the
HATCH's look, a dot of the pattern a LINE of no length, as ezdxf's hatch_entity draws them. The lines of a pattern
line run from its base point and every offset from it; each is cut where it crosses the loops, its stretches inside
them kept by the even-odd rule, and its dashes laid from the line's own base point. The loops it is cut by are those
the HatchStyle fills: every loop in the normal style; in the outer style those flagged external or
outermost (1 or 16 of their type), and ignoring islands those flagged external, as AutoCAD 2021 and ezdxf take them,
so that a square in the outer style round a circle of radius 7 and one of radius 3 in it, both flagged outermost, is
hatched inside the smaller circle too, as AutoCAD's Explode hatches it; where no loop is so flagged, by how deep
each lies among the others as Area counts it, the outermost and those just inside them in the outer
style, the outermost alone ignoring islands. Lines, arcs, ellipses and splines of a loop are cut where they are
crossed, an arc and an ellipse exactly, a spline to the bit within each sixteenth of a span of its knots; a dot that
falls on a loop where its line crosses it is kept, but a line of the pattern that runs along a straight edge of a loop
gives nothing along it, as AutoCAD gives nothing there: a square 30 by 20 filled with DOTS from its corner, the dots
1.5875 apart, gives 228 dots, none on its bottom edge. A square 30 by 20
filled with ANSI31, the one line at 45 degrees 3.175 apart, gives 11 LINEs; the same round a circle of radius 5 about
its middle in the normal style gives 14, the three lines that cross the circle broken in two. The parts run pattern
line by pattern line, then by the index of the line from the base point, the least first, then along the line, each
from its start along the angle of its pattern line.
public override IReadOnlyList<DxfEntity> Explode()
Returns
- IReadOnlyList<DxfEntity>
The entities, in no file, to be added to a drawing by AppendEntity(DxfEntity).
Exceptions
- NotSupportedException
Thrown for a solid fill and a gradient, which the library does not break; and for a pattern the HATCH holds no lines of, AutoCAD's own pattern file being AutoCAD's: one the drawing's PatternSearchPath found in none of its files when the pattern was given.
- InvalidOperationException
Thrown, before anything is made, when a loop has an edge that is no shape; when the pattern would give more than the 2 000 000 entities of MaxPlacedEntities, or its lines would cross the loops more than 32 000 000 times, which holds what the crossings take to half a gigabyte, the parts they give aside; or when the loops lie more than 2^52 of the pattern's spacings, or of the lengths of its dashes, from its base point, where one line or length is not told from the next.