This past April, the famous Notre Dame Cathedral in Paris, France, caught fire and burned for more than nine hours. Ceilings collapsed, towers toppled, and priceless art was charred in the intense heat. Rebuilding the 856-year-old cathedral won’t be easy and could cost billions of dollars. But detailed scans of how the cathedral looked before the blaze could help.

In 2012, historians from Vassar College began using an advanced camera to scan every nook and cranny of Notre Dame’s structure. The camera bounced lasers—concentrated beams of light—off the walls and ceilings to measure their exact shape.

A computer program combined all the data into a digital model of the cathedral. It’s accurate down to the millimeter, says Stephen Murray, an art historian on the team who started the project. The model could serve as a valuable reference for architects as they rebuild the cathedral.