Changing the Script – Example 8.2


Most scripts develop over time, or combine elements from many different places to try and create something a bit different. In this example, I wanted to only change a few minor parameters. Instead of always cutting through the center point, I wanted the split curve to go through a random point on the sub surfaces. And instead of going straight, I wanted things to curve.

I won’t explain this one in detail, but changing the script isn’t too hard but I did have to make some adjustments on the way. First of all, the Random point needs to be set up with correctly with the data structure and also needs a new seed after every round. The second problem is sometimes you are going to get wildly different splits, owing to the random points position near the edge. After a few of these you will get fragments so small, that to try and split them again will cause the simulation to crash.

To solve this, I set up a second Data Loop (D1). At first the D1 loop is empty, but eventually when the subsurfaces get really small, they get dispatched into D1, which means they are safe from splitting. Even though no further operations take place on these items, to save them from round to round I need to put them into their own data path, otherwise they will get lost. Later we will look at examples where operations happen to both D0 and D1 items (you can have D2, D3… etc. as well) but you probably won’t want too many sets of looping data or else things can go awry very quickly…

Here are some variations. The longer I look at these the less happy I am with the results. It looks like German pickled meat. Anyways, i think you need to use a lot more discernment to get good results from these, and some random seeds generate perfectly acceptable results while another can be completely messed up.



And the script…