align the boxes to the nearest plane