About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Account
Latest news 2024-10-15: New blog post: Tales for Our Times Book Launch.
Previous: Lettuce on Toast  Up: Step-by-Step Examples  Next: An Artificial Neuron  


Cheese and Lettuce on Toast

This example illustrates how to merge paths. It extends the previous example Lettuce on Toast. The aim is to create the image shown in Figure 11.15.

  1. Load the image you created in the lettuce on toast example, using the File->Open menu item, or clicking on the load image button.

  2. To create the slice of cheese, select the rectangle tool, and set the fill colour to yellow. Make a rectangle, as illustrated in Figure 11.12.

    cheese1
    Figure 11.12: Cheese and Lettuce on Toast Example--A Filled Rectangle
    This slice of cheese is going to have holes in it, and we need to be able to see the lettuce and toast through the holes. Since this is not a uniform colour, we can't just, say, put green ellipses on top of the cheese as this won't look right. Instead, we are going to create some ellipses, and then merge them into the yellow rectangle. To do this, first select the ellipse tool, and create some ellipses on top of the yellow rectangle (Figure 11.13).

    cheese2
    Figure 11.13: Cheese and Lettuce on Toast Example--Adding Ellipses

  3. Now select all the ellipses you created in the previous step and the yellow rectangle (Figure 11.14(a)) and merge them using the Transform->Merge Paths menu item (Figure 11.14(b)). If the ellipses remain filled, check to make sure you have the winding rule set to even-odd. (Alternatively, you can use the Transform->Subtract Paths menu item, in which case you don't need to worry about the winding rule.)

    cheese3a
    (a)
    cheese3b
    (b)
    Figure 11.14: Cheese and Lettuce on Toast Example--merging paths: (a) paths selected; (b) paths merged into a single path.

cheesefinal
Figure 11.15: Cheese and Lettuce on Toast Example--Completed Image



Previous: Lettuce on Toast  Up: Step-by-Step Examples  Next: An Artificial Neuron  

© 2014 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs