import rhinoscriptsyntax as rs import random rs.ShowGrid(view=None, show=0) rs.ShowGridAxes(view=None, show=0) alleObjekte = rs.AllObjects() rs.DeleteObjects(alleObjekte) green_color = [73, 116, 0] yellow_color = [255, 255, 0] x_cuboid1 = 20 y_cuboid1 = 100 z_cuboid1 = 50 coords_c1 = [] for x in range(x_cuboid1): x = x + 100 for y in range(y_cuboid1): y = y - 250 for z in range(z_cuboid1): z = z - 60 cor_c1 = [x, y, z] coords_c1.append(cor_c1) points_1 = rs.AddPoints(coords_c1) rs.ObjectColor(points_1, green_color) x_cuboid2 = 40 y_cuboid2 = 10 z_cuboid2 = 5 coords_c2 = [] for x in range(x_cuboid2): x = x + 50 for y in range(y_cuboid2): y = y + 150 for z in range(z_cuboid2): z = z + 60 cor_c2 = [x, y, z] coords_c2.append(cor_c2) #points_2 = rs.AddPoints(coords_c2) random.shuffle(coords_c2) rs.AddCurve(coords_c2, 3) x_cuboid3 = 60 y_cuboid3 = 20 z_cuboid3 = 40 coords_c3 = [] for x in range(x_cuboid3): x = x - 50 for y in range(y_cuboid3): y = y - 150 for z in range(z_cuboid3): z = z - 60 cor_c3 = [x, y, z] coords_c3.append(cor_c3) points_3 = rs.AddPoints(coords_c3) for i in range(min(len(points_1), len(points_3))): start_point = points_1[i] end_point = points_3[i] line_1 = rs.AddLine(start_point, end_point) rs.ObjectColor(line_1, yellow_color)