unity – How to displace a segmented line along a sine wave with Shader Graph?

I have a mesh made of three identical cylinders (conceptually just line segments with a non-zero thickness) crossed over each other at 60 degree angles, so the ends describe the points of a regular hexagon. The cylinders are divided into a lot of segments, which I’d like to displace in a sinewave pattern. The pivot is in the center of the mesh.

My concept is pretty straightforward:

  • Subtract object position from vertex position to get vertex position relative to the pivot (VPR).
  • Normalize VPR and swap the X and Y to get a vector in the XY plane perpendicular to the orientation of the cylinder.
  • Take the magnitude of VPR, multiply by a V1 parameter (Waviness), then take the sine.
  • Multiply the sine by the perpendicular orientation vector to get the displacement.
  • Add the displacement to the vertex position. Assign result to master node’s vertex position.

This really feels like it should work. Each cylinder should be distorted along a sine wave, with the magnitude of the distortion increasing the further it gets from the center, so I end up with three wavy lines crossed over each other at 60 degree angles. Increasing Waviness should increase the frequency of the wave, as the base value is multiplied by it before feeding into the sine node.

Instead, things curve just a little bit at a low Waviness, but as I increase it the cylinders get both thicker and longer, neither of which should be happening, and start wrapping themselves around the mesh in weird patterns. I have no idea what I’m doing wrong!

Here’s my graph setup, with the mesh assigned to the preview so you can see what a mess it’s making of it:
enter image description here

Any ideas how I can fix this?