algorithmic modeling for Rhino
Hi all,
I am learning to write C# code and am trying to simulate what Kangaroo could do with spring forces. In the attached gh file, I am working on generating polyhedral forms with spring and repulsive force, as described by Jak Drinnan in this post: post: http://www.grasshopper3d.com/group/kangaroo/forum/topics/images-of-...
The upper half of the file contains what I duplicated from his Kangaroo script, while the bottom is my attempt to do it through C# with node, edge, and graph classes.
First question:
It seems like the C# version is unable to reach equilibrium. I am wondering if it is because of the solver method used (simple time step, dt), as I noticed that with the Kangaroo version, when higher number of vertices is acting as input, it is more likely to reach equilibrium with the RK4 solver through Kangaroo Settings.
Second question:
It seems like the repulsive force (Plaw component in the Kangaroo version) in both versions is not really doing anything, as the result does not really differ with or without it.
I would really appreciate it if anyone would kindly give me some pointers or suggestions!
Thanks a lot,
Tim
Tags:
Short answer, you should calibrate the parameters.
The mass-spring systems are very much dependent on the value of the parameters (stiffness, damping...), so you must correctly adjust the values to reach the equilibrium. The same thing happens with the Power law goal, you must give the correct parameters so that it has some effect. Also, you can find the RK4 integrator code on the internet in javascript if I remember correctly (I'm sorry but I have not saved the reference). Piker has 1000 times more experience than I do but I do not think that the integrator guarantees a better arrival to the equilibrium, the key are the parameters of the system, the solver only guarantees a better approximation for the physical simulation.
One trick that can help you reach equilibrium is to add a drag force that is in the opposite direction to each particle velocity with a proportional value like v*-0.1 at the end of each step. Or give smaller values for dt. But above all, I think you should try different configurations of springs, using the edges is often not enough.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by