如何创建 Z 形箭头线和其他具有更多角的线条

如何创建 Z 形箭头线和其他具有更多角的线条

我想知道如何轻松地创建一条连接两个节点的线,该线具有多个角?一个角很容易,您只需使用类似\path [line] (node1) -| (node2);. 但是如果线由两个以上的直线段组成该怎么办?

我现在遇到的问题是一条线穿过一个节点 :(。我希望它看起来像一个 Z 并穿过节点之间。所以-|-,不幸的是,这不起作用。

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}
\usepackage{amsmath}

\usepackage[tightpage, active,i pdftex]{preview}
\PreviewEnvironment{tikzpicture}

\begin{document}
\begin{tikzpicture}[node distance=1.5cm]
\tikzstyle{level1} = [rectangle, rounded corners, text width=3cm, minimum height=1cm, text centered, draw=black, fill=red!40]
\tikzstyle{level2} = [rectangle, rounded corners, text width=3cm, minimum height=1cm, text centered, draw=black, fill=green!20]
\tikzstyle{level3} = [rectangle, rounded corners, text width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!20]
\tikzstyle{arrow} = [draw, -latex]

\node (lagrangian) [level1] {Evolve Lagrangian};

\node (panel_strength) [level2, below of=lagrangian] {Vortex sheet};
\node (no_slip) [level3, below of=panel_strength] {Ensure no-slip at collocation points};

\node (total_velocity) [level2, right of=panel_strength, node distance=4cm] {Total velocity};
\node (particle_velocity) [level3, below of=total_velocity] {Compute $\mathbf{u}_\omega$};
\node (particle_velocity) [level3, below of=particle_velocity] {Compute $\mathbf{u}_\gamma$};
\node (particle_velocity) [level3, below of=particle_velocity] {Evaluate\\$\mathbf{u}=\mathbf{u}_\infty+\mathbf{u}_\omega+\mathbf{u}_\gamma$};

\node (particle_convection) [level2, right of=total_velocity, node distance=4cm] {Convection};
\node (convect_particles) [level3, below of=particle_convection] {Solve $\displaystyle\frac{d\mathbf{x}_p}{dt}=\mathbf{u}(\mathbf{x}_p)$};
\node (remesh_circulation) [level3, below of=convect_particles] {Re-mesh $\boldsymbol\alpha_p$ onto Cartesian grid};
\node (population_control) [level3, below of=remesh_circulation] {Population control};

\node (particle_diffusion) [level2, right of=particle_convection, node distance=4cm] {Diffusion};
\node (redistribute_strength) [level3, below of=particle_diffusion] {Redistribute particle strengths};

\path [arrow] (lagrangian) -- (panel_strength);

\path [arrow] (panel_strength) -- (no_slip);
\path [arrow] (no_slip) -| (total_velocity); 

\end{tikzpicture}
\end{document}

答案1

改变 :

 \path [arrow] (no_slip) -| (total_velocity); 

经过 :

 \path [arrow] (no_slip) - ++(2,0) -- ++(2,.8) -| (total_velocity);

相关内容