(Using Blender 3.6.5)
Objective

To render a picture such as Fig. 1, the apparent transformation of a texture map such as shown Fig. 2, is to duplicate it in the azimuthal direction by the factor Repetitions as shown Fig. 3 (where Repetitions is set to 2), to shear it in the azimuthal direction proportionally to radius by the factor Swirl as shown Fig. 4 (where Swirl is set to 0.25, i.e. a quarter of turn), and finally to wrap it between radius Inner Margin and Outer Margin (set respectively to 0.25 and 0.75 in these figures). Inner Margin and Outer Margin are non-dimensional parameters, i.e. defined for a circle of radius 1.
Approach
Because in Blender a Texture node can not be connected at a NodeGroup input socket, the process has to be reversed.
1. The world coordinates are transformed to the texture coordinates, i.e. a square with $(x,y) \in [0,1] \times [0,1]$, as shown Fig. 2.
2. The chosen Texture node computes the Color from the Position Vector defined in the texture coordinates system.
3. Radius lower than Inner Margin or greater than Outer Margin are rendered in black using a mask.
4. The resulting Color is input to the Shader node.
5. To switch between textures, a Mix node can be inserted before the Shader node.
Shading nodes
From Cartesian to polar coordinates, in world coordinates system
1. The world coordinates of the surface to shade are transformed in a square domain $(X,Y) \in [0,1] \times [0,1]$, based on the surface bounding box, using a Texture Coordinate node.
2. $(X,Y)$ are scaled and shifted to vary between -1 and 1, instead of 0 and 1. The polar coordinates system origin is thus $(0,0)$, and the largest circle radius is 1.
3. The radius $R$ is computed as $R=\sqrt{X^2+Y^2}$.
4. The angle $\theta$ is computed such that $\tan{\theta}=-\frac{X}{Y}$. $\theta$ origin is thus set at the +Y Axis, and $\theta$ is increasing counter-clock wise, with $\theta \in [-\pi, \pi]$.
From world to texture coordinates systems
1. The radius is directly mapped to the $y$ axis of the texture coordinates system, such that Outer Margin is associated to $y=0$, and Inner Margin to $y=1$. This choice is arbitrary.
2. The angle is mapped to the $x$ axis of the texture coordinates system with some transformations. First, the interval $[-\pi,\pi]$ is mapped to $[0,1]$.
3. Then, a shift $\delta x$ proportional to $y$ and to the Swirl parameter is subtracted (because of the reversed process) from $x$. Mapping Outer Margin to $y=0$ yields no angular displacement at the external boundary.
4. The Repetitions parameter is used to scale $x$.
5. Finally, $x$ is folded back between 0 and 1 using a Warp node.
6. A B&W color mask to blacken radius greater than Outer Margin is made using Map Range and Color Ramp nodes.
7. A B&W color mask to blacken radius lower than Inner Margin is made using Map Range and Color Ramp nodes.
8. Both B&W color masks are combined in a single mask.
Resources
Repetitionsis the number of lines andSwirlis the amount of curve to those lines – Karan Jan 06 '24 at 11:58