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.
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:
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.
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?