Attractor Curve with Variable attraction strength along the curve

GH Code-Variable attraction Strength.gh (28.3 KB)

Hello. I have been working with attractor curves with rectangles and have reached a snag. In the normal attractor definition the attraction distance is same along the length of the curve. My desired output is to create a variable attraction (which is adjustable) along the length of the curve as shown in the image.

Any help would be appreciated. Thank you.

Here is one idea:


GH Code-Variable attraction Strength_V2.gh (30.1 KB)

Thank you very much. This certainly helped me a lot.

1 Like

Hi,

Sorry for tagging along 2 years later but I’m currently having a bit of a similar issue with my definition.

I’m currently using attractor curve to push and pull a surface up and down in the Z axis. I would like to acheive an apex at the position matching the center of the curve and tapering down towards the ends with less effect. As per the attached screenshot:

I’ve been trying to adapt Adam’s from rectangles to curve but cannot find why the definition is not working. Could anybody help me solve this please?
Variable Strength Attractor along curve.gh (100.0 KB)

This thread has a great title. The first thing that came to mind was using the ‘t’ value from Crv CP to determine position along the attractor curve, which I see that @Adam_M did. I would think it would be more useful if the curve (‘C’ input) were reparameterized so the ‘t’ value would be between zero and one instead of the values you see now? Oh look, the output of Graph Mapper is “clamped” to “0” or “1” because that’s the default domain.

domain_2023Jun21a

I see some pointless code below at the Sort component where the ‘K’ input is a single value (Average) instead of a list? What’s the point of sorting a single value?

Finally, I see that you are summing vectors again instead of focusing on distance values from the attractors. It might amount to the same thing (I’m not sure), but it’s a distraction from all the attractor code I’ve ever seen, which is quite a lot.

I’ll leave it at that.

I simplified this quite a bit, I left the purple group, though believe it’s an odd construct and could be done using Crv CP, as it is in the blue group.


Attractor Strength along curve_2023Jun21a.gh (20.3 KB)

I started looking at this and quickly realized that a single Crv CP could be used for both purposes, using either Crv 1 or Crv 2.


Attractor Strength along curve_2023Jun21b.gh (15.4 KB)

2 Likes