Tuesday, May 01, 2012

ConnectCrv - Testing Dictionary




import rhinoscriptsyntax as rs
crvs = rs.GetObjects('curve',4)
dict = {}
seg = 10
maxDist = 10

for i in range(0,len(crvs)):
    dict[i] = []
   
for i in range(0,len(crvs)):
    crvPts = rs.DivideCurve(crvs[i],seg)
    for pt in crvPts:
        dict[i].append(pt)

for i in range(0,len(dict)):
    for j in range(0,len(dict[i])):
        if i < len(dict):
            for k in range(0,len(dict[i+1])):
                dist = rs.Distance(dict[i][j],dict[i+1][k])
                if dist < maxDist:
                    line = rs.AddLine(dict[i][j],dict[i+1][k])

No comments:

Post a Comment