Forgot password?

Create an account!

Forum

« back

RhinoScript – Trouble with first Rhinoscript

Messages

Please log in to write a message.

  • 2. Johannes (Oct 24, 2010 13.51):

    you need a loop to create n-curves trough a set of points. put each crv identifier into an array and loft these crvs.

  • 1. rdocken1 (Oct 24, 2010 04.10):

    Hey all.

    I'm just learning Rhinoscript and trying to create a degree 1 lofted surface from an array of points. I have my array but am not sure how or what code to use to create the curves through each row of points needed to loft the surface (and then also how to loft the surface after getting the curves). Here's my code (thanks, any feedback is much appreciated!):

    Dim x_count : x_count = rhino.getreal("number in x?",10,1,20) 'asking user a # for x, first = default, middle # = min, last # = max
    x_count = x_count - 1 'to correct the 0-9 = 10 issue for user

    Dim y_count : y_count = rhino.getreal("number in y?",10,1,20) 'asking user a # for y, first = default, middle # = min, last # = max
    y_count = y_count - 1 'to correct the 0-9 = 10 issue for user

    Dim z_count : z_count = rhino.getreal("number in z?",1,1,20) 'asking user a # for z, first = default, middle # = min, last # = max
    z_count = z_count - 1 'to correct the 0-9 = 10 issue for user

    Dim i, j, k, index, rand_1, rand_2, rand_3, point, curve


    Dim array_index : array_index = 0 'variable for count

    ReDim points((x_count+1)*(y_count+1)*(z_count+1)-1)

    For i = 0 To z_count
    For j = 0 To y_count
    For k = 0 To x_count

    rand_1 = rnd ()
    rand_2 = rnd ()
    rand_3 = rnd ()

    array k, j, i

    points (array_index) = rhino.addpoint( (array(k,j,i+rand_1)))

    Next

    Next

    Next

Recommend

Why are these buttons gray?