gotcha

Author Topic: Fill Segments of a Shape  (Read 4083 times)

February 15, 2017, 08:48:34 AM
Read 4083 times

robjr

  • Sr. Newbie

  • Offline
  • **

  • 3
Hello.
I have a shape that I traced and adjusted the nodes of the outline. I then inserted two horizontal lines with the Bezier tool to segment the shape into three areas.   Next I attempted to fill the top, middle and bottom with different colors.

It didn't work.

I have watched a couple of tutorials on Youtube however the fill bounded area does not work for me.

The shape is attached. 

February 15, 2017, 03:36:11 PM
Reply #1

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
This requires a bit of Boolean magic, if you want to do it exactly.

So this is how I would do it:

Fix drawing:
- First, remove your lines. They do have a path effect applied, and they're not strictly horizontal, so not very good for dividing a continent :-)
- Duplicate (select, Ctrl+D) the continent border, and ungroup it, until it's just a path.

Create silhouette object:
- Select one duplicate, do Path -> Break apart
- Delete the inner section, or do Path -> Union with the two resulting shapes from Break apart.

Now you've got two objects above one another:
- the contour (which you had at the beginning, unchanged, at the bottom)
- a silhouette of the continent

Create stripes:
- Now duplicate the silhouette. You can also give it a different color.
- Now create a rectangle (with rectangle tool). Put it over the silhouette, so that it covers one stripe. It doesn't matter that it goes beyond the continent's borders.
- Select both the silhouette and the rectangle. Do Path -> Intersection. First stripe is done.

- Repeat the three steps in the last paragraph for the other two stripes. You can let them overlap a little to avoid ugly gaps.

In a last step, lower the stripes to the bottom, so they are below the original contour.

February 15, 2017, 10:33:56 PM
Reply #2

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Just for some additional info.  The reason the Paint Bucket tool didn't work is because of the LPE that was probably automatically applied to the new paths that you drew, and probably because the last time you used that tool, you had selected a Shape option on the control bar.

And it isn't the LPE per se that caused it to fail.  But the particular LPE tapered the line so thin that the Paint Bucket tool couldn't recognize it was there, on the thin end.

If you really want to use the Paint Bucket tool (because it's faster or whatever) you can select the existing paths and remove the LPE.  (Path menu > Remove Path Effect).  Then the Paint Bucket will be able to work properly.

It can be a very helpful tool, in certain situations, but it has a few issues which just are inherent.  (If you do use it, you'll probably notice one or more.  The videos you watched might have explained them, I'm not sure.)  But really it was created to sort of wedge a raster graphics tool into a vector editor.  So the steps that Moini gave you are a way to achieve your goal in more of a true vector way.  Like we often see in Inkscape, there are a few different ways to achieve that goal.

I'm hesitating to show another way, because I'm not clear if you want to keep the horizontal lines, or if they were just going to be there, to facilitate the Paint Bucket tool.  But if you're interested to learn some different techniques, let us know  :)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

February 16, 2017, 10:06:08 AM
Reply #3

robjr

  • Sr. Newbie

  • Offline
  • **

  • 3
Thank you both for your assistance. 

I tried the first method and it worked.  I will try the second method as well. 

Robert