In my neighbourhood there are a few terraced buildings of the same non-rectangular shape, but connected in various ways. However, it turns out that for each set of connected buildings, all corners are on a 4x4 m orthogonal grid. Is there a way to draw the buildings such that all corners end up on such a grid?

More generally, is there a way to specify ways by numbers, for example by giving a list of lengths and angles?

As for drawing by numbers in general: When in “add” mode, you can use the Tab key to switch to locked angles (90°, 60°, 45° and so on). The status bar at the bottom will show the length of the way you are about to draw. You could combine these features to achieve quite precise results.

You can also use the “Orthogonalise” tool (press Q).
You can draw extra ways as guides, and make them at right angles. Then draw buildings connected to these guides. Just so long as you delete the guides before uploading.

If you want to make a perfect square, you can draw a rectangle, then orthogonalise that. Then draw 2 ways going diagonally across, and orthogonalise them.

Thank you for the advice. I ended up using the Tab key to use locked angles. The nice (and unexpected) benifit of this, was that it not only snaps the last and the current segment, but also snaps the length of the current segment so that its end is at a right angle to other corners in the way. In the shapes I was drawing, this meant that I only had to carefully measure about half the segment lengths.

I also found that using the BuildingsTools plugin with a width and length step of 4 m, I could create a long area that was subsequently divided into 4 m sections with the Teraccer plugin. This gave me a 8 x 2 grid of points with 4 m spacing, which was a useful starting point.