algorithmic modeling for Rhino
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...
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:
Thank you so much! that is exactly what I was looking for.