Grasshopper

algorithmic modeling for Rhino

Hello all!

I'm learning to do some C# scripting with Kangaroo. I was wondering if there was a built-in or easy way to test for convergence of a simulation within the Library, or do I have to make my own checks on particular geometry?

I'm trying to script a kinematic chain that adds nodes as needed, which requires adding geometry and goals to the model after running kangaroo, and then re-running it. Right now I have to check the geometry after every step to see if it has converged within a certain tolerance...

Thanks!!!

Views: 723

Replies to This Discussion

Hi Oliver,

You can use KangarooSolver.PhysicalSystem.Getvsum() as a check for convergence.

This returns the sum of the squared lengths of the velocity vectors of all particles, so when it gets close enough to zero things can be considered to have stopped moving.

There's an example showing this in use here:

https://github.com/Dan-Piker/Kangaroo-examples/blob/master/scriptin...

Hi Daniel,

Thank you so much! that is exactly what I was looking for.

You Rock!

Oliver

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service