Build simple cubic, BCC, FCC, diamond, rock-salt, CsCl and HCP crystals in 3D, slice them with any Miller plane (hkl), and calculate theoretical density, packing fraction, coordination number, d-spacing and the X-ray Bragg angle for real materials.
A crystal is a unit cell repeated in every direction. Atoms on corners are shared by 8 cells, on edges by 4 and on faces by 2 — so simple cubic holds 1 atom per cell, BCC 2, FCC 4 and diamond 8.
ρ = Z · M / (N_A · V_cell), where Z is formula units per cell, M the molar mass and N_A = 6.02214076×10²³ mol⁻¹. Copper (FCC, a = 361.49 pm, M = 63.546) gives 8.93 g/cm³ — the measured value is 8.96.d = a / √(h² + k² + l²).n λ = 2 d sin θ. The default λ is Cu Kα₁ (154.06 pm), the most common lab X-ray source. Not every plane reflects: FCC needs h, k, l all odd or all even; BCC needs h + k + l even; diamond also forbids all-even sums that are not multiples of 4 — the tool checks these selection rules for you.Hexagonal close packing uses a and c = 1.633 a (ideal); its d-spacing and selection rule are not cubic, so the Miller and Bragg fields apply to the cubic structures only.