Packing concave molecules in crystals and amorphous solids: on the connection between shape and local structure