Extended TubeGeometry

Hi community!

Another attempt to make the work with TubeGeometry more flexible.

Added two parameters: capped and RGenerator.

capped - boolean. Indicates, if the tube has end caps/lids. Default value is false.
RGenerator - function. Computes tube segments’ radii and multiplies them with radius parameter, takes two parameters - current position along tube’s curve [0..1], current angle for a vertex in a tube segment [0..2Pi]. Default value is 1.


Demo: https://codepen.io/prisoner849/full/RNwqWLb

14 Likes

This reminds me of when I was a child - we used to play with glass balls with colorful random shapes or air bubbles inside. Everyone had their own collection and we often traded balls with each other. They looked like this:

4 Likes

The type of flexibility that you made is something I have never thought about. My not-so-pretty attempt for “upgrading” tube geometry in Suica was more focused on adding a 4th dimension and using XYZR coodinates, where R is the radius. This made it possible to create a tube with varying (and spline-able) radius at different areas. A few demos: 1, 2, 3, and 4.

3 Likes

Super cool! :star_struck:

1 Like

And now you can create Demon King in Blender and animate all…

4 Likes

Well, that escalated quickly. From extended geometry to a nostalgic trip back to my childhood! :face_holding_back_tears:

2 Likes

Thanks for sharing - it’s very intime !
May I use it in my MathViewer ?

I never would have occurred to me those are tubes …

1 Like

Sure :slight_smile: Feel free to use and to modify it.

1 Like

More funky stuff:

Demo: https://codepen.io/prisoner849/full/MYWLEjx

8 Likes

+1 and these…

Beautiful work! I’m keen to know how the geometry flows along the curves, do the edge loops follow the curvature of the “ripples” or are the vertices along the tube “displaced” into the resulting “ripple” form?

4 Likes

Yes, look at it as a displacement. The vertex moves closer to or further from the curve, but doesn’t move around the curve.

1 Like

More funky stuff #2:

Demo: https://codepen.io/prisoner849/full/NPWVZML

5 Likes

If my future wife deals with 3D, I will find your codepen and give it to her…

1 Like