It was a case of experience. Expert stonemasons were sought after, and received a lot of money to oversee the structural and decorative part of stone construction. They did their job mostly by experience with previous projects, and by calculating in their heads. Blueprints and paper sketches weren’t a thing for a medieval architect, and models were rarely used. More often than not they planned out their ideas in situ, 1:1 scale. For more complex stonework that had to be chiseled on the ground, and fitted somewhere higher up in the construction, they used smooth level wooden floors, on which they would draw the larger whole that the stones would form (I.e. a window frame or spiral staircase). Then the stones were fitted to these drawings before being transported to their place. Often this meant refining the peices a little, as the fit was sometimes not perfect right away. Larger or more detailed decorations like statues that had to be made from more peices would often only be rough cut and then detailed in place. But it’s surprising how much they could get correct right away, more than you would think. Something that might be interesting is this series: https://youtu.be/SURsW7BpCNc it has 5 eps. and some interesting insights about medieval construction work.