[metapost] drawdot issue

Dan Luecking luecking at uark.edu
Mon Mar 14 19:54:48 CET 2011


At 02:59 AM 3/14/2011, you wrote:
>On 03/13/2011 02:29 PM, Stephan Hennig wrote:
>>schrieb Stephan Hennig:
>>
>>>it is also stroked with the pen given to withpen.  Which makes for a
>>>dot that is too large.
>>
>>That is incorrect.  The circle size corresponds to that of the withpen
>>statement (as can be seen from the second variant),but the stroke is
>>drawn with the currently active pen.
>
>It is the other way around, in fact, but it is not clear to see
>that without manually editing the postscript file to remove the
>'stroke'. drawdot is defined as:
>
>def drawdot expr z =
>   addto currentpicture contour makepath currentpen shifted z
>   _op_ enddef;
>
>So I think it does what is it supposed to do. Simple rule: don't
>use drawdot with an 'withpen pencircle' specifier unless you want
>to achieve a special effect.

I think there might be some confusing of the two roles of
pens in this command:

1. drawdot uses the current pen's shape (makepath currentpen)
and simply issues (the internal equivalent of) a fill
command for that path.
2. The fill command also allows a withpen qualifier, which
pen is then used to stroke that path (after filling).

This explains why these commands do what they do, and they
behave exactly as I expected.

Note: drawdot also uses the current drawoptions (via _op_)
and it might be a good idea to consider (re)setting
drawoptions before drawing any dots.


Dan


Daniel H. Luecking
Department of Mathematical Sciences
Fayetteville, Arkansas
http://www-cs-faculty.stanford.edu/~knuth/iaq.html 



More information about the metapost mailing list