[metapost] arrowhead weirdness

Oliver Buerschaper oliver.buerschaper at mpq.mpg.de
Mon Aug 18 10:50:39 CEST 2008


> You only have half of 'ahangle' as angle in the subdividing right  
> triangles.
>
> ahlength := 2u/sin(.5ahangle);

Arrg … that's what I didn't take into account.

> But changing your source at this point still doesn't work here.

Neither does it work here … for the record: using mptopdf 1.3.2 (mpost  
0.993) in both cases here's my original version:

---
beginfig(1);
     u := 0.5cm;
     path p;
     p := origin--(5u,0);
     ahlength := 2u/sind(ahangle);
     pickup pencircle scaled u;
     drawarrow p;
     draw p yshifted u withpen pencircle scaled 0.1bp withcolor red;
     draw p yshifted u/2 withpen pencircle scaled 0.1bp withcolor red;
     undraw p withpen pencircle scaled 0.1bp;
     undraw arrowhead p withpen pencircle scaled 0.1bp;
endfig;


end;
---

with this output

-------------- next part --------------
A non-text attachment was scrubbed...
Name: arrowhead-1.pdf
Type: application/pdf
Size: 1392 bytes
Desc: not available
Url : http://tug.org/pipermail/metapost/attachments/20080818/95cfc2b7/attachment.pdf 
-------------- next part --------------



and here's the one with the corrected angle:

---
beginfig(1);
     u := 0.5cm;
     path p;
     p := origin--(5u,0);
     ahlength := 2u/sind(ahangle/2);
     pickup pencircle scaled u;
     drawarrow p;
     draw p yshifted u withpen pencircle scaled 0.1bp withcolor red;
     draw p yshifted u/2 withpen pencircle scaled 0.1bp withcolor red;
     undraw p withpen pencircle scaled 0.1bp;
     undraw arrowhead p withpen pencircle scaled 0.1bp;
endfig;


end;
---

Now this I don't understand at all:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: arrowhead-1.pdf
Type: application/pdf
Size: 1376 bytes
Desc: not available
Url : http://tug.org/pipermail/metapost/attachments/20080818/95cfc2b7/attachment-0001.pdf 
-------------- next part --------------



By the way, changing ahangle/2 into 0.5ahangle doesn't help either.

Any suggestions?

Oliver


More information about the metapost mailing list