About this topic

  • Posted by andrea 1 year ago. There are 2 posts. The latest reply is from gustav.

No tags yet.

  1. hi, does anyone know of a way of selecting only features with odd indexes?
    ie: I want to project a series of curves onto a surface. The curves come in pairs and their indexes are:
    -bsplinecurve[0][0] -bsplinecurve[1][0]
    -bsplinecurve[0][1] -bsplinecurve[1][1]
    -bsplinecurve[0][7] -bsplinecurve[1][7]
    -bsplinecurve[0][8] -bsplinecurve[1][8] and so on....for many curves
    I would like to project only those ending in [x][1] or [x][7]. Is there a way of writing this?
    [x][odd], or [x][i+1] or something along those lines?

  2. one way of accessing a certain progression of numbers is by modulo division. it gives the remainder afetr integer division; 5 mod 2 equals 3 and so on. look it up on mathworld or wikipedia for details if needed, but the present application would be something like:

    i mod 7 = 0 isolates the series {0,7,14,21...}

    i mod 3 = 2 isolates the series {5,8,11,14...}

    if you're actually only out to step between 2nd-depth indices 1 and 7 always, then just make the nested loop

    for (i=0;i<whatever.count;i++)
    {
    for (j=0;j<whateverother.count;j++)
    {
    BSplineCurve projectedcurve = new BSplineCurve(this)

    if (j mod 6 = 1)
    {
    projectedcurve.ByProjectionOnPlane(originalbsplinecurve[i][j], whateverPlane)
    }
    }
    }

    Now I'm writing from memory so you might have to tweak it a little to actually output into the model space again.

    HTH

    G

RSS feed for this topic

Reply

You must log in to post.