Predictable surface emission patterns in terahertz photonic-crystal quantum cascade lasers.