Editing Creating filled regions

Jump to: navigation, search

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 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:
  
https://cdn.evilmadscientist.com/wiki/eggbot/fill/fill1.png
+
https://wiki.evilmadscientist.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.
Line 47: Line 47:
 
This "live path effect" hatching 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.
 
This "live path effect" hatching 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.
  
https://cdn.evilmadscientist.com/wiki/eggbot/fill/fill2.png
+
https://wiki.evilmadscientist.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.
 
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.
Line 58: Line 58:
 
If you'd like to use the "hatch" method for geometries that fail, there are a few potential workarounds-- ways that you can simplify the geometry in generally unobtrusive ways, to fill the region that you want to.
 
If you'd like to use the "hatch" method for geometries that fail, there are a few potential workarounds-- ways that you can simplify the geometry in generally unobtrusive ways, to fill the region that you want to.
  
https://cdn.evilmadscientist.com/wiki/eggbot/fill/fill_alt1.png
+
https://wiki.evilmadscientist.com/s3/eggbot/fill/fill_alt1.png
  
 
Here's our starting point: the square with the star punched out, on the left.  In the middle, with stroke visible but no fill.  And on the right with the hatch effect, failing to fill the correct region.
 
Here's our starting point: the square with the star punched out, on the left.  In the middle, with stroke visible but no fill.  And on the right with the hatch effect, failing to fill the correct region.
  
https://cdn.evilmadscientist.com/wiki/eggbot/fill/fill_alt4.png
+
https://wiki.evilmadscientist.com/s3/eggbot/fill/fill_alt4.png
  
 
An obvious method of "fixing" the geometry is to split the object into two halves.  (You can do this by drawing a rectangle that covers half of the object, and alternately subtracting it from or intersecting it with the initial shape.)  The hatch effect can be applied to the two halves separately (as shown above, with contrasting hatch directions), or you can combine the two sections into a single path object (with the Path>Combine command) and apply the hatch effect.
 
An obvious method of "fixing" the geometry is to split the object into two halves.  (You can do this by drawing a rectangle that covers half of the object, and alternately subtracting it from or intersecting it with the initial shape.)  The hatch effect can be applied to the two halves separately (as shown above, with contrasting hatch directions), or you can combine the two sections into a single path object (with the Path>Combine command) and apply the hatch effect.
  
https://cdn.evilmadscientist.com/wiki/eggbot/fill/fill_alt2.png
+
https://wiki.evilmadscientist.com/s3/eggbot/fill/fill_alt2.png
  
 
A less obvious (but usually better and easier) method is to create a tiny "cut" in the shape.  Here, we've drawn a tiny rectangle, 0.1 px tall, and positioned it to span the area from the inner cutout to the outline of the object.  We then subtract it from the shape, leaving a final geometry that is equivalent to a "C" shape, so far as the hatch extension is concerned.  You can then add the hatch effect and it will fill the correct region.  The "defect" that we've introduced is not generally visible if you use the pen to fill the whole region.
 
A less obvious (but usually better and easier) method is to create a tiny "cut" in the shape.  Here, we've drawn a tiny rectangle, 0.1 px tall, and positioned it to span the area from the inner cutout to the outline of the object.  We then subtract it from the shape, leaving a final geometry that is equivalent to a "C" shape, so far as the hatch extension is concerned.  You can then add the hatch effect and it will fill the correct region.  The "defect" that we've introduced is not generally visible if you use the pen to fill the whole region.
  
https://cdn.evilmadscientist.com/wiki/eggbot/fill/fill_alt3.png
+
https://wiki.evilmadscientist.com/s3/eggbot/fill/fill_alt3.png
  
 
A much less ideal approach that may sometimes come in handy is as follows.  First, break the path apart, so that you can grab the outer and inner shapes separately.  Apply hatch to the outer object only.  Select Path>Object to path to convert the hatch fill to a simple path, instead of the hatch-filled object.  Then, subtract the inner shape from the outer shape.  This will ''cut'' the paths, leaving sharp corners at the edges, instead of the smooth paths that we prefer.
 
A much less ideal approach that may sometimes come in handy is as follows.  First, break the path apart, so that you can grab the outer and inner shapes separately.  Apply hatch to the outer object only.  Select Path>Object to path to convert the hatch fill to a simple path, instead of the hatch-filled object.  Then, subtract the inner shape from the outer shape.  This will ''cut'' the paths, leaving sharp corners at the edges, instead of the smooth paths that we prefer.
Line 88: Line 88:
 
Here's how it looks in practice:
 
Here's how it looks in practice:
  
https://cdn.evilmadscientist.com/wiki/eggbot/fill/fill3.png
+
https://wiki.evilmadscientist.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 97:
 
== Using Hatch and Inset together ==
 
== Using Hatch and Inset together ==
  
https://cdn.evilmadscientist.com/wiki/eggbot/fill/fill4.png
+
https://wiki.evilmadscientist.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 108:
 
== Interpolation ==
 
== Interpolation ==
  
https://cdn.evilmadscientist.com/wiki/eggbot/fill/fill5.png
+
https://wiki.evilmadscientist.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.
Line 124: Line 124:
 
== Stitch Paths ==
 
== Stitch Paths ==
  
https://cdn.evilmadscientist.com/wiki/eggbot/fill/fill6.png
+
https://wiki.evilmadscientist.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 139: Line 139:
 
== Combining Interpolation and Stitch Paths ==
 
== Combining Interpolation and Stitch Paths ==
  
https://cdn.evilmadscientist.com/wiki/eggbot/fill/fill8.png
+
https://wiki.evilmadscientist.com/s3/eggbot/fill/fill8.png
  
 
Here are two (more interesting) curves, on the left.  Then the results of using interpolate, stitch, and the combined results of using both.  As you can see, this can create an interesting filled region between the paths.
 
Here are two (more interesting) curves, on the left.  Then the results of using interpolate, stitch, and the combined results of using both.  As you can see, this can create an interesting filled region between the paths.
Line 146: Line 146:
  
  
https://cdn.evilmadscientist.com/wiki/eggbot/fill/fill9.png
+
https://wiki.evilmadscientist.com/s3/eggbot/fill/fill9.png
  
 
We mentioned earlier the importance of path direction.  The figure above shows the same two curves and the same path effects, but where one of the path directions was reversed.  
 
We mentioned earlier the importance of path direction.  The figure above shows the same two curves and the same path effects, but where one of the path directions was reversed.  
  
  
https://cdn.evilmadscientist.com/wiki/eggbot/fill/fill10.png
+
https://wiki.evilmadscientist.com/s3/eggbot/fill/fill10.png
  
 
Here's an example of something a little closer to a filled object.  The two paths are concentric, and the fills span the area between them.
 
Here's an example of something a little closer to a filled object.  The two paths are concentric, and the fills span the area between them.

Please note that all contributions to Evil Mad Scientist Wiki are considered to be released under the GNU Free Documentation License 1.3 (see Evil Mad Scientist Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)

Template used on this page: