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.

306<br />

If we combine these two segments, we get:<br />

0 1<br />

3<br />

20 31<br />

2<br />

However, when we draw them using the right linewidth and color, you will notice that we're not<br />

yet done:<br />

The second curve is similar to the first one, but rotated over 180 degrees.<br />

addto currentpicture also currentpicture<br />

rotatedaround (.5[z2,z3],180) shifted (height/4,height/2) ;<br />

In order to get the sharp edges, we need to clip off part of the curves and at first sight, we may<br />

consider using a scaled bounding box. However, when we show the natural bounding box, you<br />

will notice that a more complicated bit of calculations is needed.<br />

The right clip path is calculated using the following expressions. Watch how we use rt and top<br />

to correct for the linewidth.<br />

numeric d, lx, ly, ux, uy ; d = line/2 ;<br />

lx = -3d - d/3 ; ly = -d ; ux = rt x5 + d/3 ; uy = top y6 ;<br />

path r ; r := (lx,ly)--(ux,ly)--(ux,uy)--(lx,uy)--cycle;<br />

A few applications Simple Logos

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

Saved successfully!

Ooh no, something went wrong!