How to change radius on different path on TubeGeometry?

I want to build some tubes but I need the radius vary on different position. and the tube is not straight also. I tried TubeGeometry but it only support the same radius.

I am wondering if there is a simply way to achieve this. and I did find someone did it before and upload to npm via:

npm install gh-three-tools

And here is his explaination:
https://blog.csdn.net/weixin_43850100/article/details/112132022?spm=1001.2014.3001.5502
https://blog.csdn.net/weixin_43850100/article/details/121655356?spm=1001.2014.3001.5502
https://blog.csdn.net/weixin_43850100/article/details/123475441?spm=1001.2014.3001.5502
, but the code is 2 years ago and the three.js have changed a lot. His code version don’t support close the end point of tube. I guess that three.js don’t have this close function at that time.

Of course I want them both: radius varying and closed end point.

My question is how to find the old official version conrresponding his midified version? And Yes, is it possible that redius varying is supported in the future? And is there any other implement to do this?

Maybe you can use this
Curved2Geometry - a twofold curved geometry
or this
Multi Form Geometry
or body parts of
Pino - a procedurally generated and moved skeleton figure

Less complex is
How to update tubeGeometry geometry based in lineCurve modifications? - #14 by hofk => DynamicTubeGeometryCaps

There line 251
v3a.multiplyScalar( g.radius );

You can vary the radius. You don’t have to move the geometry either.

1 Like