# Deform Object to Follow Curve With Geometry Nodes

I'm creating a rope with pennon flags using a curve object and Geometry Nodes.

The issue I'm running into, is that the end of the pennon flag is not rotating along with the curve rotation, because I'm instancing the flag object on the curve. Is there a geo-nodes setup that I can add to my node setup that will rotate the flag to align with the curve? Thanks!

• When you are wondering if the instanced objects are correctly oriented on the curve, you should actually output the resampled curve on which you instance them, not the curve you are using for the rope because they are obviously different. Dec 13, 2023 at 8:55

The issue here is with the resampling process. Since you're downsampling the curve, you are not working off of the same exact curve that the wire is on. You need to sample the curve at the nearest index and retrieve the tangent data, which you can then pass along.

EDIT 1: Here's the same curve, with resampling passed through or not respectively. We can see that we'll need to sample that first curve before we do the resampling, and pass that tangent data through.

We can then capture the tangent along the initial curve, and it should align much more nicely with the curve. Hope this helps.

The diagnosis is the same as Iotw's answer: under-sampling. The fix is different.

When you Resample a curve, the Tangent vector is picked up from the new approximation. (If you instance a larger number of flags than you probably want, this way, you'll notice they align more closely to the curve)

If, instead, you use Curve to Points:

.. the points' attributes are sampled from the curve, as evaluated at that node's input:

..so then, the accuracy of the approximation of Tangent depends on the curve's original resolution. not on the number of flags.

• Thank you both very much for your help, but this does not fix my issue. Maybe I didn't explain it well enough: I want the top part of the flag object, to actually be rotated to fit the curve exactly. In your blender file that you provided, if you rotate the curve, the two sides of the flag still are straight, and they don't rotate along with the curves rotation. I will edit my post and add another photo, that I screenshotted from the file that you sent. Dec 13, 2023 at 14:43
• Hello @RyanKingArt .. if you mean the flags would be subdivided, to deform, would something like this be too complicated? Dec 13, 2023 at 19:04
• Yeah, that's that I mean. Looks pretty complex, but I will give it a try. Thanks again! Dec 13, 2023 at 19:51

Using this dashed line setup,

flags could be extruded and set to a position created by moving one point from each dash along the original spline's normals that is then sampled with the dashes' spline index:

The total setup looks like this:

With this being the result:

The flag direction can be changed with ctrl + t, or by adjusting the "tilt" from the "n" menu.