0

This question already has an answer here:

I want to know how you can easily create a line connecting two nodes which has more than one corner? One corner is easy, you can just use something like \path [line] (node1) -| (node2);. But what to do if the line consists out of more than two straight segments?

The problem I have now is that a line is going through a node :(. I would like to have it look like a Z and go in between the nodes. So something like -|-, unfortunately that does not work.

enter image description here

\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}

marked as duplicate by Henri Menke, Tom Bombadil, Jesse, Mico, Zarko Nov 25 '15 at 12:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

change :

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

by :

 \path [arrow] (no_slip) - ++(2,0) -- ++(2,.8) -| (total_velocity);
  • Thanks a lot! I edited it a bit and have now: \path [arrow] (no_slip) - ++(2,0) -- ++(2,1.5) -- (total_velocity); which is exactly what I wanted. Thanks again! – Aeronaelius Nov 25 '15 at 10:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.