Forgot password?

Create an account!


« back

RhinoScript – recursive function


Please log in to write a message.

  • 1. maxkeil (Nov 28, 2014 18.19):

    hey guys!
    I've been working with grashopper for quite some time and since I came to some limitations concerning recursive loops i want to dig into python and scripting.
    what i want to do is wirte a function that draws a circle and divides the circle.
    then i want to redo the function for every division point but reducing the new radius by 1 and the divisions also by 1...i want to redo this function just as long as my divisions are higher than 0.
    the script i managed to write so far looks like this:

    import rhinoscriptsyntax as rs

    def recursion(pt,r,div):
    if div > 0:
    circle = rs.AddCircle(pt,r)
    division = rs.DivideCurve(circle,div,True,True)
    for d in division:
    return recursion(d,r-1,div-1)



    but somehow my function isn't applied to every divison you know what to change or how to rewrite the function?

    thanks in advance


Why are these buttons gray?