AI and physics combine to reveal the 3D structure of a flare