Grasshopper

algorithmic modeling for Rhino

Hello everyone!

Im currently trying to generate a sine wave with graph mapper, but with the addition of having planar points to both the side of this wave.

So the goal would be to:

-Move the Sine wave around this domain

-Maintain always the same separation between points

-Change the domain extension of the sine wave, being the maximum length the entire original domain set.

I have been trying with consecutive domains component, but Im not sure its the answer, the sliders are pretty loose and the separation between points is not always the same.  

Views: 3323

Attachments:

Replies to This Discussion

?

Attachments:

Hello David, thanks for you answer. Isnt there a way of keeping the graph mapper in this case? So that when the sine weave does not start at 0, there would be a "jump" from the moment the wave starts.

Also the sine curve does not seem to "move" along the domain of points. By this I mean to maintain the sine curve's domain length, but vary its position inside the greater domain. Practically to have the same shape of the curve, but more to the left or to the right.

You can't get much information out of the graph mapper. You'd need to figure out the wavelength and 'zero' peak, which is not accessible from the outside.

If you want to control the sine using the peak location instead of the start and end of the wave, you'll have to adjust the equation slightly. Then you can have one slider which moves the wave left and right, one which moves it up and down, and one which changes the length of it.

I assume its a complex equation? I really got no clue how to arrive to that equation :(
There is a kangaroo component which creates a sine weave, and controls the phaseshift, frequency, amplitude, etc maybe this could be achived with it?
It's no more complicated than the one I posted, just have to shuffle the t0 and t1 around. I'm on the road now with only an iPad, so I can't post any more files.
Okay David, no rush, thanks for your help.

As David says move t0 and t1.

Something like this ?

For some reason I cant reply to you @Laurent Delrieu.

Thanks for your help, thats an interesting approach, but it does not suit my need.

First off I only need one curve.

A slider that controls the curves position inside the domain, being 0 totally to the left, and 1 totally to the right.

A slider which controls the length of the curve, to both sides. So that the curve grows from the middle.

A slider that controls its amplitude.

A slider that controls its frequency.

Thats pretty much it.

So now you can do it by yourself ? you have everything. It is simple math.

Im afraid I cant, the formulas you guys so kindly provided are quite far from reaching those controls, and just by looking at these examples I am afraid I haven't acquired the knowledge to re arrange them.

Anyone please? How can these controls be achieved?

Here's a solution that doesn't utilize equations for the less mathematically inclined :P

You can also directly plug in values in to the bottom left Construct Domain to pin-point sine start/end instead as well.

Adjust the Sine wave in your mapper so the Y value is right at the top for the height (/amplitude) slider to become relevant. (or I guess you can eyeball it if it doesn't matter so much) Be careful that the wave is right in the middle as the y values of all the points on the right can become non-zero if its slightly off (in your example its just slightly off-center).
I tried replacing the Graph Mapper with a Sine component to simplify things (just had to change the preceding Remap target domain to '0 to Pi') but for some reason it doesn't look as smooth/nice.. whelp.

Rereading your question, did you also want the points to be equidistant in 2 dimensions, not just on the x-axis?.. in which case Interpolate(IntCrv) the result and Divide Curve to get equidistant points I guess.

Hope this one is a bit easier to digest for you

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service