I’ve been working on a relatively large GH definition that will iterate through a list of frames for an animation. As an input I have list of frames and a float to smoothly interpolate through them, with one output frame, which will be used to orient geometry with.
For the purpose of an animation, the interpolation is essential: A slider will be animated from, let’s say, frame 1500 to frame 2500, with 5000 steps. The slider will then, for example, be at step 1750.2, which is why I need to interpolate.
The easiest way to do that, as far as my limited knowledge goes, is to make a quick Python plane interpolation script:
Plane1 = Planes[CurrentFullFrame] Plane2 = Planes[CurrentFullFrame+1] NewCenter = Plane1.Origin + (CurrentIncrement * (Plane2.Origin - Plane1.Origin)) NewXAxis = Plane1.XAxis + (CurrentIncrement * (Plane2.XAxis - Plane1.XAxis)) NewYAxis = Plane1.YAxis + (CurrentIncrement * (Plane2.YAxis - Plane1.YAxis)) CurrentFrame = rs.PlaneFromFrame(NewCenter, NewXAxis, NewYAxis)
with CurrentIncrement being 0.2 in this example, and CurrentFullFrame at 1750.
Now, there is no iteration, no loop, it’s just accessing these two planes. However, I have a lot of branches and therefore A LOT of planes. With around 2000 planes and 99 branches I’m very quickly at 200k planes, and this script is now starting to be the slowest part in my definition (it takes 2 seconds). I’m now wondering if there is a faster solution - mathematically, or maybe a different programming language? It shouldn’t take that long because it shouldn’t access all the planes, but somehow it does become slower the more planes I add to the list.