![在 Tikz 中创建连接箭头和 U 形箭头](https://linux22.com/image/446012/%E5%9C%A8%20Tikz%20%E4%B8%AD%E5%88%9B%E5%BB%BA%E8%BF%9E%E6%8E%A5%E7%AE%AD%E5%A4%B4%E5%92%8C%20U%20%E5%BD%A2%E7%AE%AD%E5%A4%B4.png)
我正在看一篇论文,有一张用 Tkiz 画的图。我想知道我们是否可以控制箭头在哪里分成两部分以及如何在箭头中添加掉头,如下所示:
\begin{tikzpicture}[line width=3pt]
\node (A) at (0, 10) {A};
\node (B) at (1, 1) {B};
\node (C) at (-2, 7.5) {C};
\node (D) at (3, 0) {D};
% arrows
\draw[-> ,>=latex, blue!30!white, line width=7pt, rounded corners=5pt, to path={-| (\tikztotarget)}]
(A) edge (B) (B) edge (C) (C) edge (D);
\end{tikzpicture}
答案1
这里有一些可以帮助您开始使用这些箭头的东西。
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary {positioning, calc, arrows.meta}
\begin{document}
\begin{tikzpicture}[
every node/.style={draw, minimum size=2cm},
node distance = 3cm and 5cm,
> = {Triangle[scale=0.5]}]
\node (A) {A};
\node [above right = of A] (B) {B};
\node [right = of A] (C) {C};
\begin{scope}[line width=5mm, cyan, rounded corners=10pt]
\path ($(B)!0.5!(C)$) -| (A) coordinate [pos=0.2] (aux);
\draw (A) -- ($(A)!0.3!(C)$) |- (aux);
\draw[<->] (B) -| (aux) |- (C);
\end{scope}
\end{tikzpicture}
\end{document}