A Study in Sphere Packingby Kirby Urner 

Put another way, the back and forth movements along the six edges of a regular tetrahedron provide the 12 stepwise jumps available between neighboring unitradius sphere centers in the isotropic vector matrix. Packing outwardly in layers from a nuclear sphere, this packing takes on a cuboctahedral conformation. 

The 12 directions from a nuclear sphere center to the centers of the 12 spheres packed around it are defined by the following quadray coordinates: (0,1,1,2) (0,1,2,1) (0,2,1,1) Notice that specifying the position of the 2 and the 0 unambiguously identifies these 12 quadrays, the remaining coordinates being both 1. If we say the 2nd coordinate is 2, and the 4th is 0, then we know (1,2,1,0) is the quadray meant. 

Note that if both tokens were the same number, like 1 and 1, we would have only six unique possibilities. The diagonal would drop out as before, plus those above the diagonal are merely position pairs with the tokens reversed  and in the case where both tokens are the same, these mirror pairs would be identical. 
procedure defineVE local i,j,k k=1 && goes from 1 to 12 for i = 1 to 4 && row for j = 1 to 4 && column if i=j && skip if row = column loop endif this.VEvector(k,1)=i && the position of the 2 this.VEvector(k,2)=j && the position of the 0 k=k+1 endfor endfor endproc 

The 13 total addresses were defined as the centers of unitradius spheres and written out in a format understood by Povray, a public domain ray tracing and rendering package. 

One method for accomplishing this, while not the most efficient by some measures, has the advantage of making economical use of code. Our basic loop involves starting at some home position and recording the locations of the 12 surrounding positions. Using a programming technique called recursion, we can make each of the 12 surrounding positions a new home position, mapping the next surrounding 12, and so on. But if one of the 12 surrounding spheres becomes a new home base, then the 12 spheres surrounding it will include one or more already recorded. This is an inefficiency and is also what requires compensating code to screen out all the duplicates generated by such a technique. The recursive code is provided below, where the parameter n controls how deeply the recursion drills before moving to the next location in the outermost loop. In this example, n was set to 3, for 3 frequency. 
procedure calcve(n,a,b,c,d) local k, q(4) for k = 1 to 12 q=1 q(this.VEvector(k,1))=2 q(this.VEvector(k,2))=0 q(1)=a+q(1) q(2)=b+q(2) q(3)=c+q(3) q(4)=d+q(4) this.makepoint; (q(1),q(2),q(3),q(4)) if n>1 this.calcVE; (n1,q(1),q(2),q(3),q(4)) endif endfor endproc 
In case you are wondering why the letters VE keep recurring in the snippets of program code, you should know that a cuboctahedral wireframe of 24 circumferential and 24 radial vectors (the radial members are doubled  think of eight hingebonded tetrahedra) is known as a vector equilibrium in synergetics. 

Note that the number of spheres in each successive layer is
given by the formula: And the cumulative number of spheres by: 


Synergetics on the
Web 