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.

Since we don't consider this unfill a suitable operator, you may wonder how we achieved the<br />

above result.<br />

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

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

This feature depends on the POSTSCRIPT way of filling closed paths, which comes down to filling<br />

either the left or the right hand side of a curve. The following alternative works too.<br />

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

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

The next alternative will fail. This has to do with the change in direction at point (0,0) halfway<br />

through the path. Sometimes changing direction can give curious but desirable effects, but here it<br />

brings no good.<br />

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

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

This path fails because of the way POSTSCRIPT implements its fill operator. More details on how<br />

POSTSCRIPT defines fills can be found in the reference manuals.<br />

Some of the operations we have seen are hard coded into METAPOST and are called primitives.<br />

Others are defined as macros, that is, a sequence of METAPOST commands. Since they are used<br />

Drawing pictures Welcome to MetaPost<br />

27

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

Saved successfully!

Ooh no, something went wrong!