Programming patchy particles to form complex periodic structures