Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to draw a nuclear reactor. In texamples.net there is a template which is pretty much what I would like to do. The code is

% Pressurized Water Reactor
% Author: Gloria Faccanoni <http://www.science.unitn.it/~gloria/home.htm>
%
\documentclass[a4paper,10pt,landscape]{article}
%\usepackage[latin1]{inputenc}
\usepackage[Gray]{SIunits}
\usepackage[dvipsnames,pdftex,fixpdftex]{xcolor}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usepackage[hmargin=1cm,vmargin=1cm]{geometry}
\begin{document}
\centering
\begin{tikzpicture}[
        scale=0.7,
        annotline/.style = {stealth-},
        arrows1loop/.style={->,red},
        arrows2loop/.style={->,white},
        arrows3loop/.style={->,draw=Gray},
    ]
\draw[draw=Gray,double=Gray!10,double distance=4pt]
    (12,12) to[out=135,in=45](0,12)--(0,0)--(22,0)--(22,12)--(12,12)--(12,0);
\node[text width=4cm, text centered,font=\small] at (6,13)
    {Containment\\structure};
% legend
\begin{scope}[yshift=-2cm]
    \filldraw[draw=red,fill=red!10] (1,0) rectangle ++(2,1);
    \node[text width=4cm, font=\small,right] at (3,0.5)
        {Pressurized water\\(primary loop)};
    \filldraw[draw=blue,bottom color=blue!40,top color=Gray!30]
        (11,0) rectangle ++(2,1);
    \node[text width=4cm, font=\small,right] at (13,0.5)
        {Water and steam\\(secondary loop)};
    \filldraw[draw=Blue,fill=Blue!10] (21,0) rectangle ++(2,1);
    \node[text width=4cm, font=\small,right] at (23,0.5)
        {Water\\(cooling loop)};
\end{scope}
% 2nd loop --------------------------------------------------------------------
\begin{scope}[xshift=7.25cm,yshift=3cm]
    % vessel left
    \filldraw[draw=blue,bottom color=blue!40,top color=Gray!30]
        (0,0) to[out=-20,in=200] (3.5,0) --
        (3.5,4.5) to[out=120,in=60] (0,4.5) -- (0,0);
    % vessel right
    \filldraw[draw=blue,bottom color=blue!40,top color=Gray!30,xshift=7cm]
        (0,0) to[out=-20,in=200] (3.5,0) --
        (3.5,5) to[out=120,in=60] (0,5) -- (0,0);
    % circuits
    \draw[draw=blue,double=blue!40,double distance=4pt]
      (1.75,-0.3) -- ++(0,-1) -- ++(7,0) -- ++(0,1);
    \draw[draw=blue,double=Gray!30,double distance=4pt]
        (1.75,5.38) -- ++(0,1) -- ++(4,0) -- ++(0,1) -- ++(3,0) -- ++(0,-1.5);
    % arrows
    \draw[arrows2loop] (3.5,-1.3) -- (3,-1.3);
    \draw[arrows2loop] (1.75,-0.9) -- (1.75,-0.4);
    \draw[arrows2loop] (4.5,6.38) -- (5,6.38);
    \draw[arrows2loop] (7,7.38) -- (7.5,7.38);
    \draw[arrows2loop] (8.75,6.4) -- (8.75,5.9);
    \draw[arrows2loop] (8.75,-0.4) -- (8.75,-0.9);
    %
    \foreach \x in {0.5,1,...,3}
        \draw[arrows2loop,xshift=7cm] (\x,3) -- (\x,2.5);
    % labels
    \draw[annotline] (2.5,-1.3) -- ++(3.5,1.3)
        node[text width=1cm,font=\small,above] {Liquid};
    \draw[annotline] (2.5,6.38) -- ++(3.5,-1.3)
        node[text width=1cm,font=\small,below] {Vapor};
    % pump
    \begin{scope}[xshift=160,yshift=-40]
        \filldraw[fill=Blue!20,draw=Blue] (0,0) circle (0.5cm);
        \node[below,font=\small] at (0,-0.5) {Pump};
        \filldraw[fill=Blue!40,draw=Blue,yshift=-0.5cm]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
        \filldraw[fill=Blue!40,draw=Blue,yshift=+0.5cm,rotate=180]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
        \filldraw[fill=Blue!40,draw=Blue,xshift=+0.5cm,rotate=90]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
        \filldraw[fill=Blue!40,draw=Blue,xshift=-0.5cm,rotate=-90]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
    \end{scope}
    % generator ...
    \draw[xshift=6.5cm,draw=Gray,double=Gray!10,double distance=4pt] 
        (3,4) -- ++(2,0);
    \filldraw[xshift=6.5cm,fill=orange!10,draw=orange] 
        (1.8,4) -- (3.0,3.3) -- (3.0,4.7) -- cycle;
    \filldraw[xshift=6.5cm,fill=orange!10,draw=orange] 
        (1.5,4) -- (2.5,3.4) -- (2.5,4.6) -- cycle;
    \filldraw[xshift=6.5cm,fill=orange!10,draw=orange] 
        (1.2,4) -- (2  ,3.5) -- (2  ,4.5) -- cycle;
    \filldraw[xshift=6.5cm,fill=orange!10,draw=orange] 
        (4.5,3.3) rectangle (7.3,4.7);
    %labels
    \node[text width=3cm, text centered,font=\small] at (1.75,4) 
        {Steam generator\\ (heat change)};
    \node[text width=2cm, text centered,font=\small] at (8.8,5) {Turbine};
    \node[text width=2cm, text centered,font=\small] at (12.4,4) {Alternator};
    % transmission lines
    \node (aa) at (11.1,4.6) {};
    \node (bb) at (11.6,4.6) {};
    \node (cc) at (12.1,4.6) {};
    \node (dd) at (12.6,4.6) {};
    \node (ee) at (13.1,4.6) {};
    \node (ff) at (13.6,4.6) {};

\end{scope}
% 3 loop --------------------------------------------------------------------
\begin{scope}[xshift=23cm,yshift=1cm]
    % circuit
    \draw[draw=Blue,double=Blue!10,double distance=4pt]
      (1,2.5) -- ++(-8.5,0) -- ++(0,+1.5) -- ++(8.5,0);
    % arrows
    \draw[arrows3loop] (-5.5,2.5) -- (-6,2.5);
    \draw[arrows3loop] (-1.5,2.5) -- (-2,2.5);
    \draw[arrows3loop] (-6,4) -- (-5.5,4);
    \draw[arrows3loop] (-2,4) -- (-1.5,4);
    % tower
    \filldraw[draw=Gray,fill=Gray!20] (1,7) to[out=270,in=80]
                  (0,0) to[out=-20,in=200]
                  (6,0) to[out=100,in=270]
                  (5,7);
    \filldraw[draw=Gray,fill=Gray!40] (1,7) to[out=30,in=150]
                  (5,7) to[out=200,in=-20]
                  (1,7);
    % labels
    \node[text width=3cm, text centered,font=\small] at (3,3.5)
        {Cooling\\tower};
    \node[text width=2cm, text centered,font=\small] at (-3.5,1.5)
        {Cooling\\water};
    \node[text width=2cm, text centered,font=\small] at (-6,3.25)
        {Condenser};
    % pump
    \begin{scope}[xshift=-10,yshift=115]
        \filldraw[fill=purple!20,draw=purple] (0,0) circle (0.5cm);
        \node[below,font=\small] at (0,-0.5) {Pump};
        \filldraw[fill=purple!40,draw=purple,yshift=-0.5cm]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
        \filldraw[fill=purple!40,draw=purple,yshift=+0.5cm,rotate=180]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
        \filldraw[fill=purple!40,draw=purple,xshift=+0.5cm,rotate=90]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
        \filldraw[fill=purple!40,draw=purple,xshift=-0.5cm,rotate=-90]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
    \end{scope}
\end{scope}
%1 loop --------------------------------------------------------------------
\begin{scope}[xshift=2cm,yshift=4cm]
% Reactor vessel
\filldraw[draw=red,fill=red!10] (0,-0.5) to[out=-20,in=200]
              (3.5,-0.5) --
              (3.5,4.5) to[out=160,in=20]
              (0,4.5) --
              (0,-0.5);
% circuit
\draw[draw=red,double=red!10,double distance=4pt]
  (0.1,1) --  ++(-1,0) -- ++(0,-3) -- ++(5,0) -- ++(0,1.5) --
  ++(3,0) -- ++(0,2) -- ++(-3.7,0);
% Pressurizer
\draw[draw=red,double=red!10,double distance=4pt] (4.2,1.6) -- ++(0,0.8);
\filldraw[draw=Green,bottom color=red!40,top color=Green!20]
              (4,2.4) to[out=-20,in=200]
              (4.5,2.4) --
              (4.5,3.6) to[out=160,in=20]
              (3.9,3.6) --
              (3.9,2.4);
% arrows
\draw[arrows1loop] (-0.7,1) -- (-0.2,1);
\draw[arrows1loop] (-0.9,-0.5) -- (-0.9,0);
\draw[arrows1loop] (0.7,-2) -- (0.2,-2);
\draw[arrows1loop] (4.5,1.5) -- (5,1.5);
\draw[arrows1loop] (7.1,0.5) -- (7.1,0);
\draw[arrows1loop] (5.5,-0.5) -- (5,-0.5);

% pump
\begin{scope}[xshift=75,yshift=-55,fill=red!20,draw=red]
    \filldraw (0,0) circle (0.5cm);
    \node[below,font=\small] at (0,-0.5) {Pump};
    \filldraw[yshift=-0.5cm] (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
    \filldraw[yshift=+0.5cm,rotate=180]
        (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
    \filldraw[xshift=+0.5cm,rotate=90]
        (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
    \filldraw[xshift=-0.5cm,rotate=-90]
        (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
\end{scope}
% reactor core
\filldraw[fill=red!30,draw=red] (0.7,0) rectangle (2.8,2);

% control rods
\foreach \x in {1.0,1.5,2.0,2.5}
  \draw[draw=Gray,double=Gray!50,double distance=0.5pt] (\x,0.3) -- (\x,3.7);

%labels
\draw[annotline] (0.6,0.5) -- ++(-3.3,-1.5)
    node[text width=1cm,font=\small,left] {Reactor core};
\node[text width=2cm, text centered,font=\small] at (1.75,5.4) {Reactor vessel};
\draw[annotline] (0.9,2.8) -- ++(-3.3,1.5)
    node[text width=2cm, text centered,font=\small,left=-8pt] {Control\\rods};
\draw[annotline] (4.2,3.7) -- ++(0.5,1.5)
    node[text width=2cm, text centered,font=\small,above] {Pressurizer};
\draw[annotline] (3.9,1.5) -- ++(1.3,-0.6)
    node[text width=2.4cm, text centered,below=-2pt,font=\small]
        {Water coolant (\unit{330}{\degreecelsius})};
\draw[annotline] (-0.1,-2) -- ++(-0.3,-0.6)
    node[text width=2.4cm, text centered,below=-2pt,font=\small]
        {Water coolant (\unit{280}{\degreecelsius})};
\end{scope}
% clouds ----------------------------------
\begin{scope}[xshift=26cm,yshift=10cm, fill=blue!10, draw=Blue,
    decoration={bumps,segment length=0.5cm}]
    \filldraw[yshift=-1.5cm,rotate=-25,decorate]
        (0,0) -- ++(-0.4,1.25)-- ++(-0.1,0.75)-- ++(0.2,0.5)-- ++(0.3,0.5)--
        ++(0.3,-0.5)-- ++(0.2,-0.5)-- ++(-0.1,-0.75)-- ++(-0.4,-1.25);
    \filldraw[xshift=0.5cm,yshift=-2cm,rotate=-30,decorate]
        (0,0) -- ++(-0.4,1.25)-- ++(-0.1,0.75)-- ++(0.2,0.5)-- ++(0.3,0.5)--
        ++(0.3,-0.5)-- ++(0.2,-0.5)-- ++(-0.1,-0.75)-- ++(-0.4,-1.25);
    \filldraw[xshift=-1.05cm,yshift=-2.15cm,rotate=-20,decorate]
        (0,0) -- ++(-0.4,1.25)-- ++(-0.1,0.75)-- ++(0.2,0.5)-- ++(0.3,0.5)--
        ++(0.3,-0.5)-- ++(0.2,-0.5)-- ++(-0.1,-0.75)-- ++(-0.4,-1.25);
    %labels
    \node[text width=1cm, text centered,font=\small] at (0.2,1.5) {Water vapor};
\end{scope}

% palo della luce
\begin{scope}[xscale=0.2,xshift=113cm,yshift=19cm,line width=1pt,Brown]
    \draw (0,0) -- (-6,-6)
          (0,0) -- ( 6,-6)
          (-1,-1) -- ( 1,-1)
          (-1,-1) -- ( 2,-2)
          ( 1,-1) -- (-2,-2)
          (-2,-2) -- ( 2,-2)
          (-2,-2) -- ( 3,-3)
          ( 2,-2) -- (-3,-3)
          ( 3,-3) -- (-3,-3)
          (-3,-3) -- ( 4,-4)
          ( 3,-3) -- (-4,-4)
          ( 4,-4) -- (-4,-4)
          (-4,-4) -- ( 5,-5)
          ( 4,-4) -- (-5,-5)
          ( 5,-5) -- (-5,-5)
          (-6,-6) -- ( 0,-5.2)
          ( 6,-6) -- ( 0,-5.2);
    \draw (-1.5,-1.5) -- (-4,-1.5) -- (-1,-1)
          ( 1.5,-1.5) -- ( 4,-1.5) -- ( 1,-1);
    \path (-4,-1.4) node (a) {}
          ( 4,-1.4) node (b) {};
    \draw[line width=1pt,Brown] (-3.5,-3.5) -- (-7.5,-3.5) -- (-3,-3)
                                ( 3.5,-3.5) -- ( 7.5,-3.5) -- ( 3,-3);
    \path (-7.5,-3.4) node (c) {}
          ( 7.5,-3.4) node (d) {}
          (-5.5,-3.4) node (e) {}
          ( 5.5,-3.4) node (f) {};
\end{scope}
% transmission lines
\draw[dashed,Gray] (c) -- (aa)
                   (a) -- (bb)
                   (e) -- (cc)
                   (b) -- (dd)
                   (f) -- (ee)
                   (d) -- (ff);
\end{tikzpicture}

\end{document}

The output is

enter image description here

On wikipedia there is a similar image, with moving pumps, moving flows etc. enter image description here

How to do that using tikz?

share|improve this question
    
Are you asking about the general process of creating animations using TikZ? Or do you have trouble with a particular part of the drawing? –  Jake May 26 '13 at 18:33
    
@Jake: Thank you very much for your comment! I have no idea how to make it work. Somehow I think I have to use animate and calc but I don't have the foggiest on how to do it... –  Thanos May 26 '13 at 18:40
5  
Take a look at the TeXample animations page, it contains lots of examples that should get you started. –  Jake May 26 '13 at 18:42
1  
The demos on texample.net/tikz/examples/tag/animations are very nice. I see animation runs inside the PDF file. Can these animation be made to also run on a web page if one converts the latex file using htlatex to an HTML file? –  Nasser May 27 '13 at 4:44
1  
»I want to draw a nuclear reactor.« Please, for safety reasons draw a picture. –  Keks Dose May 29 '13 at 7:12

2 Answers 2

up vote 22 down vote accepted

Just a proof of concept; the flow was created with a very thick dashed line with a particular dash pattern; the illusion of movement was obtained using a different value for dash phase in even and odd slides (thanks to Jake for this suggestion that simplyfied my initial code):

\documentclass{beamer}
\usepackage{tikz}

\def\phase{0pt}

\begin{document}

\begin{frame}
\centering
\begin{tikzpicture}
\draw[orange,double=orange!60,double distance=14pt,rounded corners] (0,0) |- (6,3) -- (6,0) -- cycle;
\onslide<1-10>{
\ifodd\thepage\relax\def\phase{8pt}\fi
\draw[rounded corners,line width=8pt,dashed,blue!80!black,dash pattern={on 12pt off 6pt},dash phase=\phase] (0,0) |- (6,3) -- (6,0) -- cycle;
}
\end{tikzpicture}
\end{frame}

\end{document}

enter image description here

The animation was produced using ImageMagick and

convert -verbose -delay 50 -loop 0 -density 300 <file>.pdf <file>.gif

And here's now the idea incorporated to the actual code for the reactor; the idea is the same as with the example code above: a ten slide beamer document; the \thepage counter is used to alter the various elements and produce the illusion of movement one the animation is created. The flows are producing using a simple style:

\tikzset{
flow/.style={rounded corners,line width=1.5pt,line cap=round,dashed,draw=#1,dash pattern={on 5pt off 5pt},dash phase=\thepage}
}

The code:

% Pressurized Water Reactor
% Author: Gloria Faccanoni <http://www.science.unitn.it/~gloria/home.htm>
%
\PassOptionsToPackage{dvipsnames,pdftex,fixpdftex}{xcolor}
\documentclass{beamer}
%\usepackage[latin1]{inputenc}
\usepackage[Gray]{SIunits}
\let\square\relax

\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

\def\phase{0pt}
\def\altshift{0pt}
\def\bcolor{white!30!black}

\tikzset{
flow/.style={rounded corners,line width=1.5pt,line cap=round,dashed,draw=#1,dash pattern={on 5pt off 5pt},dash phase=\thepage}
}
\begin{document}

\begin{frame}
\centering
\begin{tikzpicture}[
        scale=0.35,transform shape,
        annotline/.style = {stealth-},
        arrows2loop/.style={->,white},
    ]
\draw[draw=Gray,double=Gray!10,double distance=4pt]
    (12,12) to[out=135,in=45](0,12)--(0,0)--(22,0)--(22,12)--(12,12)--(12,0);
\node[text width=4cm, text centered,font=\small] at (6,13)
    {Containment\\structure};
% legend
\begin{scope}[yshift=-2cm]
    \filldraw[draw=red,fill=red!10] (1,0) rectangle ++(2,1);
    \node[text width=4cm, font=\small,right] at (3,0.5)
        {Pressurized water\\(primary loop)};
    \filldraw[draw=blue,bottom color=blue!40,top color=Gray!30]
        (11,0) rectangle ++(2,1);
    \node[text width=4cm, font=\small,right] at (13,0.5)
        {Water and steam\\(secondary loop)};
    \filldraw[draw=Blue,fill=Blue!10] (21,0) rectangle ++(2,1);
    \node[text width=4cm, font=\small,right] at (23,0.5)
        {Water\\(cooling loop)};
\end{scope}
% 2nd loop --------------------------------------------------------------------
\begin{scope}[xshift=7.25cm,yshift=3cm]
    % vessel left
    \filldraw[draw=blue,bottom color=blue!40,top color=Gray!30]
        (0,0) to[out=-20,in=200] (3.5,0) --
        (3.5,4.5) to[out=120,in=60] (0,4.5) -- (0,0);
    % vessel right
    \filldraw[draw=blue,bottom color=blue!40,top color=Gray!30,xshift=7cm]
        (0,0) to[out=-20,in=200] (3.5,0) --
        (3.5,5) to[out=120,in=60] (0,5) -- (0,0);
    % circuits
    \draw[draw=blue,double=blue!40,double distance=4pt]
      (1.75,-0.3) -- ++(0,-1) -- ++(7,0) -- ++(0,1);
    \draw[draw=blue,double=Gray!30,double distance=4pt]
        (1.75,5.38) -- ++(0,1) -- ++(4,0) -- ++(0,1) -- ++(3,0) -- ++(0,-1.5);

    % arrows
    \draw[arrows2loop] (3.5,-1.3) -- (3,-1.3);
    \draw[arrows2loop] (1.75,-0.9) -- (1.75,-0.4);
    \draw[arrows2loop] (4.5,6.38) -- (5,6.38);
    \draw[arrows2loop] (7,7.38) -- (7.5,7.38);
    \draw[arrows2loop] (8.75,6.4) -- (8.75,5.9);
    \draw[arrows2loop] (8.75,-0.4) -- (8.75,-0.9);
    %
    \foreach \x in {0.5,1,...,3}
        \draw[arrows2loop,xshift=7cm] (\x,3) -- (\x,2.5);
    % labels
    \draw[annotline] (2.5,-1.3) -- ++(3.5,1.3)
        node[text width=1cm,font=\small,above] {Liquid};
    \draw[annotline] (2.5,6.38) -- ++(3.5,-1.3)
        node[text width=1cm,font=\small,below] {Vapor};
    % pump
    \begin{scope}[xshift=160,yshift=-40]
        \filldraw[fill=Blue!20,draw=Blue] (0,0) circle (0.5cm);
        \node[below,font=\small] at (0,-0.5) {Pump};
\onslide<1-10>{
\draw[Blue] (185+36*\thepage:0.5) -- (5+36*\thepage:0.5);
\draw[Blue] (95+36*\thepage:0.5) -- (275+36*\thepage:0.5);
}
    \end{scope}
\onslide<1-10>{
\draw[flow=blue,dash phase=\thepage] 
(0.5,2) -- (0.5,1) -| (1.5,0.3) -- (1.75,-0.3) -- ++(0,-1) -- ++(7,0) -- ++(0,1);
\draw[flow=blue] 
(3,2) -- (3,1) -| (2,0.3) -- (1.75,-0.3);
}

    % generator ...
    \draw[xshift=6.5cm,draw=Gray,double=Gray!10,double distance=4pt] 
        (3,4) -- ++(2,0);
    \filldraw[xshift=6.5cm,fill=orange!10,draw=orange] 
        (1.8,4) -- (3.0,3.3) -- (3.0,4.7) -- cycle;
    \filldraw[xshift=6.5cm,fill=orange!10,draw=orange] 
        (1.5,4) -- (2.5,3.4) -- (2.5,4.6) -- cycle;
    \filldraw[xshift=6.5cm,fill=orange!10,draw=orange] 
        (1.2,4) -- (2  ,3.5) -- (2  ,4.5) -- cycle;
    \filldraw[xshift=6.5cm,fill=orange!10,draw=orange] 
        (4.5,3.5) rectangle (7.3,4.5);
    \coordinate[xshift=6.5cm] (alta) at (7.3,4.5);
    \coordinate[xshift=6.5cm] (altb) at (7.3,3.5);
\onslide<1-10>{
\ifodd\thepage\relax\else\def\altshift{-3pt}\fi
  \draw[orange,xshift=6.5cm,yshift=-7pt+\altshift] (4.5,4.6) -- (7.3,4.6);
  \draw[orange,xshift=6.5cm,yshift=-15pt+\altshift] (4.5,4.6) -- (7.3,4.6);
  \draw[orange,xshift=6.5cm,yshift=-23pt+\altshift] (4.5,4.6) -- (7.3,4.6);
}
    %labels
    \node[text width=3cm, text centered,font=\small] at (1.75,4) 
        {Steam generator\\ (heat change)};
    \node[text width=2cm, text centered,font=\small] at (8.8,5) {Turbine};
    \node[text width=2cm, text centered,font=\small] at (12.4,4) {Alternator};
    % transmission lines
    \node (aa) at (11.1,4.6) {};
    \node (bb) at (11.6,4.6) {};
    \node (cc) at (12.1,4.6) {};
    \node (dd) at (12.6,4.6) {};
    \node (ee) at (13.1,4.6) {};
    \node (ff) at (13.6,4.6) {};

\end{scope}
% 3 loop --------------------------------------------------------------------
\begin{scope}[xshift=23cm,yshift=1cm]
    % circuit
    \draw[draw=Blue,double=Blue!10,double distance=4pt]
      (1,2.5) -- ++(-8.5,0) -- ++(0,+1.5) -- ++(8.5,0);
    % labels
    \node[text width=2cm, text centered,font=\small] at (-3.5,1.5)
        {Cooling\\water};
    \node[text width=2cm, text centered,font=\small] at (-6,3.25)
        {Condenser};
    % pump
    \begin{scope}[xshift=-10,yshift=115]
        \filldraw[fill=Blue!20,draw=Blue] (0,0) circle (0.5cm);
        \node[below,font=\small] at (0,-0.5) {Pump};
\onslide<1-10>{
\draw[Blue] (185+36*\thepage:0.5) -- (5+36*\thepage:0.5);
\draw[Blue] (95+36*\thepage:0.5) -- (275+36*\thepage:0.5);
}
    \end{scope}
\onslide<1-10>{
\draw[flow=Blue!70] (1,2.5) -- ++(-8.5,0) -- ++(0,+1.5) -- ++(8.5,0);
}
    % tower
    \filldraw[draw=Gray,fill=Gray!20] (1,7) to[out=270,in=80]
                  (0,0) to[out=-20,in=200]
                  (6,0) to[out=100,in=270]
                  (5,7);
    \filldraw[draw=Gray,fill=Gray!40] (1,7) to[out=30,in=150]
                  (5,7) to[out=200,in=-20]
                  (1,7);
    % labels
    \node[text width=3cm, text centered,font=\small] at (3,3.5)
        {Cooling\\tower};
\end{scope}

%1 loop --------------------------------------------------------------------
\begin{scope}[xshift=2cm,yshift=4cm]
% Reactor vessel
\filldraw[draw=red,fill=red!10] (0,-0.5) to[out=-20,in=200]
              (3.5,-0.5) --
              (3.5,4.5) to[out=160,in=20]
              (0,4.5) --
              (0,-0.5);
% circuit
\draw[draw=red,double=red!10,double distance=4pt]
  (0.1,1) --  ++(-1,0) -- ++(0,-3) -- ++(5,0) -- ++(0,1.5) --
  ++(3,0) -- ++(0,2) -- ++(-3.7,0);

% Pressurizer
\draw[draw=red,double=red!10,double distance=4pt] (4.2,1.6) -- ++(0,0.8);
\filldraw[draw=Green,bottom color=red!40,top color=Green!20]
              (4,2.4) to[out=-20,in=200]
              (4.5,2.4) --
              (4.5,3.6) to[out=160,in=20]
              (3.9,3.6) --
              (3.9,2.4);

% pump
\begin{scope}[xshift=75,yshift=-55,fill=red!20,draw=red]
    \filldraw (0,0) circle (0.5cm);
    \node[below,font=\small] at (0,-0.5) {Pump};
\onslide<1-10>{
\draw[red] (185+36*\thepage:0.5) -- (5+36*\thepage:0.5);
\draw[red] (95+36*\thepage:0.5) -- (275+36*\thepage:0.5);
}
\end{scope}
% reactor core
\filldraw[fill=red!30,draw=red] (0.7,0) rectangle (2.8,2);

% control rods
\foreach \x in {1.0,1.5,2.0,2.5}
  \draw[draw=Gray,double=Gray!50,double distance=0.5pt] (\x,0.3) -- (\x,3.7);
\onslide<1-10>{
\draw[flow=red] 
(0.1,1) --  ++(-1,0) -- ++(0,-3) -- ++(5,0) -- ++(0,1.5) --
  ++(3,0) -- ++(0,2) -- ++(-4,0) --  ++(0,2.5) -- ++(-0.8,0) -- ++(0,-4.3) -- 
  ++(-0.55,0) --  ++(0,4.3) -- ++(-0.55,0) --  ++(0,-4.3) -- 
  ++(-0.7,0) -- ++(0,1.3) -- ++(-0.15,0);
}

%labels
\draw[annotline] (0.6,0.5) -- ++(-3.3,-1.5)
    node[text width=1cm,font=\small,left] {Reactor core};
\node[text width=2cm, text centered,font=\small] at (1.75,5.4) {Reactor vessel};
\draw[annotline] (0.9,2.8) -- ++(-3.3,1.5)
    node[text width=2cm, text centered,font=\small,left=-8pt] {Control\\rods};
\draw[annotline] (4.2,3.7) -- ++(0.5,1.5)
    node[text width=2cm, text centered,font=\small,above] {Pressurizer};
\draw[annotline] (3.9,1.5) -- ++(1.3,-0.6)
    node[text width=2.4cm, text centered,below=-2pt,font=\small]
        {Water coolant (\unit{330}{\degreecelsius})};
\draw[annotline] (-0.1,-2) -- ++(-0.3,-0.6)
    node[text width=2.4cm, text centered,below=-2pt,font=\small]
        {Water coolant (\unit{280}{\degreecelsius})};
\end{scope}

% palo della luce
\begin{scope}[xscale=0.2,xshift=128cm,yshift=16cm,line width=1pt,Brown]
    \draw (0,0) -- (-6,-6)
          (0,0) -- ( 6,-6)
          (-1,-1) -- ( 1,-1)
          (-1,-1) -- ( 2,-2)
          ( 1,-1) -- (-2,-2)
          (-2,-2) -- ( 2,-2)
          (-2,-2) -- ( 3,-3)
          ( 2,-2) -- (-3,-3)
          ( 3,-3) -- (-3,-3)
          (-3,-3) -- ( 4,-4)
          ( 3,-3) -- (-4,-4)
          ( 4,-4) -- (-4,-4)
          (-4,-4) -- ( 5,-5)
          ( 4,-4) -- (-5,-5)
          ( 5,-5) -- (-5,-5)
          (-6,-6) -- ( 0,-5.2)
          ( 6,-6) -- ( 0,-5.2);
    \draw (-1.5,-1.5) -- (-4,-1.5) -- (-1,-1)
          ( 1.5,-1.5) -- ( 4,-1.5) -- ( 1,-1);
    \path (-4,-1.4) node (a) {}
          ( 4,-1.4) node (b) {};
    \path (-7.5,-3.4) node (c) {}
          ( 7.5,-3.4) node (d) {}
          (-5.5,-3.4) node (e) {}
          ( 5.5,-3.4) node (f) {};
\end{scope}
% transmission lines (alternator-tower)
\draw[Gray]
                   (alta) to[out=30,in=260] (a)
                   (altb) to[out=30,in=260] (b);

% building
\begin{scope}[xscale=0.2,xshift=100cm,yshift=17cm]
\filldraw (-3.5,0) rectangle (0.6,2);
\onslide<1-10>{
\ifnum\thepage<7\relax
\else
\ifnum\thepage=7\relax
  \def\bcolor{white!50!black}
\else\ifnum\thepage=8\relax
  \def\bcolor{white!80!black}
\else\ifnum\thepage<11\relax
  \def\bcolor{white!97!black}
\fi\fi\fi\fi
\foreach \piso in {0.1,0.5,...,1.7}
  {
  \filldraw[\bcolor] (-3.05,\piso) rectangle (-2,\piso+0.2);
  \filldraw[\bcolor] (-1.15,\piso) rectangle (0.1,\piso+0.2);
  }
}
% transmission lines (tower-building)
\draw[Gray]
                   (a) to[out=185,in=-20] (-0.7,0)
                   (b) to[out=182,in=-20] (0.6,0);
\end{scope}
\end{tikzpicture}
\end{frame}

\end{document}

enter image description here

share|improve this answer
1  
@Jake great suggestion! This also allowed me to simplify the code. Thank you! –  Gonzalo Medina May 27 '13 at 2:23
    
Thank you very much for your answer! I used your code and I saw that the pdf file has 10 slides. I supposse that's where the ImakeMagik comes... What's this? Is it a programm? I searched for it but I wasn't able to find anything... Only the ImageMaker or perhaps Imagemagick which is imagemagick.org/script/index.php –  Thanos May 27 '13 at 6:33
1  
@Jake Thanks! You're right about the need for more than two steps; however, I am a little tired for today with this code, so I will make the changes tomorrow. –  Gonzalo Medina May 28 '13 at 0:28
1  
@Jake I made a little change and I hope now it looks better; there's still some improvement that could be done when the animation loops, but I think I am gonna leave the code as it is now. –  Gonzalo Medina May 28 '13 at 1:23
1  
@Thanos You're welcome! I made yet another update; now the flow transition is smooth when the animation loops. –  Gonzalo Medina May 29 '13 at 0:06

I used your question to finally try out the animate package. The "animation" is in an external file, it uses the standalone package and the markings decoration of tikz:

"Animation" code

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{decorations.markings}

\begin{document}

\tikzset{reddot/.style={decoration={markings, mark=between positions #1 and 1 step 0.01 with {\fill[red] circle(0.05);}}}}

\foreach \x in {0,1,...,9}
{   \begin{tikzpicture}
        \filldraw[yellow!10,draw=yellow!50!black] (-1,-7) rectangle node[yellow!50!black] {reactor} (7,3);
        \draw[reddot=\x/1000,postaction={decorate}]  (0,0) -- (4,0) -- (6,2) -- (6,-4) arc (360:180:2) -- (0,-3) -- cycle;
    \end{tikzpicture}
}

\end{document}

Then I used this "animation" consisting of 10 single pages in a PDF file (anim.pdf) to put it in the real document:

Document code

\documentclass{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{lipsum}
\usepackage{animate}

\begin{document}

\lipsum[1-2]

\begin{center}
    \begin{figure}[htp]
        \animategraphics[autoplay,loop]{10}{anim}{}{}
        \caption{reactor cycle}
    \end{figure}
\end{center}

\lipsum[3-4]

\end{document}

Output

(this is a picture created with ImageMagick, as one can't upload PDFs)

enter image description here


Edit 1: Editing the given code is quite easy, I did it for loop 1, the reactor loop. The path to be animated is labeled circuit. All I did was:

  • copy the circuit code, to use it once for the pipes and once for the flow (one could also use just one and add the flow as a postaction)
  • add a little rounded corners to make it look nicer
  • comment out all the arrows
  • I decided to use 10 pictures, so I added a foreach loop outside the picture
  • changed class to standalone
  • got rid of the capitalized colors (e.g. Green) as I got a package option clash for xcolor
  • replaced SIunits with siunitx
  • used textcomp for Celsius symbol (one could also use e.g. \SI{42}{\celsius})
  • used Jake's suggestion

The dash pattern I used is 6pt long (4pt on + 2pt off), so I set the dash phase to \x/10*6pt. This way the dashes will be shifted 0%,10%,...,90% of one cycle letting the animation be smooth.

"Animation" code

% Pressurized Water Reactor
% Author: Gloria Faccanoni <http://www.science.unitn.it/~gloria/home.htm>
%
\documentclass[tikz]{standalone}
\usepackage{siunitx}
\usetikzlibrary{decorations.pathmorphing}
\usepackage{textcomp}

\begin{document}
\foreach \x in {0,...,9}
{
\begin{tikzpicture}[
        scale=0.7,
        annotline/.style = {stealth-},
        arrows1loop/.style={->,red},
        arrows2loop/.style={->,white},
        arrows3loop/.style={->,draw=gray},
    ]
\draw[draw=gray,double=gray!10,double distance=4pt]
    (12,12) to[out=135,in=45](0,12)--(0,0)--(22,0)--(22,12)--(12,12)--(12,0);
\node[text width=4cm, text centered,font=\small] at (6,13)
    {Containment\\structure};
% legend
\begin{scope}[yshift=-2cm]
    \filldraw[draw=red,fill=red!10] (1,0) rectangle ++(2,1);
    \node[text width=4cm, font=\small,right] at (3,0.5)
        {Pressurized water\\(primary loop)};
    \filldraw[draw=blue,bottom color=blue!40,top color=gray!30]
        (11,0) rectangle ++(2,1);
    \node[text width=4cm, font=\small,right] at (13,0.5)
        {Water and steam\\(secondary loop)};
    \filldraw[draw=blue,fill=blue!10] (21,0) rectangle ++(2,1);
    \node[text width=4cm, font=\small,right] at (23,0.5)
        {Water\\(cooling loop)};
\end{scope}
% 2nd loop --------------------------------------------------------------------
\begin{scope}[xshift=7.25cm,yshift=3cm]
    % vessel left
    \filldraw[draw=blue,bottom color=blue!40,top color=gray!30]
        (0,0) to[out=-20,in=200] (3.5,0) --
        (3.5,4.5) to[out=120,in=60] (0,4.5) -- (0,0);
    % vessel right
    \filldraw[draw=blue,bottom color=blue!40,top color=gray!30,xshift=7cm]
        (0,0) to[out=-20,in=200] (3.5,0) --
        (3.5,5) to[out=120,in=60] (0,5) -- (0,0);
    % circuits
    \draw[draw=blue,double=blue!40,double distance=4pt]
      (1.75,-0.3) -- ++(0,-1) -- ++(7,0) -- ++(0,1);
    \draw[draw=blue,double=gray!30,double distance=4pt]
        (1.75,5.38) -- ++(0,1) -- ++(4,0) -- ++(0,1) -- ++(3,0) -- ++(0,-1.5);
    % arrows
    \draw[arrows2loop] (3.5,-1.3) -- (3,-1.3);
    \draw[arrows2loop] (1.75,-0.9) -- (1.75,-0.4);
    \draw[arrows2loop] (4.5,6.38) -- (5,6.38);
    \draw[arrows2loop] (7,7.38) -- (7.5,7.38);
    \draw[arrows2loop] (8.75,6.4) -- (8.75,5.9);
    \draw[arrows2loop] (8.75,-0.4) -- (8.75,-0.9);
    %
    \foreach \x in {0.5,1,...,3}
        \draw[arrows2loop,xshift=7cm] (\x,3) -- (\x,2.5);
    % labels
    \draw[annotline] (2.5,-1.3) -- ++(3.5,1.3)
        node[text width=1cm,font=\small,above] {Liquid};
    \draw[annotline] (2.5,6.38) -- ++(3.5,-1.3)
        node[text width=1cm,font=\small,below] {Vapor};
    % pump
    \begin{scope}[xshift=160,yshift=-40]
        \filldraw[fill=blue!20,draw=blue] (0,0) circle (0.5cm);
        \node[below,font=\small] at (0,-0.5) {Pump};
        \filldraw[fill=blue!40,draw=blue,yshift=-0.5cm]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
        \filldraw[fill=blue!40,draw=blue,yshift=+0.5cm,rotate=180]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
        \filldraw[fill=blue!40,draw=blue,xshift=+0.5cm,rotate=90]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
        \filldraw[fill=blue!40,draw=blue,xshift=-0.5cm,rotate=-90]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
    \end{scope}
    % generator ...
    \draw[xshift=6.5cm,draw=gray,double=gray!10,double distance=4pt] 
        (3,4) -- ++(2,0);
    \filldraw[xshift=6.5cm,fill=orange!10,draw=orange] 
        (1.8,4) -- (3.0,3.3) -- (3.0,4.7) -- cycle;
    \filldraw[xshift=6.5cm,fill=orange!10,draw=orange] 
        (1.5,4) -- (2.5,3.4) -- (2.5,4.6) -- cycle;
    \filldraw[xshift=6.5cm,fill=orange!10,draw=orange] 
        (1.2,4) -- (2  ,3.5) -- (2  ,4.5) -- cycle;
    \filldraw[xshift=6.5cm,fill=orange!10,draw=orange] 
        (4.5,3.3) rectangle (7.3,4.7);
    %labels
    \node[text width=3cm, text centered,font=\small] at (1.75,4) 
        {Steam generator\\ (heat change)};
    \node[text width=2cm, text centered,font=\small] at (8.8,5) {Turbine};
    \node[text width=2cm, text centered,font=\small] at (12.4,4) {Alternator};
    % transmission lines
    \node (aa) at (11.1,4.6) {};
    \node (bb) at (11.6,4.6) {};
    \node (cc) at (12.1,4.6) {};
    \node (dd) at (12.6,4.6) {};
    \node (ee) at (13.1,4.6) {};
    \node (ff) at (13.6,4.6) {};

\end{scope}
% 3 loop --------------------------------------------------------------------
\begin{scope}[xshift=23cm,yshift=1cm]
    % circuit
    \draw[draw=blue,double=blue!10,double distance=4pt]
      (1,2.5) -- ++(-8.5,0) -- ++(0,+1.5) -- ++(8.5,0);
    % arrows
    \draw[arrows3loop] (-5.5,2.5) -- (-6,2.5);
    \draw[arrows3loop] (-1.5,2.5) -- (-2,2.5);
    \draw[arrows3loop] (-6,4) -- (-5.5,4);
    \draw[arrows3loop] (-2,4) -- (-1.5,4);
    % tower
    \filldraw[draw=gray,fill=gray!20] (1,7) to[out=270,in=80]
                  (0,0) to[out=-20,in=200]
                  (6,0) to[out=100,in=270]
                  (5,7);
    \filldraw[draw=gray,fill=gray!40] (1,7) to[out=30,in=150]
                  (5,7) to[out=200,in=-20]
                  (1,7);
    % labels
    \node[text width=3cm, text centered,font=\small] at (3,3.5)
        {Cooling\\tower};
    \node[text width=2cm, text centered,font=\small] at (-3.5,1.5)
        {Cooling\\water};
    \node[text width=2cm, text centered,font=\small] at (-6,3.25)
        {Condenser};
    % pump
    \begin{scope}[xshift=-10,yshift=115]
        \filldraw[fill=purple!20,draw=purple] (0,0) circle (0.5cm);
        \node[below,font=\small] at (0,-0.5) {Pump};
        \filldraw[fill=purple!40,draw=purple,yshift=-0.5cm]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
        \filldraw[fill=purple!40,draw=purple,yshift=+0.5cm,rotate=180]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
        \filldraw[fill=purple!40,draw=purple,xshift=+0.5cm,rotate=90]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
        \filldraw[fill=purple!40,draw=purple,xshift=-0.5cm,rotate=-90]
            (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
    \end{scope}
\end{scope}
%1 loop --------------------------------------------------------------------
\begin{scope}[xshift=2cm,yshift=4cm]
% Reactor vessel
\filldraw[draw=red,fill=red!10] (0,-0.5) to[out=-20,in=200]
              (3.5,-0.5) --
              (3.5,4.5) to[out=160,in=20]
              (0,4.5) --
              (0,-0.5);
% === circuit =========
\draw[draw=red,double=red!10,double distance=4pt,rounded corners=2pt]
  (0.1,1) --  ++(-1,0) -- ++(0,-3) -- ++(5,0) -- ++(0,1.5) --
  ++(3,0) -- ++(0,2) -- ++(-3.7,0);

\draw [line width=2pt, dash pattern=on 4pt off 2pt,dash phase=\x/10*6pt,red!80,rounded corners=2pt] (0.1,1) --  ++(-1,0) -- ++(0,-3) -- ++(5,0) -- ++(0,1.5) --   ++(3,0) -- ++(0,2) -- ++(-3.7,0);
% === =========
% Pressurizer
\draw[draw=red,double=red!10,double distance=4pt] (4.2,1.6) -- ++(0,0.8);
\filldraw[draw=green,bottom color=red!40,top color=green!20]
              (4,2.4) to[out=-20,in=200]
              (4.5,2.4) --
              (4.5,3.6) to[out=160,in=20]
              (3.9,3.6) --
              (3.9,2.4);
% === arrows =========
%\draw[arrows1loop] (-0.7,1) -- (-0.2,1);
%\draw[arrows1loop] (-0.9,-0.5) -- (-0.9,0);
%\draw[arrows1loop] (0.7,-2) -- (0.2,-2);
%\draw[arrows1loop] (4.5,1.5) -- (5,1.5);
%\draw[arrows1loop] (7.1,0.5) -- (7.1,0);
%\draw[arrows1loop] (5.5,-0.5) -- (5,-0.5);
% === =========

% pump
\begin{scope}[xshift=75,yshift=-55,fill=red!20,draw=red]
    \filldraw (0,0) circle (0.5cm);
    \node[below,font=\small] at (0,-0.5) {Pump};
    \filldraw[yshift=-0.5cm] (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
    \filldraw[yshift=+0.5cm,rotate=180]
        (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
    \filldraw[xshift=+0.5cm,rotate=90]
        (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
    \filldraw[xshift=-0.5cm,rotate=-90]
        (0,0) arc (240:180:0.4cm)  arc (200:280:0.4cm) ;
\end{scope}
% reactor core
\filldraw[fill=red!30,draw=red] (0.7,0) rectangle (2.8,2);

% control rods
\foreach \x in {1.0,1.5,2.0,2.5}
  \draw[draw=gray,double=gray!50,double distance=0.5pt] (\x,0.3) -- (\x,3.7);

%labels
\draw[annotline] (0.6,0.5) -- ++(-3.3,-1.5)
    node[text width=1cm,font=\small,left] {Reactor core};
\node[text width=2cm, text centered,font=\small] at (1.75,5.4) {Reactor vessel};
\draw[annotline] (0.9,2.8) -- ++(-3.3,1.5)
    node[text width=2cm, text centered,font=\small,left=-8pt] {Control\\rods};
\draw[annotline] (4.2,3.7) -- ++(0.5,1.5)
    node[text width=2cm, text centered,font=\small,above] {Pressurizer};
\draw[annotline] (3.9,1.5) -- ++(1.3,-0.6)
    node[text width=2.4cm, text centered,below=-2pt,font=\small]
        {Water coolant (\num{330}{\textdegree})};
\draw[annotline] (-0.1,-2) -- ++(-0.3,-0.6)
    node[text width=2.4cm, text centered,below=-2pt,font=\small]
        {Water coolant (\num{280}{\textdegree})};
\end{scope}
% clouds ----------------------------------
\begin{scope}[xshift=26cm,yshift=10cm, fill=blue!10, draw=blue,
    decoration={bumps,segment length=0.5cm}]
    \filldraw[yshift=-1.5cm,rotate=-25,decorate]
        (0,0) -- ++(-0.4,1.25)-- ++(-0.1,0.75)-- ++(0.2,0.5)-- ++(0.3,0.5)--
        ++(0.3,-0.5)-- ++(0.2,-0.5)-- ++(-0.1,-0.75)-- ++(-0.4,-1.25);
    \filldraw[xshift=0.5cm,yshift=-2cm,rotate=-30,decorate]
        (0,0) -- ++(-0.4,1.25)-- ++(-0.1,0.75)-- ++(0.2,0.5)-- ++(0.3,0.5)--
        ++(0.3,-0.5)-- ++(0.2,-0.5)-- ++(-0.1,-0.75)-- ++(-0.4,-1.25);
    \filldraw[xshift=-1.05cm,yshift=-2.15cm,rotate=-20,decorate]
        (0,0) -- ++(-0.4,1.25)-- ++(-0.1,0.75)-- ++(0.2,0.5)-- ++(0.3,0.5)--
        ++(0.3,-0.5)-- ++(0.2,-0.5)-- ++(-0.1,-0.75)-- ++(-0.4,-1.25);
    %labels
    \node[text width=1cm, text centered,font=\small] at (0.2,1.5) {Water vapor};
\end{scope}

% palo della luce
\begin{scope}[xscale=0.2,xshift=113cm,yshift=19cm,line width=1pt,brown]
    \draw (0,0) -- (-6,-6)
          (0,0) -- ( 6,-6)
          (-1,-1) -- ( 1,-1)
          (-1,-1) -- ( 2,-2)
          ( 1,-1) -- (-2,-2)
          (-2,-2) -- ( 2,-2)
          (-2,-2) -- ( 3,-3)
          ( 2,-2) -- (-3,-3)
          ( 3,-3) -- (-3,-3)
          (-3,-3) -- ( 4,-4)
          ( 3,-3) -- (-4,-4)
          ( 4,-4) -- (-4,-4)
          (-4,-4) -- ( 5,-5)
          ( 4,-4) -- (-5,-5)
          ( 5,-5) -- (-5,-5)
          (-6,-6) -- ( 0,-5.2)
          ( 6,-6) -- ( 0,-5.2);
    \draw (-1.5,-1.5) -- (-4,-1.5) -- (-1,-1)
          ( 1.5,-1.5) -- ( 4,-1.5) -- ( 1,-1);
    \path (-4,-1.4) node (a) {}
          ( 4,-1.4) node (b) {};
    \draw[line width=1pt,brown] (-3.5,-3.5) -- (-7.5,-3.5) -- (-3,-3)
                                ( 3.5,-3.5) -- ( 7.5,-3.5) -- ( 3,-3);
    \path (-7.5,-3.4) node (c) {}
          ( 7.5,-3.4) node (d) {}
          (-5.5,-3.4) node (e) {}
          ( 5.5,-3.4) node (f) {};
\end{scope}
% transmission lines
\draw[dashed,gray] (c) -- (aa)
                   (a) -- (bb)
                   (e) -- (cc)
                   (b) -- (dd)
                   (f) -- (ee)
                   (d) -- (ff);
\end{tikzpicture}
}

\end{document}

Document Code

\documentclass{scrartcl}

\usepackage[margin=15mm,landscape]{geometry}
\usepackage{animate}

\begin{document}

\begin{center}
    \begin{figure}[htp]
        \animategraphics[autoplay,loop]{10}{anim}{}{}
        \caption{reactor cycle}
    \end{figure}
\end{center}

\end{document}

Output

(again created with ImageMagick)

enter image description here

share|improve this answer
2  
As an alternative to using the decorations library for drawing lots of circles, you can also use a dash pattern with an on length of 0pt together with line cap=round (see Dotted lines in TikZ with round dots). That's much faster. –  Jake May 27 '13 at 2:13
1  
@Jake: That's a very good suggestion, as it will also work for rectacles, like in the OP's example. I'll try it out tomorrow. –  Tom Bombadil May 27 '13 at 2:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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