Let’s say the bigger linear rectangle curves are “green” and all the smaller rectangles around them are “plots”
I have exploded the green, found their centres and got vector direction of each exploded curve by getting vector between the exploded curves midpoint and the green’s centre.
Then I’m trying to move the exploded curves of green in the vector direction I got before in an increment of 10 steps 10 times, so it moves 10 units with every iteration. By the time it reaches the final iteration of 100 units, if it happens to intersect any “plot” I’d want the exploded curve to stop moving forward and add the plot it intersects with to a NEW LIST
Id be highly grateful if you could check the gh.file I attached above and help me rectify where I’m going wrong
Basically, if you want to animate something in GHPython, you need to implement an “animator” first, something that drives the animation, commonly referred to as “counter” or “timer”.
This is usually done by recomputing the GHPython component and storing persistent data that you want to keep between iterations in globals() or the sticky dictionary. When the GHPython component recomputes, all your Python code goes out of scope and everything gets cleaned up, that’s why you need the latter step.
Here’s an example of a simple counter that, well counts up to a certain number of seconds.
I use globals() to make the needed variables persistent between recomputes.
To make this clearer, you can use the same principle to move geometry, by for instance moving points with vectors each step/iteration and storing their positions between steps.