粗箭头怎样才能正确弯曲?
我使用以下代码,但它看起来很糟糕:
\tikzset{%
thick arrow/.style={
-{Triangle[angle=90:1pt 1]},
line width=1.0cm,
draw=gray
}
}
\tikzstyle{software} = [draw, text width=10em, minimum height=6em, text centered, line width=1pt, color=mydarkblue, fill=mylightgray, text=mydarkblue, font=\normalsize\bf\sffamily]
\centering
\begin{tikzpicture}[node distance = 6em]
\node[software](softA) {Software A};
\node[software](softB)[left = of softA] {Software B};
\draw [thick arrow] ($(softB.north)+(1,1em)$) [bend left=45] to ($(softA.north)+(-1,1em)$);
\path [decorate,decoration={text along path,
text={|\footnotesize\bfseries\sffamily\color{white}|DATA A},text align=center}] ($(softB.north)+(1,1.5em)$) [bend left] to ($(softA.north)+(-1,1.5em)$);
\draw [thick arrow] ($(softA.south)-(1,1em)$) [bend left=45] to ($(softB.south)+(1,-1em)$);
\path [decorate,decoration={text along path, text={|\footnotesize\bfseries\sffamily\color{white}|DATA B},text align=center}] ($(softB.south)+(1,-1.5em)$) [bend right=45] to ($(softA.south)+(-1,-1.5em)$);
\end{tikzpicture}
代码创建的结果如下:箭头弯曲得非常奇怪,而且看起来弯曲得不正确且不均匀。
答案1
我不知道你的\documentclass{...}
和\usetikzlibrary{...}
。你可能想考虑这个来源,在那里你可以添加两个矩形。我的代码是这个的改编代码。
\documentclass{article}
\usepackage[margin=0.3cm, paperwidth=3.3cm, paperheight=3.3cm]{geometry}
\usepackage{tikz}
\def\arrow{
(10:1.1) -- (7:1) arc (7:120:1) [rounded corners=.8] --
(120:0.9) [rounded corners=1] -- (130:1.1) [rounded corners=.8] --
(120:1.3) [sharp corners] -- (120:1.2) arc (120:5.25:1.2)
[rounded corners=1] -- (10.4:1.05) -- (8:1.05) -- cycle
}
\tikzset{
ashadow/.style={opacity=.6, shadow xshift=0.1, shadow yshift=-0.07},
}
\def\arrows[#1]{
\begin{scope}[scale=#1]
\draw[color=gray, left color=gray, right color=gray] [rotate=210] \arrow;
\draw[color=yellow, left color=yellow, right color=yellow] [rotate=20] \arrow;
\end{scope}
}
\begin{document}
\begin{center}
\begin{tikzpicture}
\arrows[1];
\end{tikzpicture}
\end{center}
\end{document}
或者你可以通过链接查看这个例子绘制三循环图。