# Sharp Attractor Curves

How can I achieve a surface like in the attached photo? I’ve tried a few methods, but all ends up being “smooth”. On the surface in the image, the curves are affecting the surface in a sharp or sudden way, rather than it being smooth.

I have tried attractor curves, as well as attractor curves with graphmapper to create surfaces, but all ends up being smooth. Would Kangaroo be a possible option for something like this?

You could use Kangaroo, but I don’t think it’s needed here.
Instead I’d use inverse distance weighting to make a height field like this.
sharp_curves.gh (11.4 KB)

The key step here is making a mesh with vertices on the curves you want to keep sharp. One way of doing this is to split a surface with the curves, rejoin it back into a polysurface, then mesh it.
If it’s actually just the contour curves you need you could also do something similar with splitting and dividing straight lines, then moving their points with the same distance logic.

6 Likes

Just checked the script you provided and I think I understood most of your logic, and assuming that the “weighted average” does the trick of moving the points based on the distance between the curves?

Also, why did you use “Duplicate Data”? I don’t think I’ve ever used that one. These studies help me improve my grasshopper knowledge, so understanding the logic behind it is important for me to be able to apply the idea for future designs.

Thank you very much for the script by the way, it is really helpful!

Using the inverse distance as an input weight for the weighted average is a way to make sure the height at the curves is exactly the given value (because as the distance tends to zero, the inverse distance tends to infinity, meaning that value overrides all the others).
This is a form of Shepard interpolation - a nice simple way of interpolating values I frequently find uses for in Grasshopper.

As well as the heights for the curves, I included a ‘background’ height, so that away from the curves it tends towards a flat plane, and this needed a weight too - that is what the ‘Duplicate Data’ component is for - so for each set of 4 weights for the curves there is a corresponding copy of the background weight value.

2 Likes

very intersting approach i usually do it this way, it is always good to look into new methods !! sharp_curves_1.gh (19.5 KB)

2 Likes

The difference between using only the closest curve and using an inverse distance weighted average of all curves is most apparent near where they cross. Both can be useful, depending on the effect wanted

3 Likes