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.

36<br />

1.11 Pens<br />

min_u<br />

enddef ;<br />

The special sequence @# is used to pick up a so called delimited argument :<br />

vardef TryMe@#(expr x) =<br />

% we can now use @#, which is just text<br />

enddef ;<br />

This feature is used in the definition of z as used in z1 or z234:<br />

vardef z@# = (x@#,y@#) enddef ;<br />

Other applications can be found in the label drawing macros where the anchor point is assigned<br />

to the obscure variable @#.<br />

When drawing, three attributes can be applied to it: a dashpattern, a pen and/or a color. You may<br />

consider an arrowhead an attribute, but actually it is just an additional drawing, appended to the<br />

path.<br />

The (predefined) pencircle attribute looks like:<br />

withpen pencircle<br />

where pencircle is a special kind of path, stored in a pen variable. Like any path, you can transform<br />

it. You can scale it equally in all directions:<br />

withpen pencircle scaled 1mm<br />

You can also provide unequal scales, creating an elliptically shaped and rotated pen.<br />

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

In the following graphic, the circle in the center is drawn without any option, which means that<br />

the default pen is used, being a pencircle with a radius of half a base point. The other three circles<br />

are drawn with different pen specifications.<br />

Welcome to MetaPost Pens

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

Saved successfully!

Ooh no, something went wrong!