1

I want to draw a toroid in TikZ like shown in the example picture below:

Toroid

I found already something: Modify TikZ coil decoration

But I have no Idea to bring this on a circle.

First, Yes it must be Tikz, there is no other choice! Second, Yes it must look exactly like this! Any help is appreciated!

Matthias
  • 199

2 Answers2

6

I'd use polar coordinates and loops.

\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}[declare function={R=3cm;r=1cm;w=5mm;
    Rp=R+0.5*r+0.5*w;Rm=R-0.5*r-0.5*w;}]
 \draw[line width=w,line cap=round] foreach \X in {-1,...,6}
  {(15+\X*30:Rp) -- (\X*30:Rm)} (-R,-2*R) -- (210:Rm);
 \draw[fill=gray,even odd rule] circle[radius=R+0.5*r] circle[radius=R-0.5*r];
 \draw[line width=w,line cap=round] foreach \X in {0,...,7}
  {(\X*30:Rm) -- (-15+\X*30:Rp)}
  (R,-2*R) -- (-30:Rm);
\end{tikzpicture}
\end{document}

enter image description here

4

I think I found a way:

\begin{circuitikz}
    %\tikzstyle{help lines}=[blue!50];
    %\draw[style=help lines] (0,0) grid (10,10);
    %%%
    \draw[line width=12,line cap=round] (3.00,2)    -- (4.20,4.2);
    \draw[line width=12,line cap=round] (2.75,4.5)  -- (4.00,5.1);
    \draw[line width=12,line cap=round] (3.20,6.40) -- (4.5,5.8);
    \draw[line width=12,line cap=round] (4.5,7.3)   -- (5.1,6.1);
    \draw[line width=12,line cap=round] (5.9,7.1)   -- (5.8,5.8);
    \draw[line width=12,line cap=round] (7,6)       -- (6,5.1);
    \draw[line width=12,line cap=round] (7.2,4.5)   -- (5.8,4.2);
    %%%
    \path [draw=black,fill=lightgray, even odd rule]
        (5,5) circle (2.1) (5,5) circle (1.3);
    %%%
    \draw[line width=12,line cap=round] (4.20,4.2) -- (2.75,4.50);
    \draw[line width=12,line cap=round] (4.00,5.1) -- (3.20,6.40);
    \draw[line width=12,line cap=round] (4.5,5.8)  -- (4.5,7.3);
    \draw[line width=12,line cap=round] (5.1,6.1)  -- (5.9,7.1);
    \draw[line width=12,line cap=round] (5.8,5.8)  -- (7,6);
    \draw[line width=12,line cap=round] (6,5.1)    -- (7.2,4.5);
    \draw[line width=12,line cap=round] (5.8,4.2)  -- (7,2);
\end{circuitikz}

Toroid

muzimuzhi Z
  • 26,474
Matthias
  • 199