"Compartmentalize" scripts so only new inputs in a list are calculated

Hi All

I have a script that involves drawing polylines to create closed polygons. I have a geometry pipeline that collects the referenced lines and does a series of processes to create inner shapes within each polygon. As more and more polygons are drawn though the script slows down massively, as it is taking the inputs as a list and is therefore recalculating the entire drawning each time, instead of preferably only doing the calculation for new shapes as the old ones are “stored”. I can’t figure out a way to do this in an intuitive and dynamic way.

I was wondering if anyone knew of a way to do this?

I can’t upload this script but I can make a smaller version if I haven’t done a good job of explaining this.

Thanks in advance

That is, all you need is a cache list to draw and a system to clean/reset it and add or remove new values. In other words, separate drawing and processing so that the cost of processing does not affect the drawing. Publish something to understand your context.

Hi Dani, thanks for your response.

How would I go about setting up a cache list and the reset system?

Here’s a very basic version of it

So essentially is there a way to structure things so that the surfaces generated by the curves at the start only get “processed” once, their weird Voronoi shape is set and it won’t reprocess them when I draw the next curves.

I thought you worked from code, sorry. In GH is a mess to avoid that, you can copy and paste the definition for each new input. Or you can (preferably) save the result and just use a new polyline in the input parameter, to only process new entries and keep the results. Peacock has a component like the Data Recorder but with inputs to save or reset. In other words, you have to define a specific workflow for that definition, just using new curves, saving all the results and with a reset button when you want to start from scratch (deleting all saved results).

You could use the “dam” module where you want data cached. Otherwise, you could export (?) or at least bake your object and go from there.