A simple solution, the lines are not quite parallel
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,shadows,arrows,positioning}
\tikzset{
line/.style={draw,-stealth,thick},
block/.style={draw,rectangle, text width=10em, text centered, minimum height=15mm, node distance=10em}
}
%fill=yellow!50
\begin{document}
\begin{tikzpicture}
\node [block] (browser) {BROWSER};
\node [block, below of= browser] (mediaplayer) {MEDIA PLAYER};
\node [block, right of= browser,node distance= 30em, yshift=-50pt, minimum height=20em] (webserver) {WEB SERVER};
%arrows
\path [line] (browser.-3) -- (browser.-3-|webserver.west);
\path [line,red] (webserver.west|-browser.3) |- (browser.3);
\path [line] (browser) -- (mediaplayer);
\path [line] (mediaplayer.-3) -- (mediaplayer.-3-|webserver.west);
\path [line,green] (webserver.west|-mediaplayer.3) -- (mediaplayer.3);
\end{tikzpicture}
\end{document}
- Please always add a full (MWE)!
Answer:
You can use rounded corners=<inset>
(TikZ and PGF manual p.150, chapter 14.5 Rounding Corners) and shift the end position with ([xshift=2.25cm]M1.north)
(see p.40, 2.19 Transformations).
The rounded <inset>
describes how big the corner is. Here rounded corners=5pt
is used.
Angled arrows:
\draw[rounded corners=5pt,-latex, ultra thick, ->,red] (M1.east) -|([xshift=2.25cm]M1.north)node[black,rounded corners=.0cm,below=0.4cm, right=0.3cm] {$x_2(t)$};
\draw[rounded corners=5pt,-latex, ultra thick, ->,red] (M2.east) -|([xshift=2.25cm]M2.north)node[black,rounded corners=.0cm,below=0.4cm, right=0.3cm] {$x_1(t)$};
Solution:
MWE:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,patterns,decorations.pathmorphing,decorations.markings}
\begin{document}
\begin{tikzpicture}[every node/.style={draw,outer sep=0pt,thick}]
\tikzstyle{spring}=[thick,decorate,decoration={zigzag,pre length=0.3cm,post length=0.3cm,segment length=6}]
\tikzstyle{damper}=[thick,decoration={markings,
mark connection node=dmp,
mark=at position 0.5 with
{
\node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum width=15pt,minimum height=3pt,draw=none] {};
\draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
\draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);
}
}, decorate]
\tikzstyle{ground}=[fill,pattern=north east lines,draw=none,minimum width=2.5cm,minimum height=0.3cm]
\node (M1) [minimum width=3.5cm,minimum height=2cm] {$m_1$};
\node (M2) [minimum width=3.5cm,minimum height=2cm, yshift=-4cm] {$m_2$};
\node (ground) at (M2.south) [ground, yshift=-2cm,anchor=north] {};
\draw [spring] ($(M2.north east)+(-1,0cm)$)-- ($(M1.south east)+(-1,0cm)$) node[right=0.75cm, below=0.75cm] {$C_1$};
\draw [damper] ($(M2.north west)+(1,0cm)$)-- ($(M1.south west)+(1,0cm)$) node[left=1cm, below=0.75cm] {$B_1$};
\draw [spring] ($(ground.north east)+(-0.5,0cm)$)-- ($(M2.south east)+(-1,0cm)$) node[right=0.75cm, below=0.75cm] {$C_2$};
\draw [damper] ($(ground.north west)+(0.5,0cm)$)-- ($(M2.south west)+(1,0cm)$) node[left=1cm, below=0.75cm] {$B_2$};
\draw [-latex, ultra thick, <-] (M1.north) ++(0,0.1cm) -- +(0,1cm) node[below=0.4cm, right=0.3cm] {$f(t)$};
%\draw [-latex, ultra thick, ->] (M1.east) |- (M1.east) ++(0.5,0cm) -- +(0,1cm) node[below=0.4cm, right=0.3cm] {$x_2(t)$};
%\draw [-latex, ultra thick, ->] (M2.east) |- (M2.east) ++(0.5,0cm) -- +(0,1cm) node[below=0.4cm, right=0.3cm] {$x_1(t)$};
%
\draw[rounded corners=5pt,-latex, ultra thick, ->,red] (M1.east) -|([xshift=2.25cm]M1.north)node[black,rounded corners=.0cm,below=0.4cm, right=0.3cm] {$x_2(t)$};
\draw[rounded corners=5pt,-latex, ultra thick, ->,red] (M2.east) -|([xshift=2.25cm]M2.north)node[black,rounded corners=.0cm,below=0.4cm, right=0.3cm] {$x_1(t)$};
\end{tikzpicture}
\end{document}
Best Answer
your flowchart is relative simple ... therefore code of it can be simplified: with use of
chains
library which enables:chains
join
for drawing connection lines between nodesbeside this, in drawing are used:
positioning
library and it syntax\tikzstyle
is depreceated way to define style of eleents intikz
drawing. instead it is in mwe below usedtikzset
for definition of styles