Here's a very over the top approach that places a coordinate at a specified location along the path, places a circle with a specified diameter on that coordinate, calculates the intersections of the curve and the circle, and then draws a diamond between the two intersections.
Drawbacks: The diamonds will have slightly different sizes, depending on the curvature of the original path. The original path isn't interrupted, instead the diamonds are just drawn on top. With the current implementation, while you can have several diamonds on the same path, the options like diamond ratio
, diamond length
, and every diamond
will apply to all diamonds equally.
\documentclass{standalone}
\usepackage{tikz}
\tikzset{
diamond helpers/.code={
\path [draw,name path=circle] (middle) circle [radius=0.1cm];
},
diamond/.style={
decoration={
markings,
mark=at position #1 with {
\coordinate (middle);
\path [name path=circle] (middle) circle [radius=0.5*\diamondlength];
\draw [every diamond, name intersections={of=curve and circle}]
(intersection-1) --
($($(intersection-1)!0.5!(intersection-2)$)!\diamondaspect!90:(intersection-2)$) --
(intersection-2) --
($($(intersection-1)!0.5!(intersection-2)$)!\diamondaspect!-90:(intersection-2)$) --
cycle;}
},
postaction=decorate,
name path global=curve
},
diamond/.default=0.5,
diamond aspect/.store in=\diamondaspect,
diamond aspect=0.75,
diamond length/.store in=\diamondlength,
diamond length=0.2cm,
every diamond/.style={draw,fill=white}
}
\usetikzlibrary{decorations.markings,intersections,calc}
\begin{document}
\begin{tikzpicture}
* \draw [diamond, diamond=0.1] (0,0) to [out=70, in=100] (1,-1);
\end{tikzpicture}
\end{document}
As a workaround to your first question, you can add a (very) small segment to choose the orientation of the arrow:
\documentclass[margin=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}
\node[style={circle,draw=black,inner sep=1.4pt,fill}] (a) at (2,3) {};
\draw[->,>=latex',dashed,line width=.8pt]
(a) ++(.25,0) arc (360:30:.25) -- ++(-45:1pt);
\end{tikzpicture}
\end{document}
Best Answer
I understood the question in the way, that one arrow should have a circle and a diamond at its tail.