  Variable stars have been used for over one hundred years as probes for
determining astronomical distances; these distances can be used to map the
three-dimensional (3D) structure of nearby galaxies. Exploiting the effect that
moving to the mid-infrared has on Cepheid magnitudes and light curves, we can
now map our nearest galaxies in 3D at fidelities never before achievable.
Combining data from the OGLE-IV catalogue with mid-infrared photometry from the
Spitzer Space Telescope, around 5000 fundamental mode Cepheids are being used
to trace the 3D structure of the Magellanic Clouds. An automated photometry
pipeline has been developed to obtain precise mean magnitudes and light curves
for Cepheids in the Magellanic System, which in turn produces distance
measurements for individual Cepheids accurate to 5%. The resulting detailed
maps are being used to probe the geometric and chemical structure of the
Magellanic Clouds, as well as their interaction and dynamical histories.
Initial results from this project are discussed and the future inclusion of RR
Lyrae stars to trace the old stellar population of the system is described.
