"Spiral Candy" Procedural shader along curve (repeated with rotation)

Goal:

I want to apply a procedural “spiral candy” type material to a spiral curve (or any curve with a profile, really) that allows the bands of colors to be repeated (tiled) and also rotated.

Inspiration:

From my understanding…

First, you need to give a curve with a profile (converted to a mesh) UV coordinates via geometry nodes, but you also need to adjust the 0 to 1 UV mapping so it tiles correctly. The UV mapping fix is done by extruding a flattened spiral or an arc along the curve, converting it to a mesh, and passing the UV attribute to your shader tree (see geometry node setup below).

Problem(s)

My problem is that I can create a shader for a straight “straw-like” curve using object mapping coordinates, but then this shader doesn’t work correctly on the spiral.

And when I attempt to create a shader for the spiral, any attempt to rotate the bands along the spiral shape breaks the UV mapping. It only tiles when there is no rotation and I want to be able to adjust the “swirl” from straight (bands) to angled.

Reference videos for giving a curve UVs:

These videos got me started, but I haven’t been able to overcome the tiling+rotation issue for this specific type of texture.

I’m also aware of this post on Blender artists, but it’s for an image texture (and not procedural)…

I’ve tried a few geometry nodes and shader combinations and the following is the closest I’ve come so far. Note where the bands along the spiral have a seam.

Current attempt:

Geometry node setup (same for each, but with different shaders):

“Straw” shader:
I understand this only works with the object coordinates because it is a straight object.

Spiral shader:

Basically, I’m looking for a single procedural GN and shader “spiral candy” setup that can be added to any extruded curve object that will allow the colored bands to be tiled and rotated along the path.

Any assistance would be appreciated. Thank you!

Have you considered making a spiral shader?

This could be a basic building block… That constant in the multiply is 2*tau.

Edit: You could also use something like this node-group to just create “spiraling” UV coords you can then plug into any Vector source…

e.g.:

Good luck!

Ah, very cool. Thank you @zeroskilz ! I implemented your second suggestion.

Also, I was unaware of what a Color Ramp plugged into a Snap would do, so that’s a nice tip!

FWIW, I initially had some trouble getting this to work, but it was user error… To anyone attempting to rebuild these node setups, do pay close attention to the Store Named Attribute settings (2D Vector and Face Corner). Even my initial node setup (original post) had that correctly set, but when I went to copy zeroskilz node setup, I missed it.