We experimentally analyze the compaction dynamics of an ensemble of cubic particles submitted to a novel type of excitation. Instead of the standard tapping procedure used in granular materials we apply alternative twists to the cylindrical container. Under this agitation, the development of shear forces among the different layers of cubes leads to particle alignment. As a result, the packing fraction grows monotonically with the number of twists. If the intensity of the excitations is sufficiently large, an ordered final state is reached where the volume fraction is the densest possible compatible with the boundary condition. This ordered final state resembles the tetratic or cubatic phases observed in colloids.