How to process the corners of tube into rounded corners

I have found a similar solution that should solve the problem. I will try it out

Draw Arc Between Vectors | Babylon.js Playground (babylonjs.com)