Editing Creating filled regions
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | '''NOTE:''' this page is only partially uploaded. Additional content will be added here October 5-7. | |
Line 8: | Line 8: | ||
So, what happens if you ask your Eggbot to draw a filled regions? The Eggbot will simply draw the paths that make up the object, like it always does. The "fill" attributes will be ignored. The net result might be something like this: | So, what happens if you ask your Eggbot to draw a filled regions? The Eggbot will simply draw the paths that make up the object, like it always does. The "fill" attributes will be ignored. The net result might be something like this: | ||
− | + | http://wiki.evilmadscience.com/s3/eggbot/fill/fill1.png | |
Starting with the filled shapes on the left, the Eggbot will actually just plot their outlines, shown on the right. | Starting with the filled shapes on the left, the Eggbot will actually just plot their outlines, shown on the right. | ||
− | So, what can you do it you actually want to ''fill'' a region with the pen? Clearly, you need to construct some path that the pen can follow through the entire filled region. There are many possible approaches to this problem-- brute force rastering, adaptive filling algorithms, cross-hatching, and on and on | + | So, what can you do it you actually want to ''fill'' a region with the pen? Clearly, you need to construct some path that the pen can follow through the entire filled region. There are many possible approaches to this problem-- brute force rastering, adaptive filling algorithms, cross-hatching, and on and on. In what follows, we'll show a few different ways to create such pen paths, what you might call "toolpaths" in machining terms. There are a number of different approaches that work best in different circumstances. |
− | |||
− | |||
− | |||
One final word before we get started: Plots where you fill solid regions can potentially take a long time with all that back-and-forth business. Where possible, design around having to fill regions. | One final word before we get started: Plots where you fill solid regions can potentially take a long time with all that back-and-forth business. Where possible, design around having to fill regions. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
= Hatch and Inset Methods = | = Hatch and Inset Methods = | ||
Line 31: | Line 21: | ||
These two fill methods can be used to fill closed shapes with pen paths. | These two fill methods can be used to fill closed shapes with pen paths. | ||
− | == Hatch | + | == Hatch Method == |
This method is described in detail in our [[Drawing_a_smiley_face|smiley face tutorial]]. | This method is described in detail in our [[Drawing_a_smiley_face|smiley face tutorial]]. | ||
Line 39: | Line 29: | ||
* Open the live path effect editor: Path>Path Effect Editor | * Open the live path effect editor: Path>Path Effect Editor | ||
* Apply new effect: Hatches (rough) and click "+Add" | * Apply new effect: Hatches (rough) and click "+Add" | ||
− | * Use the extension to set defaults: Extensions>Eggbot>Preset hatch for fills | + | * Use the extension to set defaults: Extensions>Eggbot>Preset hatch for fills |
* Use the "edit paths by node" tool to set the angle, spacing, and bending of the lines. | * Use the "edit paths by node" tool to set the angle, spacing, and bending of the lines. | ||
− | You may also need to use the Fill & Stroke panel to set the stroke to be a visible pen and the fill to "none." | + | You may also need to use the Fill & Stroke panel to set the stroke to be a visible pen and the fill to "none." |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | This "Hatch" method can handle paths that consist of multiple disjoint regions, for example, a set of stars or non-intersecting circles, but it ''does not'' work with "hollow" regions, for example a ring or washer (2D torus) shape. | |
+ | http://wiki.evilmadscience.com/s3/eggbot/fill/fill2.png | ||
− | + | Here are some concrete examples. The four original (filled) shapes are on the left: A star, a square, a square with a star punched out-- essentially a hollow, ''ring-shaped'' fill region -- and a smaller square with a star punched out (a set of multiple disjoint regions). In the middle set of four shapes, we've applied the hatch procedure as outlined above. As you can see, it works well on three of the four shapes; but again it does not work on "hollow" areas. (It treats the inner cutout path as a separate path to be filled with hatching.) The set of four shapes on the right have the same hatch applied, but we've also pasted a copy of the original outline shapes on top, to give more definition than you get from the fill alone. | |
− | + | While the hatch method is slightly complicated and does not work in every situation, it is without doubt ''the best method in any situation where it can be used''. It produces excellent results that plot smoothly and efficiently, with preset deceleration at each switchback and an absolute bare minimum of pen lifts. Beyond all that, it's also a "live path effect," which means that it will automatically reflow as you change the shape of the filled region, and you can even remove the hatch at any time to restore your original object. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Inset Method == | == Inset Method == | ||
− | So what can you do when you need to draw "hollow" filled shapes that the hatch method fails? | + | So what can you do when you need to draw "hollow" filled shapes that the hatch method fails for? For example, what if you're drawing a US flag on an egg, and with the blue pen, you want to draw the filled blue area around those blue stars. For cases like these, we use the "inset" method, which has its own advantages and disadvantages. |
* Select one or more path objects. | * Select one or more path objects. | ||
Line 88: | Line 58: | ||
Here's how it looks in practice: | Here's how it looks in practice: | ||
− | + | http://wiki.evilmadscience.com/s3/eggbot/fill/fill3.png | |
Advantages: Can be applied to more than one object at once. Handles complex geometry. | Advantages: Can be applied to more than one object at once. Handles complex geometry. | ||
Line 97: | Line 67: | ||
== Using Hatch and Inset together == | == Using Hatch and Inset together == | ||
− | + | http://wiki.evilmadscience.com/s3/eggbot/fill/fill4.png | |
For non-hollow shapes where the hatch method works, it's often helpful to perform a single Inset operation before applying the hatch. The result is shown above: The hatch marks do not go all the way to the edge of the filled region. Using an initial inset like this is often a good way to compensate for pen width when filling a region. | For non-hollow shapes where the hatch method works, it's often helpful to perform a single Inset operation before applying the hatch. The result is shown above: The hatch marks do not go all the way to the edge of the filled region. Using an initial inset like this is often a good way to compensate for pen width when filling a region. | ||
+ | |||
Line 108: | Line 79: | ||
== Interpolation == | == Interpolation == | ||
− | + | http://wiki.evilmadscience.com/s3/eggbot/fill/fill5.png | |
Suppose that we start with the two curves shown on the left. The interpolation method produces a series of curves between the two shapes, that can be used to fill in the region. | Suppose that we start with the two curves shown on the left. The interpolation method produces a series of curves between the two shapes, that can be used to fill in the region. | ||
* Select the two curves | * Select the two curves | ||
− | * Select | + | * Select Extensions> Generate from path>Interpolate... |
− | + | * Select the number of intermediate curves and click 'Apply.' | |
− | + | ||
− | * | ||
− | |||
While you can't always see it, paths in Inkscape have distinct orientation, with "start" and "end" points. The smooth result that you see above will only work if both paths are going the same direction-- for example, if you drew both of them with downward pen strokes. If necessary, you can use the Path>Reverse command to reverse the direction of one of the paths. | While you can't always see it, paths in Inkscape have distinct orientation, with "start" and "end" points. The smooth result that you see above will only work if both paths are going the same direction-- for example, if you drew both of them with downward pen strokes. If necessary, you can use the Path>Reverse command to reverse the direction of one of the paths. | ||
− | You can also read more about the Interpolate function in [ | + | You can also read more about the Interpolate function in [http://inkscape.org/doc/interpolate/tutorial-interpolate.en.html this tutorial]. |
+ | |||
== Stitch Paths == | == Stitch Paths == | ||
− | + | http://wiki.evilmadscience.com/s3/eggbot/fill/fill6.png | |
Here, we've started with the same two curves that we used previously. The Stitch Paths method produces not a series of lines parallel to our initial paths, but a set of lines perpendicular to them. | Here, we've started with the same two curves that we used previously. The Stitch Paths method produces not a series of lines parallel to our initial paths, but a set of lines perpendicular to them. | ||
Line 132: | Line 102: | ||
* Open the live path effect editor: Path>Path Effect Editor | * Open the live path effect editor: Path>Path Effect Editor | ||
* Apply new effect: Stitch sub-paths | * Apply new effect: Stitch sub-paths | ||
− | * In the path effect editor pane, select the number of curves | + | * In the path effect editor pane, select the number of curves shown. |
You can also read more about the Stitch sub-paths function in [http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Paths-LivePathEffects-StitchSubPaths.html this tutorial]. | You can also read more about the Stitch sub-paths function in [http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Paths-LivePathEffects-StitchSubPaths.html this tutorial]. | ||
Line 138: | Line 108: | ||
== Combining Interpolation and Stitch Paths == | == Combining Interpolation and Stitch Paths == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |