This is a follow-up to my recent question Half arrows in graph using TikZ.
\documentclass[tikz]{standalone}
\usetikzlibrary{matrix,arrows,arrows.meta,bending,decorations.pathreplacing,
decorations.pathmorphing,decorations.markings,fit,patterns,
shapes,intersections,calc}
\begin{document}
\tikzset
{
down oriented arrow/.style 2 args = {
thick,
decoration={
markings,
mark=at position 0.01 with
{
\coordinate (A) at (0,0);
\coordinate (B) at (.125,.125);
},
mark=at position 0.99 with
{
\coordinate (C) at (-.25,.125);
\coordinate (D) at (-.25,.25);
\coordinate (E) at (0,0);
\filldraw[#1,#2]
(A) -- (B) -- (C) -- (D) -- (E) -- cycle;
}
},
preaction = {decorate},
},
down oriented arrow/.default={draw=black}{fill=black!30}
}
\tikzset
{
up oriented arrow/.style 2 args = {
thick,
decoration={
markings,
mark=at position 0.01 with
{
\coordinate (A) at (0,0);
\coordinate (B) at (.125,-.125);
},
mark=at position 0.99 with
{
\coordinate (C) at (-.25,-.125);
\coordinate (D) at (-.25,-.25);
\coordinate (E) at (0,0);
\filldraw[#1,#2]
(A) -- (B) -- (C) -- (D) -- (E) -- cycle;
}
},
preaction = {decorate},
},
up oriented arrow/.default={draw=black}{fill=black!30}
}
\begin{tikzpicture}[align=center,node distance=3cm]
\node[draw,circle] (a) {};
\node[draw,circle,right of=a] (b) {};
\node[draw,circle,below of=a] (c) {};
\node[draw,circle,right of=c] (d) {};
\draw[down oriented arrow={draw=green!90}{fill=green!30}] (a) to node [midway,sloped,above = 2pt] {$\vec{e}$} (b);
\draw[down oriented arrow={draw=blue!90}{fill=blue!30}] (b) to (a);
\draw[up oriented arrow={draw=orange!90}{fill=orange!30}] (b) to node [midway,sloped,above = 2pt] {$\vec{e}$} (c);
\draw[up oriented arrow={draw=red!90}{fill=red!30}] (c) to (b);
\draw[down oriented arrow] (d) to[bend right] (b);
\end{tikzpicture}
\end{document}
What I would like to achieve is that the decorations created by the up oriented arrow
and down oriented arrow
styles bend with the edge. Is it possible to achieve this?
bending
would work. But these are not...