4

I am trying to recreate the following illustration in TikZ.

enter image description here

With the help of hpekristiansen, this is what I've done right now:

\documentclass[tikz, border=1cm]{standalone}
\usepackage{tikz-3dplot}
    \usetikzlibrary{3d}
\usepackage[siunitx]{circuitikz}
\begin{document}
    \tdplotsetmaincoords{70}{50}
    \begin{tikzpicture}[tdplot_main_coords]
        % untere horizontale Platte
        \draw[thick] (0,0,-0.4) -- +(0,0,-1); % Anschluss untere Platte
        \filldraw[fill=green, canvas is xy plane at z=-0.4] (-1,-1) rectangle +(2,2);
        % hintere vertikale Platte
        \draw[thick] (5,.4,0) -- +(0,2,0); % Anschluss hintere Platte
        \filldraw[fill=magenta, canvas is xz plane at y=0.4] (4,-1) rectangle +(2,2);
        \draw[very thick, dotted, ] (-4,0,0) -- (4,0,0) to[bend left] (10,-1,-1); % Elektronenstrahl 
        % Strahlerzeugungssystem
        \draw[thick] (-4.5,-3, 0) to [L] (-4.5,3, 0); %Kathode
        \draw[thick] (-4.5,-.9,0) -- +(-1.5,0,0) to [battery1, l=$U_H$] (-6,.9,0) -- (-4.5, .9,0);
        \draw[white, very thick] (-4.5, .9,0) -- (-4.5,3, 0);
        \filldraw[gray!50, canvas is yz plane at x=-2.5, even odd rule] (0,0) circle (1cm) circle (.25cm); %Lochanode
        \draw[thick]  (-2.5,{cos(270)},{sin(270)}) -- +(0,0,-.5) to [battery1, l=\small $U_B$]  (-4.5,-3, 0);
        \filldraw[fill=green, canvas is xy plane at z=0.4] (-1,-1) rectangle +(2,2); %untere Platte
        \draw[thick] (0,0,0.4) -- +(0,0,1) node [above] {$U_v$}; % Anschluss obere Platte
        \filldraw[fill=magenta, canvas is xz plane at y=-0.4] (4,-1) rectangle +(2,2); %vordere Platte
        \draw[thick] (5,-.4,0) -- +(0,-2,0) node [at end, xshift=-.25cm] {$U_h$}; % Anschluss vordere Platte
        % Leuchtschirm
        \draw[canvas is yz plane at x=10] (-2,-2) grid (2,2);
        \filldraw[black] (10,-1,-1) circle (3pt) node [right, xshift=.33cm] {1};
        \filldraw[red] (10,-1,-2) circle (3pt) node [right, xshift=.33cm] {2};
        %Röhre
        \coordinate (p1) at (10,{3.25*cos(75)},{3.25*sin(75)});
        \coordinate (p2) at (10,{3.25*cos(225)},{3.25*sin(225)});
        \draw[very thick] (-5,5,0) -- +(5,0, 0) -- (p1);
        \draw[very thick] (-5,-5,0) -- +(10,0, 0) -- (p2);
        \draw[very thick] (-5,5,0) to [bend right=40]  (-5,-5,0);
        % kreisförmiger Leuchtring 
        \draw[very thick, dashed, canvas is yz plane at x=10, domain=75:225] plot ({3.25*cos(\x)}, {3.25*sin(\x)});
        \draw[very thick, canvas is yz plane at x=10, domain=225:435] plot ({3.25*cos(\x)}, {3.25*sin(\x)});
    \end{tikzpicture}
\end{document}

enter image description here

What's open now:

  • The left side of the tube is rounded, but not even. I would like to connect both corner points with a smooth curve
  • The lower connection of the tube to the circle doesn't look particularly pretty. That's the best I could do. Maybe someone has an idea :)
Bigga
  • 99
  • 7
    Your question leaves all the effort to our community, even typing the essentials of a TeX document such as \documentclass{}...\begin{document} etc. As it is, most of our users will be very reluctant to touch your question, and you are left to the mercy of our procrastination team who are very few in number and very picky about selecting questions. You can improve your question by adding a minimal working example (MWE) that more users can copy/paste onto their systems to work on. If no hero takes the challenge we might have to close your question. – NBur Mar 01 '24 at 08:53
  • 2
    Have a look here: https://tex.stackexchange.com/questions/685897/how-to-draw-this-with-tikz/685905#685905 . And please: take NBur's comment serious. Thank you – MS-SPO Mar 01 '24 at 09:58
  • I'm totally committed to procrastination: my comment comes from https://tex.meta.stackexchange.com/questions/430/text-building-blocks – NBur Mar 01 '24 at 10:03

1 Answers1

7

Here is most of the 3D parts you need. Complete the rest and ask with a MWE, if you get stuck.

\documentclass[tikz, border=1cm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d}
\begin{document}
\tdplotsetmaincoords{70}{50}
\begin{tikzpicture}[tdplot_main_coords]
\filldraw[fill=green, canvas is xy plane at z=-0.4] (-1,-1) rectangle +(2,2);
\filldraw[fill=magenta, canvas is xz plane at y=0.4] (4,-1) rectangle +(2,2);
\draw[very thick, dashed] (-4,0,0) -- (4,0,0) to[bend left] (10,-1,-1);
\filldraw[fill=green, canvas is xy plane at z=0.4] (-1,-1) rectangle +(2,2);
\filldraw[fill=magenta, canvas is xz plane at y=-0.4] (4,-1) rectangle +(2,2);
\draw[canvas is yz plane at x=10] (-2,-2) grid (2,2);
\end{tikzpicture}
\end{document}

Parallel plates and a ray path

Edit: I have added some macros to help with the design, but as everything else is hardcodes, I would delete these macros again, when the rough design has been decided and then make fine adjustments. With the design as show here, the power supplies needs to be moved a bit further away. Maybe the whole tube needs a slightly off-white color? plot makes many small line segments(or curves with smooth), so I changed it to arc/circle.

\documentclass[tikz, border=1cm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d}
\usepackage[siunitx]{circuitikz}
\begin{document}
\tdplotsetmaincoords{70}{50}
\begin{tikzpicture}[tdplot_main_coords]
\draw[thick] (0,0,-0.4) -- +(0,0,-1);
\filldraw[fill=green, canvas is xy plane at z=-0.4] (-1,-1) rectangle +(2,2);
\draw[thick] (5,.4,0) -- +(0,2,0);
\filldraw[fill=magenta, canvas is xz plane at y=0.4] (4,-1) rectangle +(2,2);
\draw[very thick, dotted, ] (-4,0,0) -- (4,0,0) to[bend left] (10,-1,-1);
\draw[thick] (-4.5,-3, 0) to [L] (-4.5,3, 0);
\draw[thick] (-4.5,-.9,0) -- +(-1.5,0,0) to [battery1, l=$U_H$] (-6,.9,0) -- (-4.5, .9,0);
\draw[white, very thick] (-4.5, .9,0) -- (-4.5,3, 0);
\filldraw[gray!50, canvas is yz plane at x=-2.5, even odd rule] (0,0) circle (1cm) circle (.25cm);
\draw[thick]  (-2.5,{cos(270)},{sin(270)}) -- +(0,0,-.5) to [battery1, l=\small $U_B$]  (-4.5,-3, 0);
\filldraw[fill=green, canvas is xy plane at z=0.4] (-1,-1) rectangle +(2,2);
\draw[thick] (0,0,0.4) -- +(0,0,1) node [above] {$U_v$};
\filldraw[fill=magenta, canvas is xz plane at y=-0.4] (4,-1) rectangle +(2,2);
\draw[thick] (5,-.4,0) -- +(0,-2,0) node [at end, xshift=-.25cm] {$U_h$};
\draw[canvas is yz plane at x=10] (-2,-2) grid (2,2);
\filldraw[black] (10,-1,-1) circle (3pt) node [right, xshift=.33cm] {1};
\filldraw[red] (10,-1,-2) circle (3pt) node [right, xshift=.33cm] {2};
%added/changed:
\pgfmathsetmacro{\angfl}{245}
\pgfmathsetmacro{\angfr}{65}
\pgfmathsetmacro{\rf}{1}
\coordinate (p1) at (-5,{\rf*cos(\angfl)},{\rf*sin(\angfl)});
\coordinate (p2) at (-5,{\rf*cos(\angfr)},{\rf*sin(\angfr)});
\draw[very thick, canvas is yz plane at x=-5] (p1) arc [radius=1, start angle=\angfl, end angle=\angfr];
\draw[very thick, dashed, canvas is yz plane at x=-5] (p1) arc [radius=1, start angle=\angfl, end angle=\angfr-360];
\pgfmathsetmacro{\angsl}{230}
\pgfmathsetmacro{\angsr}{70}
\pgfmathsetmacro{\rs}{3.25}
\coordinate (p3) at (10,{\rs*cos(\angsl)},{\rs*sin(\angsl)});
\coordinate (p4) at (10,{\rs*cos(\angsr)},{\rs*sin(\angsr)});
\draw[very thick, canvas is yz plane at x=10] (0,0) circle[radius=3.25];
\draw[very thick] (p1) to[out=\angfl+90, in=\angsl-90] (p3);
\draw[very thick] (p2) to[out=\angfr-90, in=\angsr+90] (p4);
\end{tikzpicture}
\end{document}

Cathode ray tube