I could tell you but then I would have to kill you.
For years we just did it by eye and did quite well.
The last couple of builds I used a 2 pieces of 2x2 clamped round frame elements, and shimmed out where neccessary with bits of stuff off the floor.
Then tack it together and have a good squint around it. The most important thing while setting this up is to make the correct 'sucking through the teeth' noise as you scratch your nose and eye it up.
There are degrees of straightness in this high tech game.
Quite straight, fairly straight, straightish, straight enough and a bit wonky.
It is surprising how unstraight you can be and get a rideable bike, some them will pull slightly one way you compensate naturally for this. My wifey's recumbent a factory built jobbie used a pair of parallel tyre marks in the road about 50mm apart, rode perfectly though.
Now mr Wriggler report to the nice nurse take your tablets and go back to bed like a good boy. This nonsense will get you nowhere.
I m only grey at the sides, starting to like the look.
Folding bikes? I often pondered making a fixed diagonal bike out of one if that makes sense. Weld the frame up with a massive offset to it, that would confuse people.