mcneel / rhinopython101manual

Rhino.Python version of the RhinoScript 101 manual
python.rhino3d.com
48 stars 20 forks source link

Repeated if test #11

Closed sbaer closed 13 years ago

sbaer commented 13 years ago

Section 8.4 line 6 of the projectpolyline function can be removed. The 'if' test is also performed on line 7

Could be rewritten as

def projectpolyline(vertices, surface_id):
    polyline = []
    for vertex in vertices:
        pt = rs.BrepClosestPoint(surface_id, vertex)
        if pt: polyline.append(pt[0])
    return polyline
SJET commented 13 years ago

Fixed