# [NTG-context] drawarrow and transparency

Rogers, Michael K mroge02 at emory.edu
Thu May 3 14:47:04 CEST 2012

On May 3, 2012, at 6:32 AM, Alan BRASLAU wrote:

I believe that this is somewhat a bug with transparency under MetaFun.
For I tried the following:

\startMPcode
picture pic ; pic := image(drawarrow origin--(1cm,0)) ;

draw pic withtransparency(1,.5) ;
draw pic rotated 90 withtransparency(1,.5) ;
\stopMPcode

Here, the arrowhead is totally opaque and only the "stem"
has transparency. Something is fishy.

Alan

I noticed the same thing.  I think original problem is with how an arrow is converted to PDF/Postscript drawing commands and how the color is computed when commands are combined.  The only solution I can imagine is to define a new arrow macro that constructs the boundary path of the arrow and fills it (i.e., up one side of the stem, around the arrowhead, and down the other side of the stem).  As far as I can tell, MetaPost/Postscript does not have commands that compute the boundary path of the region painted by a sequence of commands.  (I think that computing the boundary might be a much harder problem in general than computing which points to paint.  A straight arrow would be fairly simple.)

Michael

________________________________

This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.