Densest sphere packing

I would like to represent the densest sphere packing in dimension 3 as the following picture, for a beamer presentation.

Is Tikz the way to go for it? It is not a real 3D drawing since I only want a fixed representation of the picture, right?

• Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – Stefan Pinnow Jun 16 '19 at 17:41
• Welcome! Maybe this question is related? – user121799 Jun 16 '19 at 19:37

By nesting 2 for-loops one could do something like this:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\foreach \x in {4,...,0}{
\foreach \y in {\x,...,4}{
\draw[fill=white] (0.6*\x,-\y+0.3*\x) circle (0.55) (-0.6*\x,-\y+0.3*\x) circle (0.55);
}
}
\end{tikzpicture}
\end{document}


• @KJO Please keep your answer, I very much prefer the compact syntax with the loops – Dynamite Jun 16 '19 at 20:00
• @Dynamite Excellent :-) also the answer of KJO. Many sincere compliments. – Sebastiano Jun 16 '19 at 20:14
• Beautiful and elegant, very nicely done – cmhughes Jun 16 '19 at 20:49
• Nice! (You could replace the inner loop by \foreach \y [evaluate=\y as \z using {int(mod(\x+\y,2)+mod(\y,2))}] in {\x,...,4}{ \draw[fill=white] \ifnum\z=0 [fill=blue!10] \fi (0.6*\x,-\y+0.3*\x) circle (0.55) (-0.6*\x,-\y+0.3*\x) circle (0.55); }...) – user121799 Jun 16 '19 at 21:20
• Perfect thank you very much ! – Wokwok Jun 17 '19 at 8:13