Grasshopper

algorithmic modeling for Rhino

I am trying to create a bunch of polylines and some of them are not valid so I want to test for validity and don't include invalid polylines into my output list.

I thought it would work something like this (but the logic here is differen and I could not understand it from documentation):

def AddPoly(points):
    polylines = []

    for i in points:
        for j in points:
            for k in points:
                for l in points:
                    for m in points:
                        p = [i,j,k,l,m]
                        polyline = Rhino.Geometry.PolylineCurve(p)
                        test = Rhino.Geometry.Polyline.IsValid(polyline)
                        if test:
                            polylines.append(polyline)
    return polylines

Views: 3728

Replies are closed for this discussion.

Replies to This Discussion

If(polylines.IsValid)
...
Because it is a property of object not a method

Thanks A LOT! I'm new to this, so this stuff is not obvious to me. Really appreciate your response!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service