I was thinking along the lines of: Each cube must share 5 feet of facing with at least one other cube.
This would automatically handle orientation issues (i.e. no 45 degree cubes with 60 degree cubes, all cubes are at the same orientation).
But, at the same time, it gives some level of flexibility with the spell. For example, allowing you to attack 8 opponents that are surrounding an ally, without targeting the ally.