Graphics, Figures & TablesParallel Lines between two Blocks

Information and discussion about graphics, figures & tables in LaTeX documents.
Saed Daoud
Posts: 14
Joined: Thu Jun 06, 2013 4:24 pm

Parallel Lines between two Blocks

Post by Saed Daoud »

Hello all,

I have two blocks drawn using TikZ/PGF, and I want to draw multiple parallel lines between them. This is the code I have.

Code: Select all

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows,fadings, shadows}

\usepackage{amsmath,bm,times}

\begin{document}
\pagestyle{empty}

\tikzstyle{sensor}=[draw, fill=blue!20, text width=5em, 
    text centered, minimum height=2.5em]
\tikzstyle{naveqs} = [sensor, text width=4em, fill=gray!40, 
    minimum height=12em, rounded corners, shade, drop shadow]

\begin{tikzpicture}
\node (naveq) [naveqs, name=S2P] {S/P};
\node (naveq) [naveqs, name=FFT, right of=S2P,node distance=3cm] {FFT};
		
\end{tikzpicture}


\end{document}
What is the best way to do so?


Thanks in advance

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Saed Daoud
Posts: 14
Joined: Thu Jun 06, 2013 4:24 pm

Re: Parallel Lines between two Blocks

Post by Saed Daoud »

Any help here, please?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Parallel Lines between two Blocks

Post by localghost »

Perhaps you should be more specific regarding these lines. Should they be horizontal, vertical or diagonal?

Thorsten
Saed Daoud
Posts: 14
Joined: Thu Jun 06, 2013 4:24 pm

Parallel Lines between two Blocks

Post by Saed Daoud »

localghost wrote:Perhaps you should be more specific regarding these lines. Should they be horizontal, vertical or diagonal?

Thorsten
I want them to be horizontal. Two lines above the middle, then three dots, and one line at the bottom.

Thanks in advance
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Parallel Lines between two Blocks

Post by localghost »

And these three dots are going to be horizontal, vertical or diagonal?
Saed Daoud
Posts: 14
Joined: Thu Jun 06, 2013 4:24 pm

Parallel Lines between two Blocks

Post by Saed Daoud »

localghost wrote:And these three dots are going to be horizontal, vertical or diagonal?
Vertical, to indicate a number of lines that are eliminated.

Thanks
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Parallel Lines between two Blocks

Post by localghost »

Try something like this. Not very professional and therefore improvable.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{calc,shadows}

\tikzstyle{sensor}=[
  draw,
  fill=blue!20,
  text width=5em,
  text centered,
  minimum height=2.5em
]
\tikzstyle{naveqs}=[
  sensor,
  text width=4em,
  fill=gray!40,
  minimum height=12em,
  rounded corners,
  shade,
  drop shadow
]

\begin{document}
  \begin{tikzpicture}
    \node (s2p) [naveqs] {S/P};
    \node (fft) [naveqs,right of=s2p,node distance=3cm] {FFT};
    \draw[shorten >=3pt,shorten <=3pt] (s2p.north east) -- (fft.north west);
    \draw[shorten >=3pt,shorten <=3pt] (s2p.60) -- (fft.120);
    \fill ($(s2p)+(1.5,0)$) circle[radius=1pt] +(0,0.5) circle[radius=1pt]  +(0,-0.5) circle[radius=1pt];
    \draw[shorten >=3pt,shorten <=3pt] (s2p.south east) -- (fft.south west);
  \end{tikzpicture}
\end{document}
Saed Daoud
Posts: 14
Joined: Thu Jun 06, 2013 4:24 pm

Parallel Lines between two Blocks

Post by Saed Daoud »

localghost wrote:Try something like this. Not very professional and therefore improvable.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{calc,shadows}

\tikzstyle{sensor}=[
  draw,
  fill=blue!20,
  text width=5em,
  text centered,
  minimum height=2.5em
]
\tikzstyle{naveqs}=[
  sensor,
  text width=4em,
  fill=gray!40,
  minimum height=12em,
  rounded corners,
  shade,
  drop shadow
]

\begin{document}
  \begin{tikzpicture}
    \node (s2p) [naveqs] {S/P};
    \node (fft) [naveqs,right of=s2p,node distance=3cm] {FFT};
    \draw[shorten >=3pt,shorten <=3pt] (s2p.north east) -- (fft.north west);
    \draw[shorten >=3pt,shorten <=3pt] (s2p.60) -- (fft.120);
    \fill ($(s2p)+(1.5,0)$) circle[radius=1pt] +(0,0.5) circle[radius=1pt]  +(0,-0.5) circle[radius=1pt];
    \draw[shorten >=3pt,shorten <=3pt] (s2p.south east) -- (fft.south west);
  \end{tikzpicture}
\end{document}
It is not quite exactly how I envisioned it, though I appreciate your effort in trying to help me.

I found this example, which is basically the same, but I could not adapt it to my code. The example can be found in this link: http://www.texample.net/tikz/examples/i ... on-system/.

Thanks
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Parallel Lines between two Blocks

Post by localghost »

Saed Daoud wrote:It is not quite exactly how I envisioned it, though I appreciate your effort in trying to help me. […]
Then you should be more precise in the description of the problem (arrows instead of lines, …). At the moment I have no idea what you are after. So I'll wait til you come up with clearer and more targeted questions.

Perhaps studying the PGF/TikZ user guide will enable you to adapt the code you found and apply it to your problem.
Saed Daoud
Posts: 14
Joined: Thu Jun 06, 2013 4:24 pm

Re: Parallel Lines between two Blocks

Post by Saed Daoud »

May be I was not very clear, and probably I won't be. So, I attached a hand-drawn figure of what I want.
Attachments
block-diagram.png
block-diagram.png (57.42 KiB) Viewed 12144 times
Post Reply