Hi Emmanuel
There is a way to do it without using a "range"
On the first third line
"range=ghcomp.Range(1,samples)" change "range·" for a new name like "RG1", and then change it also on fourth line "curvature=ghcomp.Curvature(Curves,RG1)"
On the line "for i in range(0,len(range))" can be changed simply by "for i in shatter". First line inside of the for loop, should be also change it by "divCurv=ghcomp.DivideCurve(i,2,False)".
There is no difference using "for i in shatter", but take into account that here i is not an index, is the element of the list.
I hope it will be useful.
Kind regards