Creating a wave simulation _ tutorial 1

 

The trick is to have it stick to its corner’s and make sure the strength is enough to hold the movement.

 

Grasshopper creating a wave: I started off with Kangaroo with making a mesh plane, needs a rectangle, plug in values for C and Y use one slider to get a square, plug it into the Meshplane. Change the slider to an integer to get the height of our mesh. 24 divisions in X and Y direction, you can’t go to high in the simulation in Kangaroo, because of it’s life feedback.

Screen Shot 2018-11-07 at 4.55.22 PM.pngPut Mesh into geometry, get a timer (set it to 20 msec.) and grab a button for the simulation reset.

Force Object: springs for any simulation you need springs. Mesh edges: (add-on) WeaverBird Edges. WBEdges, that makes our connection and you need a rest length. Take a curve length of all of the edges. Put RestLength into Force Object.

reset simulation

Pull out a mesh preview to turn off all the geometry. Turn off the preview.

Deconstruct the mesh:

Do a wind simulation asks for 3 points. Triangulate the mesh plane and deconstruct that mesh.

Screen Shot 2018-11-07 at 4.54.35 PM.png

Now grab the individual vertices the 1,2,3,4 for the wind. Face type tells us we work with a triangle, it gives the index of the vertices, which corresponds with that face.

Screen Shot 2018-11-07 at 5.02.15 PM.png

We need to deconstruct that face, we need to 3 user list items. A,b,c into point 1,2,3

We need a wind direction:

Grab a multi dimensional slider, from -1 to 1 in both directions allows Wind direction in both directions. Create amplitude, create a slider for it max value of 20 plug into wind. Add it to Force Object. Flatten your force object, do not forget.

Screen Shot 2018-11-07 at 5.42.00 PMFlatten” changes the data structure inside a parameter. Sometimes it is necessary to modify the data structure because the default layout does not result in the desired operations. Imagine you divide 5 closed curves into 10 segments each. The result of this operation is a data structure of 5 lists with 10 items (points) each. If you were to Flatten this structure, you’d end up with a single list containing 50 items. If you were to Graft this structure, you’d end up with 50 lists of one item each.

Screen Shot 2018-11-07 at 5.06.18 PM.png

Now when you reset the simulation. You see nothing happening because the wind is flowing in a complete horizontal movement and Kangeroo, it goes flat around the surface, it doesn’t pick that up.

Add an addition, and to that vector add some Z direction now mesh takes off. Reapply wind factor, and mesh plane takes off. Screen Shot 2018-11-07 at 5.11.02 PM.png

Keep boundaries fixed in X and Y directions.

We need to stick it to the edges, but let Z free to move. take a naked vertices component and on each point create a line. with a start and length. take a move, move it by a Z factor based on the slider with ma value of 10. Need an expression — -(neg  X over 2)-X/2

Screen Shot 2018-11-07 at 5.39.50 PM.pngWe moved the points downwards, those are now our start points, our direction is our Z factor, and our length goes in L. It moves the point half of the distance and creates a line twice that length so you have a pos and neg space for our point to move. Turn all off.

Use a pull curve: go to Kangaroo, forces CurvePull, curve is the line, and points come from the Naked points.  Graft the opposite of flatten (“Graft” will give it a possibility to go from one pt to multiple points. Graft: from each point a series of points

Screen Shot 2018-11-07 at 5.58.19 PM.png

Graft the two inputs and plug it into the Force Object . Reset simulation and increase  height.

A mesh which has the borders fixed to a Z direction and the anterior faces/vertices free to move.

Screen Shot 2018-11-07 at 7.30.47 PM.pngReconnect the vector with some Z input reenable simulation and you should see a result. You see edge vertices do their best to keep boundary relationship.  The more force applied, the harder they find it to stick to the boundary. When do have Wave movement go back and forth they will keep that.

Screen Shot 2018-11-07 at 7.29.55 PM.pngIncrease strength from 100 bring up to 1000. Pulls it a bit closer.

Create a wave movement: 

(Move components related to kangaroo to the right. making space.)

Use side waves to sort of give the mesh some wave movement. Include also the other forces. deconstruct the mesh, collection of vertices (see the tutorial on creating side waves) . Use a method to create a wave disturbance with a point distractor.

Screen Shot 2018-11-07 at 7.34.34 PM

Surface-based on a rectangle, reparameterized and multiple sliders. Take the distance between points a and B run it through the Sin function. Expression A*sin(x)

Screen Shot 2018-11-07 at 7.38.18 PM.png

(Amplitude of SIN of X)

 

Amplitude with a value of 10, now you get a height value. Show it:

 

 

Time: 15:49

Messy result, might one to change the distance with a slider. Check this in mine. Smoother wave!

 

 

 

Do not forget Illustrator files goes into Rhino! They both with vector

Animate the wave:

grab a counter counts the values. Put a timer in the counter. add a plane and see how it is counting off. You can delete the plane.

Screen Shot 2018-11-07 at 9.12.55 PM.png

ANd use an expression: X modular y divided by Y

X%Y/Y (value remains between 0 and 1)

Also create an

X%Y

set value of the Slider to a 100.000

Now we are going to multiply the X%Y/Y

2*pi*(X%Y/Y)

and changeA*Sin(X) to A*Sin(X+Y)

Plug

2*pi*(X%Y/Y) into A*Sin(X+Y)

Animates the wave motion

 

 

18:46

Now you can get rid of the points and now put Wind back into simulation: Force and reset it.

remove the Z

 

 

 

 

 

Leave a comment