import rhinoscriptsyntax as rs import random alleObjekte = rs.AllObjects() rs.DeleteObjects( alleObjekte ) #loescht alle bisherigen Objekte fuer darauffolgende Debugs ##print range (10) # #coords = [] #for zahl in range(50) : # print "coords", coords # ###print zahl, # ###print "hoch 2 ==", zahl**2 # ###cor == [x,y,z] # cor = [zahl, zahl**1.01, 0.0] # #rs.AddPoint( cor ) # coords.append( cor ) # rs.ZoomExtents() # #print cor #coords.append( [10,0,0] ) #coords.append( coords[0] ) #print coords # #rs.AddPoints( coords ) ##rs.AddCurve( coords, degree=1) ##rs.AddCurve( coords, degree=2) ##rs.AddCurve( coords, degree=3) coords = [] #die Liste "coords" wird spaeter fuer die Punktowolke verw. anzahl = 20 #wieviele Punkte wir pro Seite haben wollen xVal = 1.2 #bei anzahl 20 waere eine Seite standardmaesig 20 Einheiten lang yVal = 1.2 #mit x/y/zVal koennen wir den Wuerfel skalieren aber alle Punkte beibehalten zVal = 1.2 for i in range(anzahl): #i ist in range (anzahl) - bei 20 bedetet das: i = (0,19) for j in range(anzahl): for k in range(anzahl): x = i*xVal + random.uniform(0.01, xVal) # X = i * xVal + random.uniform (0.01, xVal) if i > anzahl*0.5: #(range [anzahl]) (skalierfaktor) (x-punkt kann sich random von +0.01 BIS +xVal [naechster Punkt] bewegen) x += 10 y = j*yVal + random.uniform(0.01, yVal) if j > anzahl*0.5: # wenn y-koordinate ueber der Haelfte ist, dann 10 abstand bis zum naechsten y += 10 z = k*zVal + random.uniform(0.01, zVal) if k > anzahl*0.5: z +=10 cor = [x, y, z ] #cor =x,y,z oder i,j,k (mit Bedingungen) - 20 punkte pro seite coords.append( cor ) #cor wird nun in leere coords llste eingesetzt points = rs.AddPoints( coords ) #"points" sind alle punkte die mit "coords" erstellt wurden rs.ObjectColor( points, [200,0,0] ) #Farbe von "points" ist nun [200,0,0] #for point in points [0:1000]: # "Punkte" 0-1000: # # color = [random.randint(0,255), random.randint(0,255), random.randint(100,255) ] #Variabel mit [rand,rand,rand] 0-255 # rs.ObjectColor(point, color) # punkte wird diese Variabel bei Fraben zugeteilt random.shuffle( coords ) rs.AddCurve ( coords, 1) #Curve zw. geshufflete Punkte , DEGREE 1