Iteratively Smooth Curve


I am trying to iteratively smooth a curve (basically I am trying to do what the Smooth command in Rhino does but in Grasshopper) but it doesn’t appear to be working. Can someone give me some tips for making this work, for Python in Grasshopper, like it does when you run the Smooth command on a curve in Rhino?

smooth crv (7.7 KB)



does anyone know how to do this?

In python you can run this command in a for loop.
Number of smooth steps are “for” iterations.

Yes. I know. I have done that in the Python script attached. Here is the code. Is this what you mean?

import rhinoscriptsyntax as rs
import Rhino as r

output = []

for i in curves:
    temp = []
    for j in range(steps):
        if j == 0:
            temp.append(i.Smooth(smfactor, True, True, True, False, r.Geometry.SmoothingCoordinateSystem.World, smplane))
            nextup = temp[j-1]
            nextup.Smooth(smfactor, True, True, True, False, r.Geometry.SmoothingCoordinateSystem.World, smplane)
        if j == steps-1:

a = output

Did you duplicate the curve and reassign after smooth?
After each iteration you need to update previously smoothed curve.

In C# works file, should be python too, unless I am missing your point.

Ah, I see. Thanks