#hu 04 #Mia Tomancok import rhinoscriptsyntax as rs import random, sys sys.path.append("C:\dm2") import DM_lib as dm rs.EnableRedraw(0) dm.eA() newCoords = [] ######base x = 50 z = 20 base_coords = [] for i in range(x): for j in range(x): for k in range(z): cor = [i, j, k] base_coords.append( cor ) base_points = rs.AddPoints ( base_coords ) #base farbe for pnt in base_points: colo = [255, 0, 0] rs.ObjectColor(pnt, colo) ######baum #baum unten rad = 15 vec = [rad, 0, 0] center = [25, 25, 20] anz = 1500 deltaAngel = 360/anz bu_coords = [] for i in range (anz): 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) bu_points = rs.AddPoint(vecX) if bu_points: bu_coords.append(bu_points) #baum unten farbe for bu_points in bu_coords: colo = [1, 50, 32] rs.ObjectColor(bu_points, colo) #baum mitten rad = 7.5 vec = [rad, 0, 0] center = [25, 25, 35] anz = 1500 deltaAngel = 360/anz bm_coords = [] for i in range (anz): 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) bm_points = rs.AddPoint(vecX) if bm_points: bm_coords.append(bm_points) #baum mitten farbe for bm_points in bm_coords: colo = [1, 50, 32] rs.ObjectColor(bm_points, colo) #baum oben rad = 3 vec = [rad, 0, 0] center = [25, 25, 42.5] anz = 1500 deltaAngel = 360/anz bo_coords = [] for i in range (anz): 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) bo_points = rs.AddPoint(vecX) if bo_points: bo_coords.append(bo_points) #baum oben farbe for bo_points in bo_coords: colo = [1, 50, 32] rs.ObjectColor(bo_points, colo) ######schnee rad = 60 vec = [rad, 0, 0] center = [25, 25, 67] anz = 500 deltaAngel = 360/anz s_coords = [] for i in range (anz): 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) s_points = rs.AddPoint(vecX) if s_points: s_coords.append(s_points) # schnee farbe for s_points in s_coords: colo = [0, 0, 0] rs.ObjectColor(s_points, colo) #####stern stern_mitte = [] x = 25 y = 25 z = 43 rs.AddPoint ( x, y, z ) stern_rad = [] rad = 2 vec = [rad, 0, 0] center = [25, 25, 43] anz = 10 deltaAngel = 360/anz stern_coords = [] for i in range(10): start_point = stern_mitte[i] end_point = stern_coords[i] rs.AddLine(start_point, end_point)