For an industrial problem, I would like to be able to draw a series of layouts of the cross section of multistrand electrical wires. These can be simplified by packing in a circular envelope a given number of tangent circles of given diameters. A typical layout I would like to make would be the one with a number of circles (strands) of 19 and density of 8.03 as shown on this page: https://en.wikipedia.org/wiki/Circle_packing_in_a_circle Ideally I would like to change the number of circles, and their diameter, and regenerate easily new layouts at least originally for popular configurations, such as numbers of strands 7, 19, 37... (larger wires have a "roped" configuration, ie a bundle of smaller wire bundles, more complicated, but are not in scope). I cannot size the level of difficulty of this problem, that originally looked to me relatively simple, and even less decide how to start. Would someone provide a guideline?
\documentclass[tikz,border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{fit,backgrounds}
\begin{document}
\tiny
\begin{tikzpicture}[cable/.style={circle, draw, minimum size=5mm, inner sep=0pt, outer sep=0pt}]
\node[cable] (center) at (0,0) {};
\foreach \i in {1,...,6}
\node[cable] (0-\i) at (60*\i:5mm) {a\i};
% \foreach \i in {6}
% \node[cable] (1-\i) at (60*\i:5mm) {\i};
\foreach \i in {1,...,12}
\node[cable,red] (1-\i) at ({15+30*\i}:.97) {b\i};
\foreach \i in {1,...,12}
\node[cable, blue] (1-\i) at ({0+30*\i}:1.37) {c\i};
\begin{scope}[on background layer]
%\node[circle, draw, blue, fit=(2-1) (2-7), inner sep=-1.8pt] (envelope) {};
\end{scope}
\end{tikzpicture}
\end{document}


picout of it? – percusse Jul 25 '15 at 09:34