22:28
(Bother, I forgot that hitting
enter
submitted the comment - ah well, you'll get notified of that one and then hopefully see the rest!)
So, most significantly, by default then if you specify
shorten >=5pt, shorten <=5pt
on a fragmented path then it applies it to the last component only. \draw[line width=2mm] (0,0) to[out=0,in=180] (2,0) (2.5,0) to[out=0,in=180] (4,0); \draw[red,shorten <=5pt, shorten >=5pt] (0,0) to[out=0,in=180] (2,0) (2.5,0) to[out=0,in=180] (4,0);
(Second bother: I can't just paste an image directly into the chat, I have to save it and upload it ... it's too late in the evening for that right now so you can run the above code for yourself and see that the red line is shortened only on the second component.)
So when the
fancy dashed
style is applied to the whole pparrowyy
path after it has been split, then only the second component gets the shortening. This means that the gap is width 1.25pt
before the intersection point and 6.25pt
after it (1.25pt
being half of 2.5pt
). So either we specify the full desired width initially or we need to ensure that the shorten
keys are applied to all components. One way is to render each component separately, as you did.
It may be (need to read the manual) that the
shorten
keys are affected by the tips
keys which would provide another way to achieve the same end. \documentclass[tikz,border=3pt]{standalone} %\url{tex.stackexchange.com/a/720532/86} \usetikzlibrary{spath3,intersections} \begin{document} \begin{tikzpicture}[ fancy dashed/.style={shorten <=5pt,shorten >=5pt}, ] \coordinate (yy) at (6.8,-0.4); \coordinate (ww) at (7.75,0.7625); \coordinate (pp) at (0.75,-2.25); \coordinate (qq) at (2.5,-2.25); \coordinate (ctrl) at (9,-1.5); \foreach \cdt in {yy,ww,pp,qq,ctrl} { \fill[cyan!50!black] (\cdt) circle[radius=5pt]; } \path[spath/save=pparrowyy,draw, fancy dashed, line width=2mm, line cap=butt ] (pp) to[out=-30,in=23…
In the above code, then I apply the shortening to the original path (in black), and then also to the green path. As you can see, the green path is not fully centred on the black path. This is why I think it best to apply the original shortening to the original path and then use the correct width when inserting gaps. So to get the best approximation of what you originally had, I would put the
shorten
keys on the original path, and then use 6.25pt
in the gaps. \documentclass[tikz,border=3pt]{standalone} %\url{tex.stackexchange.com/a/720532/86} \usetikzlibrary{spath3,intersections} \begin{document} \begin{tikzpicture}[ fancy dashed/.style={shorten <=5pt,shorten >=5pt}, ] \coordinate (yy) at (6.8,-0.4); \coordinate (ww) at (7.75,0.7625); \coordinate (pp) at (0.75,-2.25); \coordinate (qq) at (2.5,-2.25); \coordinate (ctrl) at (9,-1.5); \foreach \cdt in {yy,ww,pp,qq,ctrl} { \fill[cyan!50!black] (\cdt) circle[radius=5pt]; } \path[spath/save=pparrowyy,draw, fancy dashed, line width=2mm, line cap=butt ] (pp) to[out=-30,in=23…
1 hour later…
« first day (4 days earlier) ← previous day next day → last day (16 days later) »
Transcript for
Jun15
Jun18
Jun19
Discussion between cfr and Andrew Stacey
Imported from a comment discussion on tex.stackexchange.com/qu...