29.11.2012 Views

MetaFun - Pragma ADE

MetaFun - Pragma ADE

MetaFun - Pragma ADE

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

If you forget about the colors, the METAPOST code to achieve this is as follows.<br />

path p ; p := fullcircle scaled 1cm ;<br />

draw p ;<br />

draw p scaled 2 withpen pencircle ;<br />

draw p scaled 3 withpen pencircle scaled 1mm ;<br />

draw p scaled 4 withpen pencircle xscaled 2mm yscaled 4mm rotated 30 ;<br />

If this were the only way of specifying a pen, we would be faced with a considerable amount of<br />

typing, particularly in situations where we use pens similar to the fourth specification above. For<br />

that reason, METAPOST supports the concept of a current pen. The best way to set this pen is to use<br />

the pickup macro.<br />

pickup pencircle xscaled 2mm yscaled 4mm rotated 30 ;<br />

This macro also stores some characteristics of the pen in variables, so that they can be used in (the<br />

more complicated) calculations that are involved in situations like drawing font--like graphics.<br />

If we substitute pencircle by pensquare, we get a different kind of shapes. In the non rotated<br />

pens, the top, bottom, left and right parts of the curve are thinner.<br />

You should look at pens in the way an artist does. He follows a shape and in doing so he or she<br />

twists the pen (and thereby the nib) and puts more or less pressure on it.<br />

The chance that you have an appropriate pen laying at your desk is not so large, but you can<br />

simulate the following METAPOST's pen by taking two pencils and holding them together in one<br />

hand. If you position them in a 45 degrees angle, and draw a circle, you will get something like:<br />

If you take a calligraphic pen with a thin edge of .5cm, you will get:<br />

Pens Welcome to MetaPost<br />

37

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

Saved successfully!

Ooh no, something went wrong!