algorithmic modeling for Rhino
I have created my own component who's only output is a list of curves.
Unfortunately the algorithm that produces them is somewhat expensive (anything from 10s to a minute to calculate depending on the inputs).
As I have it currently the component takes a boolean input. If false the component just returns. If true the algorithm runs. When set to false the output list of curves is cleared, preventing any manipulation by downstream components that the user may want to fiddle with.
What I would like to do is cache my results, so when false the output curve list is still populated with the previous runs and downstream components can act on them.
Has anyone tried this? Is there some obvious way of doing this that I am overlooking?
Tags:
That worked and was really easy to implement. Cheers!
In python you could add your last returned curves to the sticky dictionary, and then check whether the new output returns some curves or Null. If case of the later one, you can call the sticky, and take curves from the last return.
Are you coding this in C#?
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
© 2024 Created by Scott Davidson. Powered by