I posted the same question at {TeX} SE, but I'll ask here as well.
I'm trying to figure out how to place a shape/node at the intersection point between an arc and some horizontal lines in TikZ, preferably by using the \foreach command that TikZ provides as there are multiple horizontal lines that intersects the arc (see code below).
I'd assume it could be done using intersection command in TikZ (p. 110 in manual), but I can't make it work as I can't figure out what to write for the arc in the intersection command (the horizontal lines I can provide by making nodes at two the start and end of the lines), i.e.
Code: Select all
\draw[semithick,dashed] (5.1,9.6) arc(0:-60:5.15);
\foreach \y in {5.25,5.75,...,9.25}
{
\node (x1y1\y) at (2.25,\y) {};
\node (x2y1\y) at (5.5,\y) {};
\coordinate (c\y) at (intersection of XXX and x1y1\y--x2y1\y);
\draw (c\y) \pulse; % \pulse is defined in the code below
}
Any help/hint is appreciated!
Best regards,
drgz
Code: Select all
\tikzstyle{branch} = [circle, inner sep = 0pt, minimum size = 0.5mm, fill = black, draw = black]
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
\begin{tikzpicture}[semithick,>=latex']
\def\pulse{+(0.1,0) -- +(0.2,0.1) -- +(0.3,-0.1) -- +(0.4,0)}
\node[branch] (fp) at (-2,10) {};
\node[above] at (fp.north) {\scriptsize Focal point};
% draw rectangle in array
\draw[semithick] (2,9.5) -- (2.25,9.5) -- (2.25,5) -- (2,5) -- cycle;
% draw horizontal lines inside array
\foreach \y in {5,5.5,...,9}
\draw[semithick] (2,\y) -- (2.25,\y);
\node[above] at (2.125,9.5) {\scriptsize Array};
\foreach \y in {5.25,5.75,...,9.25}
{
% draw lines from focal point to array
\draw[semithick,->] (fp.center) -- (2,\y);
% draw VGA amplifiers
\draw[semithick,fill=white] (5.5,\y) -- ($(5.5,\y)+(0,0.2)$) -- (6,\y) -- ($(5.5,\y)+(0,-0.2)$) -- cycle;
% draw arrows thru VGA amplifiers
\begin{pgfonlayer}{background}
\draw[semithick,->] ($(5.6,\y)+(0,-0.25)$) -- ($(5.95,\y)+(0,0.2)$);
\end{pgfonlayer}
% draw ADC
\draw[semithick] (6.2,\y) -- ($(6.4,\y)+(0,0.2)$) -- ($(7.2,\y)+(0,0.2)$) -- ($(7.2,\y)+(0,-0.2)$) -- ($(6.4,\y)+(0,-0.2)$) -- cycle;
\node[] at (6.7,\y) {\scriptsize ADC};
% draw FIFO block
\draw[semithick] (7.6,\y) -- ($(7.6,\y)+(0,0.2)$) -- ($(8.4,\y)+(0,0.2)$) -- ($(8.4,\y)+(0,-0.2)$) -- ($(7.6,\y)+(0,-0.2)$) -- cycle;
\node[] at (8,\y) {\scriptsize FIFO};
% draw lines in between the blocks already drawn
\draw[semithick,->] (2.25,\y) -- (5.5,\y);
\draw[semithick,->] (6,\y) -- (6.2,\y);
\draw[semithick,->] (7.2,\y) -- (7.6,\y);
\draw[semithick,->] (8.4,\y) -- (9,\y) -- ($(9,\y)+(0,0.2)$) -- ($(9.2,\y)+(0,0.2)$) -- (9.2,\y) -- (10,\y);
}
% draw arc before array
\draw[semithick,dashed] (2,9.6) arc(0:-60:5.15);
% draw arc after array
\draw[semithick,dashed] (5.1,9.6) arc(0:-60:5.15);
% draw rectangle for digital adder
\draw[semithick] (10,9.5) -- (10.5,9.5) -- (10.5,5) -- (10,5) -- cycle;
\node[rotate=90] at (10.25,7.25) {\scriptsize Digital adder};
% draw output signal
\draw[semithick,] (10.5,7.25) -- (11,7.25) -- (11,7.75) -- (11.25,7.75) -- (11.25,7.25) -- (11.5,7.25);
\node[above] at (11.125,7.75) {\scriptsize$\begin{matrix}\text{Output}\\\text{signal}\end{matrix}$};
% draw arrow for sampling clock
\draw[semithick,->] (6.7,4.5) -- (6.7,5.05);
\node[below] at (6.7,4.5) {\scriptsize Sampling clock};
% draw line in between every ADC
\foreach \y in {5.25,5.75,...,8.75}
\draw[semithick] ($(6.7,\y)+(0,0.2)$) -- ($(6.7,\y)+(0,0.3)$);
\end{tikzpicture}