Predicting the influence of geometric imperfections on the mechanical response of 2D and 3D periodic trusses