5

I'm trying to reproduce the following picture

enter image description here

In this picture, there are some shapes that are repeated. For instance 5, 6, 8, 10 and 11. My idea is to use ./style in order to define these shapes and place them in the appropriate positions.

Although I know how to create simple styles in tikz(like pipe in my code), I am not aware how to create more complicated shapes and repeat them in my picture. For instance I can't draw shape 5 as is, but I drew it as a simple orthogonal box.

Any idea on how to draw them and reproduce the image?

EDIT I am also trying to create shapes 4 and 12, but I can't seem to be able to draw them and place them in the right position.

My code so far is

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}

\tikzset{
  pipe/.style = {
    draw,
    minimum width=4cm, 
    minimum height=.1cm, 
    anchor=east,
  },
  source/.style = {
    draw,
    fill=black, 
    minimum width=.8cm, 
    minimum height=.4cm, 
  },
  lenses/.style = {
    draw,
    fill=yellow,
    minimum width=.7cm, 
    minimum height=.1mm, 
  },
  steerer/.style = {
    draw,
    fill=blue,
    minimum width=.7cm, 
    minimum height=.5cm, 
    rounded corners
  }
  }

\begin{document}
 \definecolor{tank}{RGB}{98,190,177}
 \begin{tikzpicture}
  %tank
  \coordinate (tank) at (0,0);
  \draw[tank, fill=tank] (-2,0.5)--(-0.5,1)--(0.5,1)--(2,0.5)--(2,-0.5)--(0.5,-1)--(-0.5,-1)--(-2,-0.5)--cycle;
  %pipes
  \coordinate (pipe1) at (-2,0);
  \node[pipe] at (pipe1) (pipe1) {};%left pipe
  \coordinate (pipe2) at (2,0);
  \node[pipe,anchor=west] at (pipe2) (pipe2) {};%right pipe
  \node[pipe, right=0mm of pipe2,rotate=-90] (pipe3) {};
  \node[pipe, right=0mm of pipe3,rotate=-160] (R3) {};
  \node[pipe, right=0mm of pipe3,rotate=-130] (R2) {};
  \node[pipe, right=0mm of pipe3,rotate=-110] (R1) {};
  \node[pipe, right=0mm of pipe3,rotate=-80] (L1) {};
  \node[pipe, right=0mm of pipe3,rotate=-50] (L2) {};
  \node[pipe, right=0mm of pipe3,rotate=-20] (L3) {};
  \node[pipe, left=0mm of pipe1,rotate=-30] (sputter) {};
  \node[pipe, left=0mm of pipe1,rotate=30] (duoplasmatron) {};
  %experimental chamber
  \node[circle,fill=red,right=-1.5mm of L1] {};
  %sources  
  \node[source, left=0mm of sputter,rotate=60,anchor=south] (spusource) {};
  \node[source, left=0mm of duoplasmatron,rotate=-60,anchor=north] (duosource) {};
  %electrostatic lenses
  \node[lenses,rotate=60,fill=yellow] at (sputter) (lenses1) {};
  \node[lenses,rotate=-60,fill=yellow] at (duoplasmatron) (lenses2) {};
  \node[lenses,rotate=90, left=-7.5mm of pipe1, anchor=south,fill=yellow] (lenses3) {};
  \node[lenses,rotate=90, right=-7.5mm of pipe1, anchor=north,fill=yellow] (lenses3) {};
  %steerers
  \node[steerer,rotate=90, right=-15mm of pipe1, anchor=north] (steerer1) {};
  \node[steerer,rotate=90, left=-15mm of pipe2, anchor=south] (steerer2) {};
  %analyser
  \draw[red,fill=white] (5.6,-0.25)--(5.5,-0.25)--(5.5,0.25)--(5.9,0.25)arc(90:0:0.375cm)--+(0,-0.5)--+(-0.5,-0.5)--+(-0.5,-0.3)arc(0:90:0.175cm);
  %inflector
  \draw[red, thick] (-5.95,-0.1cm)--(-5.95,0.1cm)--+(135:0.3cm)--(-6.4,0.33);
  %walls
  \draw[very thick] (-3,-4)--(5,-4)arc(180:270:1)--(6,-8)--(6,-5)arc(270:360:1)--(9,-4);
 \end{tikzpicture}
\end{document}

and my output is

enter image description here

EDIT After @Symbol 's answer the code has been modified

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}

\tikzset{
  pipe/.style = {
    draw,
    minimum width=4cm, 
    minimum height=.1cm, 
    anchor=east,
  },
  steerer/.style = {
    draw,
    fill=white,
    minimum width=.2cm, 
    minimum height=.5cm, 
    anchor=east,
    rounded corners=0.5mm
  }
}

\begin{document}
 \definecolor{tank}{RGB}{98,190,177}
 \makeatletter

\pgfdeclareshape{slits}{
    \savedanchor\centerpoint{\pgf@x=0cm \pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=.25cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.25cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{north}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgf@y=.2cm\advance\pgf@y by\halfheight}
    \anchorborder{\centerpoint}
    \backgroundpath{
        \draw[rounded corners=.1cm, fill=white](-\halfwidth,-\halfheight)rectangle(\halfwidth,\halfheight);
        \draw[rounded corners=.04cm](-.8*\halfwidth,-.4*\halfheight)rectangle(.8*\halfwidth,-.8*\halfheight)(-.8*\halfwidth,.4*\halfheight)rectangle(.8*\halfwidth,.8*\halfheight);}}

\pgfdeclareshape{quadrapole}{
    \savedanchor\centerpoint{\pgf@x=0cm \pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=.25cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.25cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{north}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgf@y=.2cm\advance\pgf@y by\halfheight}
    \anchorborder{\centerpoint}
    \backgroundpath{
        \draw[rounded corners=.1cm,fill=white](-\halfwidth,-\halfheight)rectangle(\halfwidth,\halfheight);
        \filldraw[rounded corners=.04cm,fill=red](-.8*\halfwidth,-.4*\halfheight)rectangle(.8*\halfwidth,-.8*\halfheight)(-.8*\halfwidth,-.2*\halfheight)rectangle(.8*\halfwidth,.2*\halfheight)(-.8*\halfwidth,.4*\halfheight)rectangle(.8*\halfwidth,.8*\halfheight);}}

\pgfdeclareshape{lens}{
    \savedanchor\centerpoint{\pgf@x=0cm \pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=.05cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.3cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{north}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgf@y=.2cm\advance\pgf@y by\halfheight}
    \anchorborder{\centerpoint}
    \backgroundpath{
        \draw(0,-1.2*\halfheight)--(0,-\halfheight);
        \draw(0,\halfheight)--(0,1.2*\halfheight);
        \draw[fill=white](-\halfwidth,-\halfheight)rectangle(\halfwidth,\halfheight);
        }}

\pgfdeclareshape{pump}{
    \savedanchor\centerpoint{\pgf@x=0cm \pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=.025cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.2cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{north}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgf@y=.18cm\advance\pgf@y by\halfheight}
    \anchorborder{\centerpoint}
    \backgroundpath{
        \draw[fill=black](-\halfwidth,-\halfheight)rectangle(\halfwidth,\halfheight);
        \draw[fill=white](0,-1.8*\halfheight)circle(0.75*\halfheight);
        }}

\pgfdeclareshape{source}{
    \savedanchor\centerpoint{\pgf@x=0cm \pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=1cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.3cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{north}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgf@y=.2cm\advance\pgf@y by\halfheight}
    \anchor{south}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgf@y=-.2cm\advance\pgf@y by-\halfheight}
    \backgroundpath{
        \draw(-\halfwidth,-\halfheight)rectangle(\halfwidth,\halfheight)(-.8*\halfwidth,-1.2*\halfheight)--(-.8*\halfwidth,1.2*\halfheight)(-.4*\halfwidth,-1.2*\halfheight)--(-.4*\halfwidth,1.2*\halfheight)(0,-1.2*\halfheight)--(0,1.2*\halfheight)(.4*\halfwidth,-1.2*\halfheight)--(.4*\halfwidth,1.2*\halfheight)(.8*\halfwidth,-1.2*\halfheight)--(.8*\halfwidth,1.2*\halfheight);}}
 \begin{tikzpicture}
  %tank
  \coordinate (tank) at (0,0);
  \draw[tank, fill=tank] (-2,0.5)--(-0.5,1)--(0.5,1)--(2,0.5)--(2,-0.5)--(0.5,-1)--(-0.5,-1)--(-2,-0.5)--cycle;
  %pipes
  \coordinate (pipe1) at (-2,0);
  \node[pipe] at (pipe1) (pipe1) {};%left pipe
  \coordinate (pipe2) at (2,0);
  \node[pipe,anchor=west] at (pipe2) (pipe2) {};%right pipe
  \node[pipe, right=0mm of pipe2,rotate=-90] (pipe3) {};
  \node[pipe, right=0mm of pipe3,rotate=-160] (R3) {};
  \node[pipe, right=0mm of pipe3,rotate=-130] (R2) {};
  \node[pipe, right=0mm of pipe3,rotate=-110] (R1) {};
  \node[pipe, right=0mm of pipe3,rotate=-80] (L1) {};
  \node[pipe, right=0mm of pipe3,rotate=-50] (L2) {};
  \node[pipe, right=0mm of pipe3,rotate=-20] (L3) {};
  \node[pipe, left=0mm of pipe1,rotate=-30] (sputter) {};
  \node[pipe, left=0mm of pipe1,rotate=30] (duoplasmatron) {};
  %experimental chamber
  \node[circle,fill=red,right=-1.5mm of L1] {};
  %sources  
  \node[source,rotate=-30,above left=8mm and 7mm of sputter,anchor=north] (spusource) {};
  \node[source,rotate=30,above left=-1.75mm and 10.5mm of duoplasmatron,anchor=north] (duosource) {};
  %electrostatic lenses
  \node[lens,rotate=-30] at (sputter) (lenses1) {};
  \node[lens,rotate=30] at (duoplasmatron) (lenses2) {};
  \node[lens,rotate=0] at (-5.5,0) (lenses3) {};
  \node[lens,rotate=0] at (-2.5,0) (lenses4) {};
  %quadrapoles
  \node(st1)at(2.5,0)[quadrapole]{};
  \node(st2)at(6,-3)[quadrapole,rotate=90]{};
  %slits
  \node(sl1)at(-5,0)[slits]{};
  \node(sl2)at(4.5,0)[slits]{};
  \node(sl3)at(6,-1.5)[slits]{};
  %steerers
  \node[steerer] (steerer1)at(-3.5,0) {};
  \node[steerer] (steerer2)at(3.6125,0) {};
  %pumps
  \node(p1)at(-2.15,-0.325)[pump]{};
  \node(p2)at(2.15,-0.325)[pump]{};
  \node(p3)at(5.15,0.325)[pump,rotate=180]{};
  \node(p4)at(5.7,-3.5)[pump,rotate=-90]{};
  \node(p5)at(-8.5,-1.8)[pump,rotate=30]{};
  \node(p6)at(-8.5,1.8)[pump,rotate=150]{};
  %analyser
  \draw[red,fill=white] (5.6,-0.25)--(5.5,-0.25)--(5.5,0.25)--(5.9,0.25)arc(90:0:0.375cm)--+(0,-0.5)--+(-0.5,-0.5)--+(-0.5,-0.3)arc(0:90:0.175cm);
  %inflector  <----------------------------------
  \draw[red, thick] (-5.95,-0.1cm)--(-5.95,0.1cm)--+(135:0.3cm)--(-6.4,0.33);
  %walls
  \draw[very thick] (-3,-4)--(5,-4)arc(180:270:1)--(6,-8)--(6,-5)arc(270:360:1)--(9,-4);
 \end{tikzpicture}
\end{document}

and the output is

enter image description here

6
  • How about \newcommand?
    – Symbol 1
    Aug 30, 2014 at 16:25
  • 2
    I say Inkscape2TikZ the complicated parts and draw on it. Much faster and controlled creation but bloated code tradeoff.
    – percusse
    Aug 30, 2014 at 16:58
  • Since there is very little text and only numbers, no mathematical formulae, no arrows, decorations, ... etc., I recommend Inkscape then export to TikZ as said by percusse.
    – AboAmmar
    Aug 30, 2014 at 17:23
  • @percusse : I don't know how to use Inkscape...
    – Thanos
    Aug 30, 2014 at 17:28
  • @Symbol1 : I can use a \newcommand to draw a tikzpicture but how to make it a node?
    – Thanos
    Aug 31, 2014 at 7:56

2 Answers 2

5

I have no time to do all of them. Here are some examples. (forget \newcommand)

\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\makeatletter

\pgfdeclareshape{slits}{
    \savedanchor\centerpoint{\pgf@x=0cm \pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=.25cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.25cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{north}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgf@y=.2cm\advance\pgf@y by\halfheight}
    \anchorborder{\centerpoint}
    \backgroundpath{
        \draw[rounded corners=.1cm](-\halfwidth,-\halfheight)rectangle(\halfwidth,\halfheight);
        \draw[rounded corners=.04cm](-.8*\halfwidth,-.4*\halfheight)rectangle(.8*\halfwidth,-.8*\halfheight)(-.8*\halfwidth,.4*\halfheight)rectangle(.8*\halfwidth,.8*\halfheight);}}

\pgfdeclareshape{steerer}{
    \savedanchor\centerpoint{\pgf@x=0cm \pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=.25cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.25cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{north}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgf@y=.2cm\advance\pgf@y by\halfheight}
    \anchorborder{\centerpoint}
    \backgroundpath{
        \draw[rounded corners=.1cm](-\halfwidth,-\halfheight)rectangle(\halfwidth,\halfheight);
        \filldraw[rounded corners=.04cm,fill=red](-.8*\halfwidth,-.4*\halfheight)rectangle(.8*\halfwidth,-.8*\halfheight)(-.8*\halfwidth,-.2*\halfheight)rectangle(.8*\halfwidth,.2*\halfheight)(-.8*\halfwidth,.4*\halfheight)rectangle(.8*\halfwidth,.8*\halfheight);}}

\pgfdeclareshape{lens}{
    \savedanchor\centerpoint{\pgf@x=0cm \pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=.05cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.3cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{south}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgfmathsetlength\pgf@y{-1.2*\halfheight-.2cm}}
    \anchorborder{\centerpoint}
    \backgroundpath{
        \draw(0,-1.2*\halfheight)--(0,-\halfheight)(0,\halfheight)--(0,1.2*\halfheight)(-\halfwidth,-\halfheight)rectangle(\halfwidth,\halfheight);}}

\pgfdeclareshape{lollipop}{
    \savedanchor\centerpoint{\pgf@x=0cm \pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=.1cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.3cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{south}{
        \pgf@process\halfheight
        \pgf@process\halfwidth
        \pgf@x=0cm
        \pgfmathsetlength\pgf@y{-\halfheight-\halfwidth-.2cm}}
    \anchorborder{\centerpoint}
    \backgroundpath{
        \draw[ultra thick](0,0)--(0,-\halfheight);
        \filldraw[fill=white](0,-\halfheight)circle(\halfwidth);}}

\pgfdeclareshape{皿}{
    \savedanchor\centerpoint{\pgf@x=0cm \pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=1cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.3cm
        \pgfmathsetlength\pgf@xa{.5\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{north}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgf@y=.2cm\advance\pgf@y by\halfheight}
    \anchor{south}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgf@y=-.2cm\advance\pgf@y by-\halfheight}
    \backgroundpath{
        \draw(-\halfwidth,-\halfheight)rectangle(\halfwidth,\halfheight)(-.8*\halfwidth,-1.2*\halfheight)--(-.8*\halfwidth,1.2*\halfheight)(-.4*\halfwidth,-1.2*\halfheight)--(-.4*\halfwidth,1.2*\halfheight)(0,-1.2*\halfheight)--(0,1.2*\halfheight)(.4*\halfwidth,-1.2*\halfheight)--(.4*\halfwidth,1.2*\halfheight)(.8*\halfwidth,-1.2*\halfheight)--(.8*\halfwidth,1.2*\halfheight);}}

    \begin{tikzpicture}
        \node(sl1)at(2,2)[slits]{};
        \node(st1)at(3,2)[steerer]{};
        \node(le1)at(5,2)[lens]{};
        \node(lo1)at(6,2)[lollipop]{};
        \node(皿1)at(4,0)[皿]{};
        \draw(sl1.north)node{$6$};
        \draw(st1.north)node{$10$};
        \draw(le1.south)node{$5$};
        \draw(lo1.south)node{$8$};
        \draw(皿1.north)node{$2$};
        \draw(皿1.south)node{$3$};
    \end{tikzpicture}

\end{document}
1
  • Thank you very much! I've managed to draw shape 8 by my self!!! Would you mind editing your answer in order to give the completed image, when it will be finished or shall I put it in the question?
    – Thanos
    Aug 31, 2014 at 12:30
6

I should not do it for you but... just to illustrate that everything is possible. I added a new answer instead of editing the existing one because the source code is now much longer and contains ugly manipulations. Beware that I modified some \pgfdeclareshape's.

\documentclass[a4,landscape]{article}
\usepackage{tikz}
\begin{document}
\makeatletter

\pgfdeclareshape{slit}{
    \savedanchor\centerpoint{\pgf@x=0cm\pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=.25cm
        \pgfmathsetlength\pgf@xa{.5*\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.25cm
        \pgfmathsetlength\pgf@xa{.5*\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{north}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgf@y=.2cm\advance\pgf@y by\halfheight}
    \anchorborder{\centerpoint}
    \backgroundpath{
        \draw[rounded corners=.1cm](-\halfwidth,-\halfheight)rectangle(\halfwidth,\halfheight);
        \draw[rounded corners=.04cm](-.8*\halfwidth,-.4*\halfheight)rectangle(.8*\halfwidth,-.8*\halfheight)(-.8*\halfwidth,.4*\halfheight)rectangle(.8*\halfwidth,.8*\halfheight);}}

\pgfdeclareshape{red slit}{
    \savedanchor\centerpoint{\pgf@x=0cm\pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=.25cm
        \pgfmathsetlength\pgf@xa{.5*\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.25cm
        \pgfmathsetlength\pgf@xa{.5*\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{north}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgf@y=.2cm\advance\pgf@y by\halfheight}
    \anchorborder{\centerpoint}
    \backgroundpath{
        \draw[rounded corners=.1cm,fill=white](-\halfwidth,-\halfheight)rectangle(\halfwidth,\halfheight);
        \draw[rounded corners=.04cm,fill=red](-.8*\halfwidth,-.4*\halfheight)rectangle(.8*\halfwidth,-.8*\halfheight)(-.8*\halfwidth,-.2*\halfheight)rectangle(.8*\halfwidth,.2*\halfheight)(-.8*\halfwidth,.4*\halfheight)rectangle(.8*\halfwidth,.8*\halfheight);}}

\pgfdeclareshape{lens}{
    \savedanchor\centerpoint{\pgf@x=0cm\pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=.05cm
        \pgfmathsetlength\pgf@xa{.5*\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.2cm
        \pgfmathsetlength\pgf@xa{.5*\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{south}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgfmathsetlength\pgf@y{-1.5*\halfheight-.2cm}}
    \anchorborder{\centerpoint}
    \backgroundpath{
        \draw[fill=white](0,-1.5*\halfheight)--(0,-\halfheight)(0,\halfheight)--(0,1.5*\halfheight)(-\halfwidth,-\halfheight)rectangle(\halfwidth,\halfheight);}}

\pgfdeclareshape{lollipop}{
    \savedanchor\centerpoint{\pgf@x=0cm\pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=.1cm
        \pgfmathsetlength\pgf@xa{.5*\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.3cm
        \pgfmathsetlength\pgf@xa{.5*\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{south}{
        \pgf@process\halfheight
        \pgf@process\halfwidth
        \pgf@x=0cm
        \pgfmathsetlength\pgf@y{-\halfheight-\halfwidth-.2cm}}
    \anchorborder{\centerpoint}
    \backgroundpath{
        \draw[ultra thick](0,0)--(0,-\halfheight);
        \draw[fill=white](0,-\halfheight)circle(\halfwidth);}}

\pgfdeclareshape{皿}{
    \savedanchor\centerpoint{\pgf@x=0cm\pgf@y=0cm}
    \saveddimen\halfwidth{
        \pgf@x=.3cm
        \pgfmathsetlength\pgf@xa{.5*\pgfkeysvalueof{/pgf/minimum width}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \saveddimen\halfheight{
        \pgf@x=.1cm
        \pgfmathsetlength\pgf@xa{.5*\pgfkeysvalueof{/pgf/minimum height}}
        \ifdim\pgf@x<\pgf@xa\pgf@x=\pgf@xa\fi}
    \anchor{center}\centerpoint
    \anchor{north}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgf@y=.2cm\advance\pgf@y by\halfheight}
    \anchor{south}{
        \pgf@process\halfheight
        \pgf@x=0cm
        \pgf@y=-.2cm\advance\pgf@y by-\halfheight}
    \backgroundpath{
        \draw[fill=white](-\halfwidth,-\halfheight)rectangle(\halfwidth,\halfheight)(-.8*\halfwidth,-1.5*\halfheight)--(-.8*\halfwidth,1.5*\halfheight)(-.4*\halfwidth,-1.5*\halfheight)--(-.4*\halfwidth,1.5*\halfheight)(0,-1.5*\halfheight)--(0,1.5*\halfheight)(.4*\halfwidth,-1.5*\halfheight)--(.4*\halfwidth,1.5*\halfheight)(.8*\halfwidth,-1.5*\halfheight)--(.8*\halfwidth,1.5*\halfheight);}}

\tikzset{steers/.style={fill=white,draw,shape=rectangle,rounded corners=.1cm}}

    \hspace{-5cm}\begin{tikzpicture}
        % grid
        \draw[step=.2cm](-10.4,2.1)grid(-6.6,3.3)(-6,2.7)node{1};
        % slits
        \path[slit,minimum height=.9cm,minimum width=.9cm](-6.5,0)node(sl){}(5.5,0)node{}(8,-2)node[rotate=90]{};
        % lollipops
        \path[lollipop,minimum height=.8cm](-8-1.7320508*.6,.6)node[rotate=150]{}(-8-1.7320508*.6,-.6)node[rotate=30]{};
        \path[lollipop,minimum height=1.3cm,minimum width=.4cm](-3.9,0)node(lo){}(2.3,0)node{}(6.6,0)node[rotate=180]{}(8,-3.1)node[rotate=270]{};
        % The main tubes (is that tube or something? whatever...)
        \draw[thick,double,double distance=.1cm](-9.7320508,-1)--(-8,0)--(-9.7320508,1);
        \draw[thick,double,double distance=.2cm,rounded corners=.4cm](-8,0)-|(8,-5);
        \draw[thick,double,double distance=.3cm,rounded corners=.4cm,line cap=rect](7.1,0)-|node[shift={(.2,.2)}]{11}(8,-.6);
        % rays
        \draw[thick,double,double distance=.1cm,line cap=rect](8,-5.5)--+(-40:3.5)+(0,0)--+(-70:3.5)+(0,0)--+(-110:3.5)+(0,0)--+(-130:3.5)+(0,0)--+(-150:3.5);
        \draw[fill=white](8,-5.5)+(-70:3.5)circle(.4)node[shift={(.5,.5)}]{13};
        % red slits
        \path[red slit,minimum height=.9cm,minimum width=.9cm](3,0)node(re){}(8,-4.3)node[rotate=90]{};
        % lens
        \path[lens](-8-1.7320508*.5,.5)node[rotate=-30]{}(-8-1.7320508*.5,-.5)node[rotate=30]{};
        \path[lens,minimum height=.3cm,minimum width=.1cm](-7.3,0)node(le){}(-4.3,0)node{};
        % 皿s
        \path[皿,minimum height=.4cm,minimum width=1.2cm](-9.7320508,1)node(皿1)[rotate=-30]{}(-9.7320508,-1)node(皿2)[rotate=30]{};
        % steers
        \path(-5.3,0)node[steers](st){\phantom{(}}++(.1,.5)node{7}(4.2,0)node[steers]{\phantom{)}};
        % tank
        \draw[fill=white](-1.8,1.3)--(-3.6,.7)--(-3.6,-.7)--(-1.8,-1.3)rectangle node[shift={(0,1.6)}]{9}(.1,1.3)--(1.9,.7)--(1.9,-.7)--(.1,-1.3);
        % inflector
        \draw[fill=white](-8,0)+(-.1,-.3)--+(-.1,.3)--+(-.3,.3)--+(-.4,.1)--+(-.4,-.1)--+(-.3,-.3)--+(0,-.3)--+(.1,-.1)--+(.1,.1)--+(-.1,.3)node[above]{4};
        % switcher
        \draw[fill=white](8,-5)+(-.5,-.6)--+(.5,-.6)..controls+(.3,-.4)and+(-.3,-.4)..+(-.5,-.6)--+(-.3,0)--+(.3,0)--+(.5,-.6)node[above right]{12};
        % black thick
        \draw[line width=.17cm](3,-5.6)--(6.9,-5.6)arc[start angle=-180,end angle=0,
x radius=1.1cm,y radius=.9cm]--(10.7,-5.6)(8,-6.5)--(8,-10.5);
        % left labels
        \path(sl.north)node{6}(lo.south)node{8}(re.north)node{10}(le.south)node{5}(皿1.north)node{2}(皿2.south)node{3};
    \end{tikzpicture}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .