The Geometry of the Moiré Effect in One, Two, and Three Dimensions. (2022)