# 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:

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:

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.)

• the Simple_Spiral "has" already that weird radius. Is this intended? [1]: i.sstatic.net/IHctV.jpg Commented Jan 27, 2022 at 17:54
• @Chris It was just me testing the radius for purposes of the GN modifier. The radius is fine; it'll be smooth if you set the curve to bevel (although weird looking.) The problem is the deformed mesh failing to interpolate that radius. Commented Jan 27, 2022 at 18:24
• Ok, thanks for the info Commented Jan 27, 2022 at 18:49

I don't think I can do any better than what you have already tried:

1. Collapse the mesh onto the curve
2. Sample the radius of the curve on another branch, from a separate conversion to points
3. Attribute Transfer the radius from the other branch to the mesh, and scale the mapping by it...

.. but the points at which the radius are sampled are not the points onto which the mesh has been collapsed, and the transfer does not interpolate. So you have to over-sample the curve's radius to reduce sampling errors.

The over-sampled result is OK, but suffers from a second problem: no matter what you set the radius interpolation of the curve to in its 'Geometry' panel, it's 'Linear' like all other fields, when imported into GN....

... and you have to figure out the over-sampling yourself, if you want to be economical....

I think we just have to hope that Sample Curve returns Radius, as well as the other attributes, in a future revision of the node. That would avoid a lot of wearying hackery, in this, and other cases.

• +1 ................. Commented Jan 28, 2022 at 12:16
• @Chris ............... I promise I'll try to avoid answers involving this group in future... ;) Commented Jan 28, 2022 at 12:25
• i don't understand...!? why? what group? Commented Jan 28, 2022 at 12:27
• @Chris I thought the dots were a reference to the mileage I was getting out of the curve-deform, as previously discussed :) Commented Jan 28, 2022 at 14:02
• Thanks for taking a look. I think it's probably the case that this just can't be done better than by sampling as many points as you can afford to. I'm going to leave the question open in case future GN changes make better solutions possible. Commented Jan 28, 2022 at 17:07