How to process the corners of tube into rounded corners

I need to process the corners of the generated tube into rounded corners using radius, similar to CSS’s border radius. I have already processed the points on both sides of the corners, but I don’t know how to generate the points of the arcs. Can you help me

rounded corner tube | Babylon.js Playground (babylonjs.com)

Maybe you can use a Bezier curve to generate the points of the path?

https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves

1 Like

Just a quick note, there is no way to specify a radius in this situation as the end points are fixed. I think the Hermite form of a spline will work the best here. You can tweak the tangent length to get a different curve but as long as the tangents line up with the tube, it will be continuous. If you want a natural spline, use a tangent length equal to 1/3 of the tube length.

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)