Hatch fill

From Evil Mad Scientist Wiki
Revision as of 18:40, 20 December 2010 by Dnewman (talk | contribs)
Jump to: navigation, search

<<< Eggmazing || Hatch fill || Post process trace bitmap >>>


extensions-hatch-fill-01.png

This extension performs the classic hatch and crosshatch fill operations on selected closed objects in an Inkscape drawing. Should nothing be selected, then every closed object in the drawing is hatch filled. The orientation and spacing of the hatch fill is user selectable as is whether or not to draw hatches or crosshatches.

The choice of value for the hatch spacing will depend upon the thickness of the pen you are plotting with. For a 0.3 mm Sharpie pen, try using a value of 8 or 7 pixels.

In the drawing,

extensions-hatch-fill-02.png

the objects can be filled differently by selecting them individually or in groups and applying the extension one at a time to each selection. To fill the three polygons on the right as a group, select the star and then while holding down the shift key, also select the two rectangles. Alternatively, you can click and drag to select them all at the same time. Once they are selected, apply the "Hatch fill" extension. Next, convert the text to a path by selecting it and applying the "Object to Path" item of the Path menu. Then, with the result selected, again apply the "Hatch fill" extension. This process can be repeated for other objects to be filled.

extensions-hatch-fill-03.png

Notes

1. The extension tries to determine an appropriate line thickness for the generated hatch lines. This is an issue as the object being filled may be subject to a scaling operation. In that case, the hatch lines need to be given thicknesses such that when the scaling is applied to them, they appear to have an appropriate thickness. If the hatch lines should appear too thick or thin, then you can change their thickness within Inkscape. Note, however, that the thickness they are drawn with on your computer screen has no bearing how they will appear when plotted with your Eggbot.

2. The extension works by computing the points of intersection between a hatch or crosshatch grid with the selected closed objects. An odd/even rule is then applied to determine which segments of the hatches or crosshatches to retain: for a given hatch line, its first intersection is considered to be the hatch line entering a closed object, the second intersection it leaving, the third it entering another object (or section of an object), and so on. While this algorithm works well in most cases, one fault with it occurs when a hatch line intersects the corner of an object. In some circumstances this can appear to the an odd intersection and lead to stray, unwanted hatch lines. The workaround is to change the spacing of the hatch lines.

3. Note that the fills generated by this extension are not smooth, continuous tool paths. Rather the fills are many independent line segments, each segment requiring pen up and pen down operations in order to be drawn. Consider first using Inkscape's live effects "Hatches (rough)" to generate your fills. The results will plot faster. Reserve use of this extension to cases in which "Hatches (rough)" will not work correctly such as hollow regins (e.g., an annulus). The tutorial Drawing a smiley face demonstrates the use of "Hatches (rough)".


<<< Eggmazing || Hatch fill || Post process trace bitmap >>>