I tried and failed, my gantry was 2.75m of 4" square aluminium box section and it did the long axis. I started out by taking a 4m length of the stuff, supporting it at the ends and dumping weights in the middle to see how far it bent. Hardly at all. You don't need to swing huge amounts of iron just to move a torch. It had a 15mm profile rail along one side, screwed from behind so the black dust could not sneak in past the wipers.
I threw the towel in when I discovered the T5 belting and pulleys I had bought were unbelievably slack.
If you have pinions at either side of the gantry connect them with a low inertia shaft. Thin walled aluminium tube perhaps.
I could ramble on all day, it was fun.