Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a large sphere of radius $R_1$ which I would like to pack with $N$ smaller radius of radius $r_2<R_1$ arranged in a face-centered cubic (fcc) packing arrangement (i.e. Kepler's optimal sphere packing geometry). Is there a way for me to use Mathematica's built-in LatticeData functionality to accomplish this, perhaps with an after-the-fact pruning step? Can I do this for the other lattice types Mathematica has data for?

share|improve this question
up vote 4 down vote accepted

This should get you started...

basis = LatticeData["FaceCenteredCubic", "Basis"];
points = Tuples[Range[-4, 4], 3].basis;
inside = Select[points, Norm[#] <= 4 &];
Graphics3D[Sphere[inside, 0.25]]

enter image description here

For more complex polyhedra see: Checking if a point is in a convex 3D polyhedron

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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