Added further constructor to XYZGrid
First shot at refraction. Not perfectly working though.