I asked a question here but it seems Tikz is a better option. I was trying to draw the following logo of an atom using Mathematica, but I could only figure out how to draw intersecting ellipses, not a nice logo like below. Do you know how to draw it by Tikz?
1 Answers
Although it is quite frowned upon on this platform when people ask for solutions without having tried to solve their problem themselves, I have taken the opportunity to learn about how to use pic, because I never really used it before.
So, this is of course not real 3D and it also lacks the gradients, but maybe you can use it as starting point ...
\documentclass[tikz]{standalone}
\tikzset{
ballsmall/.pic = {
\fill[draw=white, line width=2] (0,0) circle (.75);
},
balllarge/.pic = {
\fill[draw=white, line width=2] (0,0) circle (1.25);
},
ringfront/.pic = {
\clip (-7.5,0) rectangle (7.5,-2.75);
\fill[even odd rule, draw=white, line width=2] (0,0) ellipse (7.5 and 2.75) (0,.275) ellipse (6.5 and 2.25);
},
ringback/.pic = {
\clip (-7.5,0) rectangle (7.5,2.75);
\fill[even odd rule, draw=white, line width=2] (0,0) ellipse (7.5 and 2.75) (0,.275) ellipse (6.5 and 2.25);
}
}
\begin{document}
\begin{tikzpicture}
\begin{scope}[every node/.style={transform shape}]
\path[fill=red, rotate=90] (0,0) pic {ringback};
\path[fill=cyan, rotate=330] (0,0) pic {ringback};
\path[fill=green, rotate=210] (0,0) pic {ringback};
\path[fill=red, rotate=90] (0,0) pic {ringfront};
\path[fill=cyan, rotate=330] (0,0) pic {ringfront};
\path[fill=green, rotate=210] (0,0) pic {ringfront};
\end{scope}
\path[fill=red] (285:5.5) pic {ballsmall};
\path[fill=cyan] (165:5.5) pic {ballsmall};
\path[fill=green] (45:5.5) pic {ballsmall};
\path[fill=gray] (0,0) pic {balllarge};
\end{tikzpicture}
\end{document}
Result:
- 48,848
-
Great! Only I will need to make the spheres shiny with shadows like the original logo. I'll try to do it. – Saeid Dec 09 '20 at 20:39
-
@Saeid Look at the
shadingslibrary for options like\shade[ball color=red]– erik Dec 09 '20 at 21:53


tikz-3dplot, at most 10 minutes of efforts. The question is now whether has the time to squeeze in 10 minutes of their time before the question will be closed. – Dec 09 '20 at 20:05