#DM2 WS24 #Hue 2 #Eni Nizamic #Gruber_2 print" +--------+" print" / /|" print" / / |" print" +--------+ |" print" | | |" print" | | +" print" | | /" print" | |/" print" +--------+" ###################################### import rhinoscriptsyntax as rs rs.EnableRedraw(False) all_objects = rs.AllObjects() if all_objects: rs.DeleteObjects(all_objects) wuerfel_groesse = 30 punkte_pro_kante = 20 schritt = wuerfel_groesse / (punkte_pro_kante - 1) punkte = [] #Punke for x in range(punkte_pro_kante): for y in range(punkte_pro_kante): for z in range(punkte_pro_kante): punkt = [x * schritt, y * schritt, z * schritt] punkte.append(punkt) lila_farbe = [128, 0, 128] punkt_objs = [] for punkt in punkte: punkt_obj = rs.AddPoint(punkt) rs.ObjectColor(punkt_obj, lila_farbe) punkt_objs.append(punkt_obj) #Kurven zwischen den benachbarten Punkten hinzufuegen for x in range(punkte_pro_kante): for y in range(punkte_pro_kante): for z in range(punkte_pro_kante): index = x * punkte_pro_kante * punkte_pro_kante + y * punkte_pro_kante + z #Linien entlang der X-Achse if x < punkte_pro_kante - 1: naechstes_x = index + punkte_pro_kante * punkte_pro_kante rs.AddCurve([punkte[index], punkte[naechstes_x]], 1) #Linien entlang der Y-Achse if y < punkte_pro_kante - 1: naechstes_y = index + punkte_pro_kante rs.AddCurve([punkte[index], punkte[naechstes_y]], 1) #Linien entlang der Z-Achse if z < punkte_pro_kante - 1: naechstes_z = index + 1 rs.AddCurve([punkte[index], punkte[naechstes_z]], 1) rs.EnableRedraw(True)