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.

draw_basics ;<br />

draw_circles ;<br />

draw_intersection ;<br />

draw_bisector ;<br />

draw_midpoint ;<br />

bb := boundingbox currentpicture ;<br />

currentpicture := nullpicture ;<br />

enddef ;<br />

def stop_everything =<br />

setbounds currentpicture to bb ;<br />

enddef ;<br />

\stopbuffer<br />

In figure 13.5 we demonstrate the effect of this redefinition. For this purpose we scale down the<br />

graphic to a comfortable 40%, of course by using an additional buffer. We also visualize the bounding<br />

box.<br />

\startbuffer[h]<br />

def stop_everything =<br />

setbounds currentpicture to bb ;<br />

draw bb withpen pencircle scaled .5pt withcolor .625yellow ;<br />

currentpicture := currentpicture scaled .4 ;<br />

enddef ;<br />

\stopbuffer<br />

The graphic itself is defined as follows. Watch how we use the default buffer to keep the definitions<br />

readable.<br />

\startbuffer<br />

\startcombination[5*1]<br />

{\processMPbuffer[a,b,c,h,d,e,f,g,1]} {step 1}<br />

{\processMPbuffer[a,b,c,h,d,e,f,g,2]} {step 2}<br />

{\processMPbuffer[a,b,c,h,d,e,f,g,3]} {step 3}<br />

{\processMPbuffer[a,b,c,h,d,e,f,g,4]} {step 4}<br />

{\processMPbuffer[a,b,c,h,d,e,f,g,5]} {step 5}<br />

\stopcombination<br />

\stopbuffer<br />

\placefigure<br />

[here][fig:1 till 5]<br />

{The five graphics, each with the same bounding box.}<br />

{\getbuffer}<br />

As the original purpose of these graphics was not to show them side by side, but to present them<br />

as field stack in a document to be viewed at the computer screen. For this purpose we have to<br />

define the graphics as symbols.<br />

\definesymbol[step 1][{\processMPbuffer[a,b,c,d,e,f,g,1]}]<br />

\definesymbol[step 2][{\processMPbuffer[a,b,c,d,e,f,g,2]}]<br />

Growing graphics A few applications<br />

301

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

Saved successfully!

Ooh no, something went wrong!