#68 Bent arrowheads

Next Release
closed-fixed
nobody
None
3
2013-09-30
2012-01-26
Anonymous
No

Currently, the arrowheads in tikz are always straight, as if terminating a straight line. This is not a big deal in most cases, however, when working with small scales the arrowheads look outright displaced and require manual tuning. Tikz Circuit library is quite heavily hit by this misbehavior, because the internals of the symbols and annotations are drawn in the [-1:1, -1:1] coordinate scale, so it is almost impossible to get right looking arrows terminating circular paths (a readily available example is "circular annotation", but quite a few other special purpose symbols require similar marking).

On the other hand, Metapost seems to handle such cases just fine, because of some sort of arrowhead bending algorithm implemented there (section 9.6 of the metapost manual has a brief description). Is it possible to have something similar in PGF/Tikz?

Discussion


  • Anonymous
    2012-01-27

    The Metapost algorithm appears to be rather simple (metapost/base/plain.mp:444): it simply duplicates a predefined length terminating bit of path, then rotates it CW and CCW constructing a bent arrowhead. It should not be too hard to do the same in PGF and incorporate it into standard distro as an alternative for current customizable arrowheads (which do no work that well at small scales).

     
  • Till Tantau
    Till Tantau
    2013-08-29

    • status: open --> open-accepted
    • Group: --> Next Release (example)
    • Priority: 5 --> 3
     
  • Till Tantau
    Till Tantau
    2013-08-29

    Hi,

    this is pretty difficult to do, put, I agree, it is possible. The metapost solution is a bit "simplistic" for my taste since it only works for the very special case of an arrow tip of type "angle 45" or, instead of 45 some other number. "Bending" other arrow tips like "latex" or even just "stealth", let alone "to".

    I have an idea how to do this properly, but this will need some work.

     
  • Till Tantau
    Till Tantau
    2013-09-18

    • status: open-accepted --> closed-fixed
     
  • Till Tantau
    Till Tantau
    2013-09-18

    There is now (as yet undocumented) support for this in the CVS. The implementation and approach to bent arrow heads is pretty powerful; some look really nice when bent (others do not...).