Grasshopper

algorithmic modeling for Rhino

Dear All,

I am writing python script from Daniel Shiffman book "Nature of Code" for Processing.

Basically it is simple script that follows the rules of moving elements that attracts each other.
For instance 5 movers are always attracted by each other.

The issue I have is that every time the script runs it becomes slower and slower.

Please firstly look at printscreens:
https://dl.dropboxusercontent.com/u/92943807/movers_printscreen1.png

https://dl.dropboxusercontent.com/u/92943807/movers_printscreen2.png

https://dl.dropboxusercontent.com/u/92943807/movers_printscreen3.png

The script runs so that each time it adds position and velocity to previous ones.
Before I thought that I could simply clear "posList" and "velList"  lists by function " del listname[:] " in order to have only 1 position and 1 velocity vector in a list.
It did not helped much and when I add counter from kangaroo so to see the whole process step by step the whole script is just too slow.

Could you please take a look at python script in order to help me?

The code:
https://dl.dropboxusercontent.com/u/92943807/1_movers.gh

Tryout by render to see the movement of movers attracted by only 1 point, that worked in comparision quite fast:
https://dl.dropboxusercontent.com/u/92943807/New%20track%201.wmv

Views: 166

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service