import rhinoscriptsyntax as rs import random allRhinos = rs.AllObjects () rs.DeleteObjects( allRhinos) rs.EnableRedraw (0) ################################### ###02_uebung ### Langmann_Sven ### 20241011 ################################### #zahl =33*0.21 #print zahl #print round ( zahl, 0) #print int ( zahl) ######################## #print range (0,10) cords = [] cordssection = [] a=0 for i in range(-10,11): for j in range(-5, 11): for k in range(-10, 15): x = i y = j #*random.uniform (0,3) z = k a = a+1 isSection = False #print("test=" + str(random.uniform (0,100))) b= random.uniform (0,100) ### 2 Quadar #### if x > 0: x = x+10 ################# ################# if z >= 0 and z <2 and y >0 and y<5: z= z+ 20 isSection = True ############### if z == 2 and y >1 and y<4: z= z+ 20 isSection = True ############### if z == -1 and y >1 and y<4: z= z+ 20 isSection = True ############### cor = [x, y, z] rs.AddPoint( cor ) if isSection == False: cords.append( cor ) else: cordssection.append ( cor ) points = rs.AddPoints( cords ) cords= sorted(cords, key=lambda cor : cor[2]) rs.AddCurve( cords, 1 ) points = rs.AddPoints( cordssection ) ############### #rs.AddCurve( cordssection, 1 ) #sort to z cordssection= sorted(cordssection, key=lambda cor : cor[2]) rs.AddCurve( cordssection, 1 ) ###### #sort to y cordssection= sorted(cordssection, key=lambda cor : cor[1]) rs.AddCurve( cordssection, 1 ) ##### ####Points #rs.AddPoints( cords ) ####random outbreak #random.shuffle ( cords ) ####curves #rs.AddCurve( cords, 1 ) #AddCurve(points, degree=3) # = Zeichen ist das default Zeichen