import rhinoscriptsyntax as rs import random rs.EnableRedraw( 0 ) alleObjete = rs.AllObjects() rs.DeleteObjects(alleObjete) #print alleObjete #print range(25) #int_liste = range(150) coords = [] print coords for i in range(401): #print i x=random.uniform(0, 20) y=random.uniform(0, 20) z=random.uniform(0, 20) x += -10 y += -15 cor = [x,y,z] #rs.AddPoint(cor) #rs.ZoomExtents() coords.append(cor) #print "i=",i, coords xRange = random.randint(10,50) yRange = random.randint(10,20) zRange = random.randint(8,15) newCoords = [] for x in range(xRange): if x > xRange*0.5: x += 17 for y in range(yRange): for z in range(zRange): cor = [x,y,z] newCoords.append(cor) #rs.AddPoints( newCoords ) random.shuffle( newCoords ) #rs.AddCurve( newCoords, 2 ) newPoints = rs.AddPoints( newCoords) for pnt in newPoints: color = [random.randint(100,255), random.randint(150,255),random.randint(0,255)] rs.ObjectColor( pnt, color ) rs.ZoomExtents() P1 = newCoords[ random.randint(0, len(newCoords)) ] for i in range(15): P0 = random.choice( newCoords ) P2 = random.choice( newCoords ) rs.AddCurve( [P0, P1, P2, P0], 1 )