Skip to main content

How to implement radius in a geo-nodes curve modifier?

I was looking at @RobinBetts excellent answer in how to bend geometry with geometry nodes and trying to edit it to recreate full curve functionality, but I'm getting stuck with handling the radius property of curves.

The best I've managed to do so far is this:

enter image description here

where I'm creating a line mesh from the curve (so that I can transfer radius by index), and then using that to transfer the radius by length along the curve to the rest of my nodes. In addition to feeling very clunky, this creates a few problems:

enter image description here

The radius doesn't interpolate along the length of the curve-- I'm just getting it from the nearest vertex on the line, which is getting it from its corresponding curve control.

I could subdivide the line and transfer it to create some interpolation, or I could create some geometry for the line to get linear interpolation, but even if I do that, I won't be acquiring the actual radius from that point on the curve, not a radius that uses whatever interpolation mode is set for the curve, the way that I could with tilt.

Are there some other, better ways to create a curve modifier that uses the radius of the curve?

For convenience, which is almost entirely Betts's work from the link above, just my current, screwed-up radius implementation (and some simple bounds-clamp+stretch stuff.)

Nathan
  • 25.2k
  • 1
  • 24
  • 72