# Stretch Noise Displacement along Curve - Geometry nodes

I'm trying to stretch a noise texture along a curve. Normally, my basic normal texture displacement is as follows:

Say I want the noise to stretch along the x axis. Easy enough. Just multiply the noise mapping vector.

But say I now want to modify the curve to point not in the global x direction. How can I stretch the texture along the curve tangent, rather than global space? I realize I could add noise to the curve circle profile, but I don't want a completely constant cross section.

My vector math skills are rusty! Thanks!

• Lovely. This is brilliant. You are an accidental genius. Imagine if the above were grease pencil, your attempt to make jaggy lines. I can see many uses for your node work above. Dec 20, 2023 at 8:58

We want to map the texture as if the curve was straight along X.

The black line is the curve.

The plane is a little part of the bevelled curve and the green dot is a point of it.

The blue dot is the curve point that originated the green point.

We want X axis along the curve tangent. Y axis along its normal. Z axis along its binormal (the cross product of the tangent and the normal).

If we want to know X, Y and Z components of the green point in this coordinates system, we'll need to know:

• Blue point position
• X position along the curve
• The normal
• And the binormal

(is there a more simple way?)

So we capture these four information above before converting the curve to a mesh.

Once done, we use them to recalculate the coordinates for each point of the resulting surface.

The dot products retrieve the part of the green point position relatively to the blue point, respectively along Y (normal) and Z (binormal):

I've used a checker texture instead of the noise in order to have a better view of the results:

(Blender V4.0)

• Awesome, thanks for the vector explanations!! I Tried using cross product of normal and curve tangent to get the binormal as that felt natural, but wasn't using capture attributes. Thanks!
– Erik
Dec 20, 2023 at 17:50

You can use UV coordinates for the noise, with the simplest implementation of the UV not giving you a clean seam, but an interpolation across the one face loop near the seam, which is desirable in this case:

I positioned the camera to show the UV seam, which is rather sharp because of the somewhat high resolution of the Profile Curve, and yet the GIF shows you don't really see the seam in the topology - there are other artifacts nearby because the mesh folds onto itself due to too strong displacement of too rough noise:

However what if you stretch along the Profile Curve rather than the main Curve?

Now the discontinuity becomes clear. However, we have 4 dimensions available in our noise, and are only using two, so we can fix that by adding a dimension:

Don't look for a seam, there is none:

## Homework

What if the main curve is cyclic? Can you use a 4D noise to get rid of the seam?

• So you mapped the entire curve surface onto a 2D plane, where (0,0) is the start of the curve profile and start of the main curve, and (1,1) is the end of the curve profile and end of the main curve. In the second example, you used the X,Y position of the curve along with the Z component, which is the spline parameter (0-1). And then used 3D noise. For a cyclic curve... you could instead use the W parameter instead of the input vector, as each point along the curve could map to a different phase. You could make this symmetric with some kind of float curve? I'll work on this...
– Erik
Dec 20, 2023 at 17:46
• @Erik for 4D do the same for the main curve as I did for the profile curve for 3D. Then you end up with one curve XY, and other curve XY, totalling 4 dimensions. Dec 20, 2023 at 18:23