How to correct stretching of the texture in curve?

I want to apply this texture to the curve. But the scaling of texture stretches (right end) whenever I extrude the control points.. And If I add subdivision, it is affecting the other segments of the curve texture... How can I apply the texture uniformly to the curve? I didn't convert the curve into mesh.

Resources:

• The solution would be to subdivide but you say that you don't want to, there may be another solution... Commented Apr 25 at 11:40
• And the other solution is? Commented Apr 25 at 13:16
• I meant maybe someone knows another solutionbut I don't ;) Commented Apr 25 at 13:36
• Should be possible to do it with geometry nodes. I added the tag for geometry nodes experts to spot it easier. Commented Apr 25 at 14:21
• As mentioned before, the solution could be to subdivide. Another ways will be to convert to mesh, use the looptools to space the vertices and convert back to curve, but you will basically add subdivisions after that Here is an example
– Emir
Commented Apr 25 at 14:42

Since you also asked for a solution based on Geometry Nodes, here is a suitable answer:

It may look a little complicated, but essentially I just use the Curve to Mesh node here.

All other nodes are only used to create the UV mapping correctly.

I use the spline length of the base spline for $$U$$, and the factor of the profile curve for $$V$$.

However, in order to avoid the common problem of incorrect mapping when using cyclic splines, I also use a few math nodes to check which value should be used here for the end of the spline.

PS: If it doesn't work well in your case and you actually have to resample the curve, you can also use the Resample Curve node:

...And you can of course use a lot of other solutions for this, such as this one, but in this simple case the solution shown here should work well.

(Blender 4.1.0+)