答案1
也许这有助于作为一个起点。
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[line width=0.5mm, line cap=round]
\draw (0.5,2)--(0.75,2.5)--(1.5,2.25)--++(190:0.4)coordinate(B);
\draw (0.5,2)--++(20:0.3)coordinate(A);
\path(A) edge [bend left=50](0.5,0.5);
\path(B) edge [bend left=50](0.5,0.5);
\end{tikzpicture}
\end{document}
答案2
这是我的看法,它设置了一种新样式custarr
,您可以将其添加到任何\draw
命令中。您可以将描边颜色和填充设置为您喜欢的任何颜色,请参阅下面的代码以获取示例。
尚不支持/待办功能
- 弯曲
arc
:如果您尝试添加或,箭头将不起作用to[out= <angle>, in= <angle>]
。我对这种类型的路径构造还不太熟悉,因此当我能够实现它时,我会告诉您。
输出
代码
\documentclass[tikz, margin=10pt]{standalone}
\usetikzlibrary{decorations}
\pgfdeclaredecoration{newarrow}{initial}{
\state{initial}[%
switch if less than=\pgfdecoratedpathlength/1 to final, %% (1)
width=\pgfdecoratedpathlength/2, %% (2)
next state=final
]
{%
\pgfsetfillcolor{white}
\pgfsetstrokecolor{black}
\pgfsetmiterjoin \pgfsetmiterlimit{12} % arrow start corner <
\pgfmathsetmacro\onethird{\pgfdecoratedpathlength/2*1.5}
\pgfmathsetmacro\arrowhead{\pgfdecoratedpathlength/7}
\pgfmathsetmacro\arrowspread{\arrowhead/2}
\pgfmoveto{\pgfpoint{14pt}{0pt}} % was 1pt with no miter limit
\pgflineto{\pgfpoint{\onethird}{\arrowspread}}
\pgflineto{\pgfpoint{\onethird}{\arrowhead}}
\pgflineto{\pgfpoint{\pgfdecoratedpathlength-3pt}{0pt}}
\pgflineto{\pgfpoint{\onethird}{-\arrowhead}}
\pgflineto{\pgfpoint{\onethird}{-\arrowspread}}
\pgfclosepath
%
\pgfmoveto{\pgfpoint{\pgfdecoratedpathlength}{0pt}}
}
\state{final}
{%
\pgfpathlineto{\pgfpointdecoratedpathlast}
}
}
\tikzset{% easier to type inside of the \draw command
custarr/.style={% CUSTom ARRow
decorate, decoration={name=newarrow}%
}
}
\begin{document}
\begin{tikzpicture}[line width=1mm]
% a couple of nodes to show interaction with new arrow
\node[circle,fill, inner sep=1pt, outer sep=0] (a) at (0,0) {};
\node[draw, thin, minimum size=1cm] (b) at (4,0) {};
% no modifications
\draw[custarr] (4,4) -- (b.north west);
% a few more examples
\draw[custarr, draw=orange] (2,-2) -- (2,2); %
\draw[custarr, fill=red] (a) -- (b);
\draw[custarr, fill=green!70!black] (a) -- (2,4);
\end{tikzpicture}
\end{document}