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.

Figure 13.4 Koffka's examples of manipulating<br />

contrast by changing the spatial configuration.<br />

fill unitsquare xyscaled (-width,height) withcolor rightshade ;<br />

draw (fullcircle scaled radius) shifted (0,height/2)<br />

withpen pencircle scaled (radius/2) withcolor centershade ;<br />

\stopuseMPgraphic<br />

The graphics of the second row extend those of the first by drawing a white line through the<br />

middle. In this example setting the linecap is not really needed, because rounded top and bottoms<br />

in white are invisible and the part that extends beyond the points does not count in calculating<br />

the bounding box.<br />

\startuseMPgraphic{second}<br />

\includeMPgraphic{first}<br />

interim linecap := butt ; pickup pencircle scaled gap ;<br />

draw (0,0) -- (0,height) withcolor white ;<br />

\stopuseMPgraphic<br />

The third row graphics again extend the first graphic. First we copy the picture constructed so far.<br />

Watch the double assignment. Next we clip the pictures in half, and shift the right half down over<br />

the width of the circle.<br />

\startuseMPgraphic{third}<br />

\includeMPgraphic{first}<br />

picture p, q ; p := q := currentpicture ;<br />

clip p to unitsquare xscaled width yscaled height ;<br />

clip q to unitsquare xscaled -width yscaled height ;<br />

currentpicture := p ;<br />

Fool yourself A few applications<br />

295

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

Saved successfully!

Ooh no, something went wrong!