0

enter image description here

How can I generate the above image using TikZ (possibly other methods will work if they produce better looking results)?

Thank you to all who can help me.

  • like this tex.stackexchange.com/questions/70090/… ? – percusse Oct 18 '17 at 0:21
  • I personally would draw something like that in Incscape and then export it to tikz. Also always provide a Minimum Working Example and show your progress. Just asking someone to do your job is rude 😉 – Julian_W Oct 18 '17 at 14:58
  • Thanks for the answer @julian_W. I did something in Inkskape, but it got so horrible that I'm embarrassed to post it. I really did not have the slightest idea how to do this .. If you have a very simple example, that I can use it as a starting point, it would help me a lot. thanks again. – N Ericson Oct 18 '17 at 21:36
  • I dont see any benefit in using tikz. This is much easier to realize in a graphical editor. – Julian_W Oct 18 '17 at 23:26
2

Not amazing, and not complete...

\documentclass[tikz,border=5]{standalone}
\begin{document}
\begin{tikzpicture}[line cap=round, line join=round]
\fill [gray!50] 
  (-2,-.5) -- (3,-.5) arc (-90:90:.375 and .5) -- (-2,.5) arc (90:270:.375 and .5);
\fill [gray, even odd rule] (0.5,0) 
  ellipse [x radius=1.75, y radius=2] ellipse [x radius=1, y radius=1.25];
\fill [gray] (0,2) rectangle ++(0.5, -0.25) (0,-2) rectangle ++(0.5, 0.25);
\fill [gray!20, even odd rule] 
  ellipse [x radius=1.75, y radius=2] ellipse [x radius=1, y radius=1.25];
\foreach \i in {-90,-67.5,...,67.5}
  \draw [ultra thick, rounded corners=0.125cm] 
    (\i:1 and 1.25) -- (\i:1.75 and 2) -- +(0.5,0);
\foreach \i in {120,144.5,...,247.5}
  \draw [ultra thick, rounded corners=0.125cm] 
    (\i:1.75 and 2) -- (\i:1 and 1.25) -- +(0.5,0);
\fill 
  (2,4) coordinate (a) circle [radius=.1] 
  (2,3) coordinate (b) circle [radius=.1];
\draw [ultra thick] (90:1 and 1.25) |- (a);
\draw [ultra thick] (67.5:1.75 and 2) ++(0.5, 0) |- (b);
\fill [gray!50] (0,-.5) rectangle ++(-2,1);
\fill [gray] (-2,0) ellipse [x radius=0.375, y radius=.5];
\end{tikzpicture}
\end{document}

enter image description here

  • Thanks for your help, @MarkWibrow. I've been working on it for five days, and what I've got is nowhere near what you've done. It was much better than i could imagine. Very impressive. – N Ericson Oct 25 '17 at 3:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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