#Max Benjamin Spamer HUe02 #Es soll kein Curve-knaeul entstehen sondern Beziehungen zw. den einzelnen Wuerfeln import rhinoscriptsyntax as rs import random # nicht immer alles doppelt! rs.EnableRedraw(1) allObj = rs.AllObjects() rs.DeleteObjects(allObj) rs.ZoomExtents() # Wuerfel 1 coords = [] for i in range(100): x = random.uniform(0, 10) y = random.uniform(0, 10) z = random.uniform(0, 10) cor = [x, y, z] coords.append(cor) rs.AddPoints(coords) # Wuerfel 2 coords2 = [] for i in range(200): x = random.uniform(20, 30) y = random.uniform(20, 30) z = random.uniform(0, 10) cor2 = [x, y, z] coords2.append(cor2) rs.AddPoints(coords2) # Wuerfel 3 coords3 = [] for i in range(100): x = random.uniform(40, 50) y = random.uniform(0, 10) z = random.uniform(0, 10) cor3 = [x, y, z] coords3.append(cor3) rs.AddPoints(coords3) # Wuerfel 4 coords4 = [] for i in range(100): x = random.uniform(20, 30) y = random.uniform(-20, -30) z = random.uniform(0, 10) cor4 = [x, y, z] coords4.append(cor4) rs.AddPoints(coords4) # Lila Farbe points = rs.AddPoints(coords + coords2 + coords3 + coords4) rs.ObjectColor(points, [153, 50, 204]) print (rs.ObjectColor) # Linien zwischen den Wuerfeln #zwischen würfel 1 und 2 for point1 in coords: point2 = random.choice(coords2) rs.AddLine(point1, point2) # zwischen wuerfel 2 und 3 for point1 in coords2: point2 = random.choice(coords3) rs.AddLine(point1, point2) # zwischen wuerfel 3 und 4 for point1 in coords3: point2 = random.choice(coords4) rs.AddLine(point1, point2) # zwischen wuerfel 4 und 1 for point1 in coords4: point2 = random.choice(coords) rs.AddLine(point1, point2) #zweite ebene # Wuerfel 1 coords5 = [] for i in range(100): x = random.uniform(0, 10) y = random.uniform(0, 10) z = random.uniform(30, 40) cor = [x, y, z] coords5.append(cor) rs.AddPoints(coords5) # Wuerfel 2 coords6 = [] for i in range(200): x = random.uniform(20, 30) y = random.uniform(20, 30) z = random.uniform(30, 40) cor2 = [x, y, z] coords6.append(cor2) rs.AddPoints(coords6) # Wuerfel 3 coords7 = [] for i in range(100): x = random.uniform(40, 50) y = random.uniform(0, 10) z = random.uniform(30, 40) cor3 = [x, y, z] coords7.append(cor3) rs.AddPoints(coords7) # Würfel 4 coords8 = [] for i in range(100): x = random.uniform(20, 30) y = random.uniform(-20, -30) z = random.uniform(30, 40) cor4 = [x, y, z] coords8.append(cor4) rs.AddPoints(coords8) # Lila Farbe f. Wuerfel points = rs.AddPoints(coords + coords2 + coords3 + coords4) rs.ObjectColor(points, [153, 50, 204]) print (rs.ObjectColor) # Linien zwischen den Wuerfeln #zwischen würfel 1 und 2 for point1 in coords: point2 = random.choice(coords5) rs.AddLine(point1, point2) # zwischen wuerfel 2 und 3 for point1 in coords2: point2 = random.choice(coords6) rs.AddLine(point1, point2) # zwischen wuerfel 3 und 4 for point1 in coords3: point2 = random.choice(coords7) rs.AddLine(point1, point2) # zwischen wuerfel 4 und 1 for point1 in coords4: point2 = random.choice(coords8) rs.AddLine(point1, point2) rs.ZoomExtents() #Frage: Mit Deg. kriegt man doch die Krümmung von den Curves hin oder? #waer vlt. auch gut gewesen! #Frage: Wie würde ich jetzt randomly allen Curves eine andere Farbe geben?