29.11.2012 Views

MetaFun - Pragma ADE

MetaFun - Pragma ADE

MetaFun - Pragma ADE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

26<br />

fill (0,0)--(ww,0)--(ww,hh)--(w,hh)--(w,h)--(0,h)--cycle ;<br />

fill (ww,0)--(w,0)--(w,hh)--cycle ;<br />

The points that are used to construct the paths are defined using the constants w, h, ww and hh.<br />

These are defined as follows:<br />

w := 4cm ; h := 2cm ; ww := 1cm ; hh := 1.5cm ;<br />

In this case we draw two shapes that leave part of the rectangle uncovered. If you have a background,<br />

this technique allows the background to ‘show through' the graphic.<br />

A not uncommon practice when making complicated graphics is to use unfill operations. Since<br />

METAPOST provides one, let us see what happens if we apply this command.<br />

fill (0,0)--(w,0)--(w,h)--(0,h)--cycle ;<br />

unfill (ww,0)--(w,hh)--(ww,hh)--cycle ;<br />

This does not always give the desired effect, because METAPOST's unfill is not really an unfill, but<br />

a fill with color background. Since this color is white by default, we get what we just showed.<br />

So, if we set background to black, using background := black, we get:<br />

Of course, you can set the variable background to a different color, but this does not hide the fact<br />

that METAPOST lacks a real unfill operation.<br />

Welcome to MetaPost Drawing pictures

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!