# How to create a sine wave from a line or spline?

Greetings!

I’m a Highschool student, and am just starting to learn Rhino and Grasshopper. I have a little project and would appreciate some advice on which elements I can use to do this.

I want to start with a line or curved wall in Rhino. In grasshopper, I want to generate a sine wave along the liner. With sliders for Amplitude and frequency, so I can control the infill. I then want to offset to create the outer lines of the wall and close off the ends. I’d like to have a slider that controls how much of an offset from the sign wave. Like touching to some space in between the sign wave and wall. The end result will get extruded into a 3D wall.

So, Any advice on which grasshopper functions I can use to achieve this? Or is there already something on Food4rhino that does this.

Just learning, watching a lot of youtube, I understand loading the Rhino line into Grasshopper. I’m not sure if I need to segment the line first to create the sign wave?

Max

It’s reasonably straightforward to add a sine-wave curve around another curve, but when that curve has sharp kinks the result will probably not look very good.

Having the sine-wave expand until it fills a container shape will also be pretty tricky. I can’t even really think of a good approach other than perhaps some Kangaroo magic where you treat the wave as an elastic rod with bending forces. But that is well beyond my meagre Kangaroo skills.

4 Likes

Thanks! I’m learning, I figured out how to control the FREQUENCY with the Z slider, and I added an offset to create the inner and out wall.

Thanks!

Indeed … but is very very tricky, and slow and … er … incomplete (SC collisions are MIA [V1A has them], but they would require a far finer resolution and thus greater elapsed times == a genuine rabbit hole case).

K2_FitCurveInClosedCurve_V1.gh (130.1 KB)

V1A soon.

Peter,

What I’m trying to accomplish is to create an architectural wall with that "Corrugated “infill” This is what is used in printing concrete walls. So I’m trying to figure out the workflow to go from a perimeter wall to a wall outline with the corrugation. That would be extruded and sliced to 3D print.

Here is a real world example:

Hi, sorry in advance if this isnt very helpful to you, but I was wondering (I have no idea how those printers work or the software used), but isn’t the infill done automatically by the printing software? Like a standard 3D printer?

Also as a side note, the infill looks more to me like a standard polyline than to a sine-wave. Maybe that could sinplify things for you?

A polyline would be fine, How would I implement that instead? Actually, they print right from Grasshopper. I haven’t got that far into Grasshopper to see its ability to generate the gcode. But that is how they do it.

Thanks

Your goal makes sense … but controlling variables (in the likes of K2) for any “expansion/fit” within any boundary (the general case) is challenging.

On the other hand if you are OK with a zig-zag polyline that could dramaticaly reduce the N of K2 Goals. I guess that the best compromise is to use a poly and then fillet the nodes.

There’s some signs of hope (but for a “best fit” self tuned K2 solution … long is the path [and hilly])