Welcome,
I would first have to ask, why are you crushing or changing the shape of the pipe? By squishing it down to such a shape and dimension you are losing an enormous amount of strength as a support member. Are you sure this is what you need to do?
I would want to know a lot more about this style of connection before offering a suggestion on how to make them.
I suggest you rethink the method as it is not what I would regard as a good use of materials regarding load carrying etc.
Just one old fart's opinion.