Hi everyone.
I’m new to Grasshopper and I achieved some really interesting results by learning things here in the forum, really appreciate the community!

Right now I’m stuck with a problem that seems to be way too advanced for me.

I want to design these lines so each one form some kind of a “leaf” shape. I achieved that by using the Rich Mapp Grapher to remap an amplitude scale to move some of the control points of the curves to draw two Nurb Curves from them. One is “positive” and the other “negative”, and the Start and End points are not affected by the Map Grapher, so I merge them and create a surface from each closed curve.

So far so good and the code seems to works well enough for what I need.

The next step would be to create a way of manipulating the size nad shape of these surfaces depending on their proximity to a circle. Let’s say I have a circle placed somewhat in the center of the surfaces. Everything that’s outside the circle gets shrinked down by some factor, retaining their positions but changind their sizes, control points and whatnot. The points that are further away from the circle should shrink the surface more, so it won’t work to only change the size of the whole shape.
Anything inside the circle remains the same, like this:

I studied the Proximity 3D component, and it seems like it could help me achieve this result, but I’m honestly clueless about how to use it to distort the surfaces so much.

Any help or directions will be very much appreciated!
Thank you!

complication: you will notice that your curves are generated by interpolating many more points than necessary (A)
despite the curve being “ok”, if you check its control polygon (B) wil see it’s made of many more points than necessary

this comes from the very beginning, where your C input is not grafted in these locations:

you have a point B which is the center of the circle, and you measure the distance between each control point of your stripes and the point B

if the distance is less than value R1 (value of your circle) then nothing happens

else if R1 < measured_distance < R2 then “something happens” to those points/curves/you tell me
the way this transformation happens can of course be also controlled by graph mappers

@inno wow, it’s working so much better now! Graft, of course!
I was getting some weird issues in some more complex examples, now it’s working perfectly thanks to you, I really appreciate your time!

So, about the distortion, my intent is clear but my geometrical knowledge is foggy!
Ok I put some more thought into it and that’s what I come up with.
We have those curves in the beginning, before anything.

First we create an Ellipse 1 somewhat in the middle of the points (doesn’t matter exactly where).
We trim the curves with Ellipse 1.

Ellipse 2 will be the shape that will affect the control points in the surfaces.
4.1 Inside Ellipse 2, Control Points will move towards the outside of their shapes following the perpendicular vector from the Tangent of the curve like in current code, creating that effect of becoming thicker. At the center of Ellipse 2 this effect is maximum, at the edges the effect gets to zero - it would be great to control that in a Graph Mapper indeed!
4.2 Outside E2, Control Points will move towards the center of their shapes following the same vector but inverted, creating the impression of “shrinking”.
Control points that are further away from Ellipse 2 should suffer this effect more,Graph Mapper again?
The control points that are on the edges of Ellipse 1 stays there, they don’t actually move anywhere.

I would approach the problem by first finding some more points on the curve we’ll be influencing: the more points are evaluated along the original curves, the more “defined” the elastic behavior will be, but this will also result in weird effects where the direction drastically changes

for instance, where the previous point lies inside E1 and the next point lies outside E1, there you will have a sudden change of direction

relevant data might be the distance from any given point from ellipse1 and ellipse2, their relationship inside/outside from ellipse1 and relation between points and ellipse2 (we are just interested in relations = 1 which means the point is exactly over E2 so it should not be changed) and the perpendicular vectors to the curve on each of our point

at this point it’s just a matter of Sifting the data in such a way only the points you are interested on gets influenced

I think it kind of works the way you have described, but the final result is not flowing nicely as you mighe be expecting… will need for sure some tweaks

@inno thank you so much for your help!
I was finaly able to take a closer look to the file.
After a few hours studying the code I don’t quite understand what you did there, a bit too avanced stuff for me!

It’s not quite working properly so far, but I’m at the limits of my math and grasshopper knowledge, I feel I need to go back and study basic stuff before moving on and try to ask the right questions. I can’t even create a surface from the final output anymore

Thank you veyr much for your effort in helping me, I will study your code for a couple of weeks for sure!

Here’s the core of the whole logic, I subtract line A lenght’s from line B’s.
If the number is negative, it means it’s inside E2. If it’s positive, the higher the number means the control point it’s more distant from the center. I will use this as the “factor” to control how much the control points will be affected by the previous Graph Mapper (that was already working properly). This way I don’t need to divide the curves and add any extra step.

I take the subtraction numbers and add it to a new Graph Mapper, inverting the results with a bezier, but never getting to zero, otherwise the curve disappears. So the bigger the distance, smaller it will be the outcome.
All the negative results (that were inside E2) ends up getting a 1 result this way. The positive results will get somewhere around 0 and 1.
I also added another controller (Line Strength 2) in the ReMap, this way I have another layer of control over how much the results will be affected.

Finally I multiply the new ReMap by the previous ReMap.
Smaller numbers (which are more distant from the center) will get less affected by the distortion.