import rhinoscriptsyntax as rs import System ############################## alleObjekte = rs.AllObjects() print(alleObjekte) rs.DeleteObjects(alleObjekte) ############################## cube_size = 10 # Size of the cube anzahl = 150 # Number of dots per face coords = [] # Create System.Random for generating random numbers rand = System.Random() # Defined fixed positions for each face of the cube fixed_positions = [ (0, 0, cube_size), # Front (0, 0, 0), # Back (0, 0, 0), # Left (cube_size, 0, 0), # Right (0, cube_size, 0), # Top (0, 0, 0) # Bottom ] # Generate random points for face in range(6): for i in range(anzahl): fixed_x, fixed_y, fixed_z = fixed_positions[face] x = fixed_x if face in [2, 3] else rand.Next(0, cube_size) # Adjusted range y = fixed_y if face in [4, 5] else rand.Next(0, cube_size) # Adjusted range z = fixed_z if face in [0, 1] else rand.Next(0, cube_size) # Adjusted range # if-loop: to move points on the x-axis if z > 7 if z > 7: x -= 15 coords.append([x, y, z]) print("Point {}: {}".format(len(coords), coords[-1])) rs.AddPoints(coords)