###hu_4 ###katharina lamprecht ################################## import rhinoscriptsyntax as rs ### import random, time, sys ### sys.path.append("P:/") ### sys.path.append("P:/DM2/") ### sys.path.append("P:/dm2/") ### import DM_lib as dm ### ################################## rs.EnableRedraw( 0 ) ### dm.eA() ### ################################## rot = [255, 0, 0] gruen = [0, 255, 0] blau = [0, 0, 255] #Sockel rechteck length = 20 hight = 30 wuerfel_coords = [] for i in range(length): for j in range(length): for k in range(hight): cor = [i, j, k] wuerfel_coords.append( cor ) #rs.AddPoint( cor ) wuerfel_points = rs.AddPoints ( wuerfel_coords ) #wuerfel farbe for pnt in wuerfel_points: colo = [0, 0, 255] rs.ObjectColor(pnt, colo) #Sockel rechteck rechts length = 5 depth = 10 hight = 30 wuerfel_coords = [] for i in range(length): for j in range(depth): for k in range(hight): cor = [i+20, j+5, k] wuerfel_coords.append( cor ) #rs.AddPoint( cor ) wuerfel_points = rs.AddPoints ( wuerfel_coords ) #wuerfel farbe for pnt in wuerfel_points: colo = [0, 0, 255] rs.ObjectColor(pnt, colo) #Sockel rechteck links length = 5 depth = 10 hight = 30 wuerfel_coords = [] for i in range(length): for j in range(depth): for k in range(hight): cor = [i-5, j+5, k] wuerfel_coords.append( cor ) #rs.AddPoint( cor ) wuerfel_points = rs.AddPoints ( wuerfel_coords ) #wuerfel farbe for pnt in wuerfel_points: colo = [0, 0, 255] rs.ObjectColor(pnt, colo) ############################### #Mitte rechteck length = 16 depth = 16 hight = 25 wuerfel_coords = [] for i in range(length): for j in range(depth): for k in range(hight): cor = [i+2, j+2, k+30] wuerfel_coords.append( cor ) #rs.AddPoint( cor ) wuerfel_points = rs.AddPoints ( wuerfel_coords ) #wuerfel farbe for pnt in wuerfel_points: colo = [0, 255, 0] rs.ObjectColor(pnt, colo) #Mitte rechteck rechts length = 5 depth = 6 hight = 25 wuerfel_coords = [] for i in range(length): for j in range(depth): for k in range(hight): cor = [i+18, j+7, k+30] wuerfel_coords.append( cor ) #rs.AddPoint( cor ) wuerfel_points = rs.AddPoints ( wuerfel_coords ) #wuerfel farbe for pnt in wuerfel_points: colo = [0, 255, 0] rs.ObjectColor(pnt, colo) #Mitte rechteck links length = 5 depth = 6 hight = 25 wuerfel_coords = [] for i in range(length): for j in range(depth): for k in range(hight): cor = [i-3, j+7, k+30] wuerfel_coords.append( cor ) #rs.AddPoint( cor ) wuerfel_points = rs.AddPoints ( wuerfel_coords ) #wuerfel farbe for pnt in wuerfel_points: colo = [0, 255, 0] rs.ObjectColor(pnt, colo) ############################### #Oben rechteck length = 12 depth = 12 hight = 20 wuerfel_coords = [] for i in range(length): for j in range(depth): for k in range(hight): cor = [i+4, j+4, k+55] wuerfel_coords.append( cor ) #rs.AddPoint( cor ) wuerfel_points = rs.AddPoints ( wuerfel_coords ) #wuerfel farbe for pnt in wuerfel_points: colo = [255, 0, 0] rs.ObjectColor(pnt, colo) #Oben rechteck rechts length = 5 depth = 4 hight = 20 wuerfel_coords = [] for i in range(length): for j in range(depth): for k in range(hight): cor = [i+16, j+8, k+55] wuerfel_coords.append( cor ) #rs.AddPoint( cor ) wuerfel_points = rs.AddPoints ( wuerfel_coords ) #wuerfel farbe for pnt in wuerfel_points: colo = [255, 0, 0] rs.ObjectColor(pnt, colo) #Oben rechteck links length = 5 depth = 4 hight = 20 wuerfel_coords = [] for i in range(length): for j in range(depth): for k in range(hight): cor = [i-1, j+8, k+55] wuerfel_coords.append( cor ) #rs.AddPoint( cor ) wuerfel_points = rs.AddPoints ( wuerfel_coords ) #wuerfel farbe for pnt in wuerfel_points: colo = [255, 0, 0] rs.ObjectColor(pnt, colo) ############################### #Spitze rechteck length = 6 depth = 4 hight = 50 spitze_coords = [] for i in range(length): for j in range(depth): for k in range(hight): cor = [i+7, j+8, k+75] spitze_coords.append( cor ) #rs.AddPoint( cor ) spitze_points = rs.AddPoints ( spitze_coords ) #wuerfel farbe for pnt in spitze_points: colo = [random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)] rs.ObjectColor(pnt, colo) ############################### ############################### ############################### """ #kugel rad = 15.0 vec = [rad, 0, 0] center = [10, 9, 100] anz = 2500 deltaAngel = 360/anz kugel_coords = [] for i in range (anz): #vecX = rs.VectorRotate( vec, deltaAngel*i, [random.uniform( -1, 1),random.uniform( -1, 1), random.uniform( -1, 1) ] ) vecX = rs.VectorRotate( vec, deltaAngel*i, dm.pntRandCoords(-1, 1) [0] ) vecX = rs.VectorScale( vecX, random.uniform(0.4, 1)) vecX = rs.VectorAdd( vecX, center ) rs.AddPoint( vecX) kugel_points = rs.AddPoint(vecX) if kugel_points: kugel_coords.append(kugel_points) # kugel 1 farbe for kugel_points in kugel_coords: colo = [180, 40, 50] rs.ObjectColor(kugel_points, colo) """ ############################### #kugel 2 rad = 15.0 vec = [rad, 0, 0] center = [100, 50, 1] anz = 100 deltaAngel = 360/anz kugel2_coords = [] for i in range (anz): #vecX = rs.VectorRotate( vec, deltaAngel*i, [random.uniform( -1, 1),random.uniform( -1, 1), random.uniform( -1, 1) ] ) vecX = rs.VectorRotate( vec, deltaAngel*i, dm.pntRandCoords(-1, 1) [0] ) vecX = rs.VectorScale( vecX, random.uniform(0.4, 1)) vecX = rs.VectorAdd( vecX, center ) rs.AddPoint( vecX) kugel2_points = rs.AddPoint(vecX) if kugel2_points: kugel2_coords.append(kugel2_points) # kugel 2 farbe for kugel2_points in kugel2_coords: colo = [80, 200, 75] rs.ObjectColor(kugel2_points, colo) # LINIEN for i in range(min(len(spitze_coords), len(kugel2_coords))): start_point = kugel2_coords[i] end_point = spitze_coords[i] linie = rs.AddLine(start_point, end_point) colo = [random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)] if linie: rs.ObjectColor(linie, colo) ############################### #kugel 3 rad = 30.0 vec = [rad, 0, 0] center = [-70, 0, 50] anz = 200 deltaAngel = 360/anz kugel3_coords = [] for i in range (anz): #vecX = rs.VectorRotate( vec, deltaAngel*i, [random.uniform( -1, 1),random.uniform( -1, 1), random.uniform( -1, 1) ] ) vecX = rs.VectorRotate( vec, deltaAngel*i, dm.pntRandCoords(-1, 1) [0] ) vecX = rs.VectorScale( vecX, random.uniform(0.4, 1)) vecX = rs.VectorAdd( vecX, center ) rs.AddPoint( vecX) kugel3_points = rs.AddPoint(vecX) if kugel3_points: kugel3_coords.append(kugel3_points) # kugel 3 farbe for kugel3_points in kugel3_coords: colo = [200, 200, 50] rs.ObjectColor(kugel3_points, colo) # LINIEN und Farbe for i in range(min(len(spitze_coords), len(kugel3_coords))): start_point = kugel3_coords[i] end_point = spitze_coords[i] linie = rs.AddLine(start_point, end_point) colo = [random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)] if linie: rs.ObjectColor(linie, colo) ############################### #kugel 4 rad = 20.0 vec = [rad, 0, 0] center = [40, 180, 150] anz = 500 deltaAngel = 360/anz kugel4_coords = [] for i in range (anz): #vecX = rs.VectorRotate( vec, deltaAngel*i, [random.uniform( -1, 1),random.uniform( -1, 1), random.uniform( -1, 1) ] ) vecX = rs.VectorRotate( vec, deltaAngel*i, dm.pntRandCoords(-1, 1) [0] ) vecX = rs.VectorScale( vecX, random.uniform(0.4, 1)) vecX = rs.VectorAdd( vecX, center ) rs.AddPoint( vecX) kugel4_points = rs.AddPoint(vecX) if kugel4_points: kugel4_coords.append(kugel4_points) # kugel 4 farbe for kugel4_points in kugel4_coords: colo = [60, 190, 190] rs.ObjectColor(kugel4_points, colo) # LINIEN for i in range(min(len(spitze_coords), len(kugel4_coords))): start_point = kugel4_coords[i] end_point = spitze_coords[i] linie = rs.AddLine(start_point, end_point) colo = [random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)] if linie: rs.ObjectColor(linie, colo) ############################### #kugel 5 rad = 20.0 vec = [rad, 0, 0] center = [-30, 70, 70] anz = 500 deltaAngel = 360/anz kugel5_coords = [] for i in range (anz): #vecX = rs.VectorRotate( vec, deltaAngel*i, [random.uniform( -1, 1),random.uniform( -1, 1), random.uniform( -1, 1) ] ) vecX = rs.VectorRotate( vec, deltaAngel*i, dm.pntRandCoords(-1, 1) [0] ) vecX = rs.VectorScale( vecX, random.uniform(0.4, 1)) vecX = rs.VectorAdd( vecX, center ) rs.AddPoint( vecX) kugel5_points = rs.AddPoint(vecX) if kugel5_points: kugel5_coords.append(kugel5_points) # kugel 5 farbe for kugel5_points in kugel5_coords: colo = [60, 190, 190] rs.ObjectColor(kugel5_points, colo) # LINIEN for i in range(min(len(spitze_coords), len(kugel5_coords))): start_point = kugel5_coords[i] end_point = spitze_coords[i] linie = rs.AddLine(start_point, end_point) colo = [random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)] if linie: rs.ObjectColor(linie, colo) ############################### #kugel 6 rad = 20.0 vec = [rad, 0, 0] center = [-50, -70, 200] anz = 500 deltaAngel = 360/anz kugel6_coords = [] for i in range (anz): #vecX = rs.VectorRotate( vec, deltaAngel*i, [random.uniform( -1, 1),random.uniform( -1, 1), random.uniform( -1, 1) ] ) vecX = rs.VectorRotate( vec, deltaAngel*i, dm.pntRandCoords(-1, 1) [0] ) vecX = rs.VectorScale( vecX, random.uniform(0.4, 1)) vecX = rs.VectorAdd( vecX, center ) rs.AddPoint( vecX) kugel6_points = rs.AddPoint(vecX) if kugel6_points: kugel6_coords.append(kugel6_points) # kugel 6 farbe for kugel6_points in kugel6_coords: colo = [140, 0, 140] rs.ObjectColor(kugel6_points, colo) # LINIEN for i in range(min(len(spitze_coords), len(kugel6_coords))): start_point = kugel6_coords[i] end_point = spitze_coords[i] linie = rs.AddLine(start_point, end_point) colo = [random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)] if linie: rs.ObjectColor(linie, colo) ############################### #kugel 7 rad = 30.0 vec = [rad, 0, 0] center = [70, -50, 80] anz = 400 deltaAngel = 360/anz kugel7_coords = [] for i in range (anz): #vecX = rs.VectorRotate( vec, deltaAngel*i, [random.uniform( -1, 1),random.uniform( -1, 1), random.uniform( -1, 1) ] ) vecX = rs.VectorRotate( vec, deltaAngel*i, dm.pntRandCoords(-1, 1) [0] ) vecX = rs.VectorScale( vecX, random.uniform(0.4, 1)) vecX = rs.VectorAdd( vecX, center ) rs.AddPoint( vecX) kugel7_points = rs.AddPoint(vecX) if kugel7_points: kugel7_coords.append(kugel7_points) # kugel 7 farbe for kugel7_points in kugel7_coords: colo = [0, 80, 0] rs.ObjectColor(kugel7_points, colo) # LINIEN und Farbe for i in range(min(len(spitze_coords), len(kugel7_coords))): start_point = kugel7_coords[i] end_point = spitze_coords[i] linie = rs.AddLine(start_point, end_point) colo = [random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)] if linie: rs.ObjectColor(linie, colo) ############################### #kugel 8 rad = 20.0 vec = [rad, 0, 0] center = [50, 30, 160] anz = 500 deltaAngel = 360/anz kugel8_coords = [] for i in range (anz): #vecX = rs.VectorRotate( vec, deltaAngel*i, [random.uniform( -1, 1),random.uniform( -1, 1), random.uniform( -1, 1) ] ) vecX = rs.VectorRotate( vec, deltaAngel*i, dm.pntRandCoords(-1, 1) [0] ) vecX = rs.VectorScale( vecX, random.uniform(0.4, 1)) vecX = rs.VectorAdd( vecX, center ) rs.AddPoint( vecX) kugel8_points = rs.AddPoint(vecX) if kugel8_points: kugel8_coords.append(kugel8_points) # kugel 8 farbe for kugel8_points in kugel8_coords: colo = [255, 100, 140] rs.ObjectColor(kugel8_points, colo) # LINIEN for i in range(min(len(spitze_coords), len(kugel6_coords))): start_point = kugel8_coords[i] end_point = spitze_coords[i] linie = rs.AddLine(start_point, end_point) colo = [random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)] if linie: rs.ObjectColor(linie, colo)