Global Variables can be used to create recursive modelling tools by iteratively getting, modifying and updating a geometry over time.
Initial Conditions and Resets
To set the initial conditions of a recursive model, create a global variable and connect data (geometry or values) that will serve as the starting point of the loop. If you want to 'reset' your recursive application to the initial conditions, reconnect this data to update the global variable to its initial state.
Infinite loops are created when changing the value of a global variable updates part of your parametric model that causes the variable to update again, as quickly as your CPU can handle. This can happen if you are listening for changes to a global variable (using Dynamic Update) and then modifying and updating the value of the same global variable whenever a change is detected.
Recursion with Timers
You can control the rate of update of a global variable by connecting the Get Global Variable component to a timer with a given refresh rate. This will allow you to create recursive definitions while also enabling you to 'break out' of the infinite loop at any point by disabling the timer.
The example above takes an arbitrary input curve and assigns it to a global variable called crv. A recursive definition then checks for changes in the value of crv every 50ms, divides the current crv into 100 planes and moves these planes perpendicular to the curve tangent to create a new curve that is offset from the previous one. This new curve is then recorded with a data recorder (to view changes over time) and also used to update the value of crv for the next iteration of the model.