Kangaroo Water bubbles :)

Hi Guys,
I have started to dig into Kangaroo :kangaroo: . Trying to make interactive bubbles.

  1. But first experiment I am doing is a simple line collision.
  2. Does anyone have a simple example of two non colliding interactive blobby shapes ? like soap bubbles but with control of their position.

Can you explain why simulation does this strange thing and if there is a relationship between different goals strengths ?

Hi @DanielPiker your blog is an amazing resource, but can recommend something more basic with description of all kangaroo components?

Thank you

kangaroo_Test.gh (11.9 KB)

Also is it better to work in mm? Does Kangaroo has a preference?

Hi @arten
Here’s a slight modification that should work better:
kangaroo_Test2.gh (16.6 KB)

The strange behaviour you were seeing was because the Angle strength was a couple of orders of magnitude higher than the Length strength.

In general, for simulating something like bending of a thin rod, the axial stiffness (Length) needs to be higher than the bending resistance (Angle). If you think of bending as stretching on one side of the cross section and compression on the other, the amount of material deformation it takes to curve the rod is very small compared to the deformation involved in actually stretching the whole thing axially to change its length. So I don’t think you could ever have a material in real life that was this much harder to bend than it is to stretch.

Like the rest of Grasshopper, Kangaroo isn’t affected by the units of your Rhino doc. If you want to set forces in real life units, you just need to be consistent, so if your Rhino file is in m, your forces should be in N, and Young’s modulus in Pa (see also my reply here).

I don’t think this is relevant here though, since it seems this simulation doesn’t need to be based on actual known numerical strengths. So just choose what works for the effect you want. As a general rule of thumb, keep Length strength higher than Angle strength when simulating bending.

1 Like

Thank you @DanielPiker it make sense now. Length default value was 10.

I will keep experimenting, I probably will develop a sense for these things…

I want to try with 2 or 3 bubbles and see how I can interact with them …

Thanks again

What is the reason you have multiplied length two 2? Can’t you just make more subdivisions?
Or you keep initial length and then set target one?

I added the length multiplier just to make it easier to start from the current length as the target length (by making the multiplier 1) and gradually increase it.
Making more subdivisions is tricky to do while the simulation is running. Generally if you want to change the number of particles and what they connect to during simulation it requires scripting.

I’ve also been playing a bit with simulation of liquid blobs:

and here’s an experiment I made with dynamically reconnecting them:
liquid

18 Likes

@DanielPiker
It looks AMAZING. It is basically what I was trying to get too. But I don’t want to copy your solution, I want to understand how it works.
My goal is to create a dynamic tool for bubble diagrams… something like this

Can you give me a hint how to start :wink:?

Oh man it looks so nice :+1:

Try the definition from here:

1 Like

Thank you will do

awesome @DanielPiker, that reminds me of this simulation.

2 Likes

Hi @ErickVasquez it does look great.

Hi @DanielPiker thank you for the example you gave I think I starting to understand how it works.
Can I ask a couple of questions:

  1. What the difference between solvers ? Solver, Step Solver and Bouncy
  2. Which one to use in what situation?
  3. What show component does?

4.And most important is why interaction is so slow, or to be more precise why Rhino viewport do not respond while simulation is running?
And I can’t double click on a Boolean Toggle in Grasshopper, I have to click escape to be able to do it.

I have attached two videos with Solver (where rhino is not responding) and Step solver (where viewport works but one mouse click at a time)

Thank you.
squishycurves.gh (24.3 KB)

Ok did a couple of simple tests just to see when Rhino and Grasshopper starts to have a problem.

  1. With 10 lines starching with Kangaroo length everything works fine
  2. With mesh stretch of 10by10 cells works fine
  3. But as soon as I increase cells num to 25 everything just stops ((

Just to explain a bit better. It looks like while kangaroo is running a simulation rhino and Grasshopper viewports do not respond, only when simulation is finished Rhino and Grasshopper are back to normal. But a s soon as you change something and simulation kicks in all stops and the only way to get control back is to hit “esc” multiple times to quite the simulation.

I have attached the video. Watching others simulation videos I think it is only Mac version problem.

@DanielPiker and @dan could you please take a look?
Maybe It just a system setting you have to change?

Thank you guys

Test_set.gh (8.8 KB)

Thanks @arten

I hadn’t realised this was happening on Mac. I usually work in Windows, and had only tested smaller simulations on my Macbook. It looks like something strange is going on with the Kangaroo updates blocking Rhino/Grasshopper interaction. We’ll have to look into it. Thanks for the videos and letting us know.

To answer the other question about the different solvers:
‘Solver’ should usually be the first choice. It updates the output as it is automatically iterating, and tries to converge as fast as possible.
‘Bouncy Solver’ also updates the output as it is automatically iterating, but particles have more momentum, so they bounce around more. This makes it slower to converge, and potentially less stable, but is sometimes preferred for the visual effect, and can make it easier to see what is happening when the regular solver converges too quickly.
‘Step Solver’ doesn’t iterate automatically like the others, it only takes a step and updates the output when the input updates. The main use for this is creating animations from a slider. If you connect a slider and use Grasshopper’s built in animate slider function, it means it will capture one frame for each solver update, which will give a smoother animation than using a screen capture.
‘Zombie Solver’ does all the iterations (either to convergence or reaching the max iterations limit set) before updating the output, so you only see the final result. This makes it behave more like a normal Grasshopper component, and can be useful if you want to include Kangaroo in another looping plugin like Galapagos.

1 Like

Thank you Daniel for very detailed explanation. I will keep learning Kangaroo.
Maybe I would consider installing Win over bootcamp so I can work.

Should I somehow report a bug ?

Thank you for your help

Hi @DanielPiker,
How to slow down the simulation? I am doing a simple particles / gravity sim and it is very fast.
I tried to use Step solver, bout it looks like I doing something wrong…

btw watched your lecture at STRELKA , very interesting :wink:

Particles.gh (11.9 KB)

Hi - just change the force to a smaller number - e.g. -0.1 or -0.01.
-wim

Hi,
I was really hope to to use real world numbers?
Lowering the force only works with step solver, don’t understand why it doesn’t work the same way with simple solver?

Hi @arten,
Your simulation only has points falling under gravity, with nothing else resisting it or holding them together, so they will just fall straight down to infinity.
If you want them to be chained together, add Length goals between them. If you want them to hit the floor, add a Floor goal.
With the Bouncy solver and Step solver, you have an option called ‘Iterations’ or ‘SubIterations’, which control how many internal iterations the solver takes between updating the output. The default is 10, but if you reduce it to 1 the result will move more slowly.
As I said in my descriptions in my last post, the main intended use of the StepSolver is for slider animations, not interactive display like this. Here I’d normally use the Bouncy Solver.
The simple solver behaves differently because it is trying to reach the final equilibrium solution in as few iterations as possible, not to show the dynamics.

Also - I wrote a longer description of how Kangaroo deals with dynamics in this thread

Hi @DanielPiker Thank you. Everything is clear.
Sorry for so many questions, I found lots of tutorials on Kangaroo 1, but it is a bit different from version 2.