# Geometry Nodes: Control over Sine wave used to Set Curve Radius

I would like to control the radius of a Curve using a Sine Wave, such that the diameter of the resulting mesh gets thicker and thinner along the length of the Curve.

I've managed to achieve this with the following node set up. (Apologies for the multiple images as I don't know how to take a high-resolution screenshot that captures the entire node group.)

(.blend file also available here).

However, I would like to be able to introduce flat spaces between each 'wave' on the Curve, and control the width of each space.

Here is a very rough approximation of what I'm trying to achieve:

I did find this question and answer that seems close to what I'm trying to achieve (converting a Mesh Line to the waveform I'm trying to create), but I couldn't figure out how to apply the information in this post to my scenario.

I have been experimenting with introducing the Clamp, Maximum and Minimum nodes into the tree at different places, but haven't quite been able to get the effect I'm looking for.

I made it anyway...

blender file

• Phenomenal sir - math like this is kinda like black magic to me, though your comment in the other answer does help a lot with my understanding. Much appreciated! Commented Sep 24, 2022 at 0:47

I wrote a function that is identical to your desired one:

https://www.desmos.com/calculator/1zc47tnig5

I didn't converted it to GeomNodes but you see the idea. A sign function of the sine multiplied with the sine itself, and this raised to 0.4.

With the "a" parameter (the slider) you can vary the distance of the hills (and their shape).

• I'm a bit stupid when it comes to math but I think I should be able to figure this out. Once I do I'll accept your answer (Upvoted for now). Your equation looks really useful - thank you! Commented Sep 24, 2022 at 0:06
• It seems to be a little geeky, but I try to explain, it is actually quite easy: There is a sine wave in the sign() function. If sine is negative, sign() is -1, if positive, it is 1. We must offset to +1, so it will vary from 0 to 2. Then divide by 2. If we multiply this by the original sine function, it will cut the negative half. The ^0.4 is shaping the sine wave so that its sides are more perpendicular to X axis. Commented Sep 24, 2022 at 0:20
• It's 1am where I am. I may need to look at this tomorrow :) But I definitely will, and appreciate you taking the time to explain. I'm sure I'll be able to figure this out after some sleep! Commented Sep 24, 2022 at 0:34