Diffraction from one- and two-dimensional quasicrystalline gratings