############################## ### DM2_w24 hu_03_setUp ### ### _diag / 2024 10 17 ### ############################## import rhinoscriptsyntax as rs ### import random, time, sys ### sys.path.append("P:/WWW/archiebal/") ### add path where "DM_lib.py" can be found !!! sys.path.append("P:/DM2/") ### add path where "DM_lib.py" can be found !!! sys.path.append("P:/dm2/") ### add path where "DM_lib.py" can be found !!! import DM_lib as dm ### reload(dm) ############################## rs.EnableRedraw(0) rs.DeleteObjects( rs.AllObjects() ) dm.eA() print dm.pntRandVec(-1,1) rad = random.uniform(5.0, 10) coords = [] zFaktor = 1 vec = [rad, 0, 0] #rs.AddPoint( vec ) vecX = rs.VectorRotate(vec, 29.0, [0,0,1]) #rs.AddPoint(vecX) anz = 200 deltaAngle = 360/anz center = [12, 12, 12] for a in range(0,20,1): for i in range(anz): vecX = rs.VectorRotate(vec, deltaAngle*i, [random.uniform(-1,1),random.uniform(-1,1),random.uniform(-1,1)]) vecX = rs.VectorScale(vecX, random.uniform(0,1) ) vecX = rs.VectorAdd( vecX, center ) rs.AddPoint(vecX) center = [12, 20, 12] for a in range(0,20,1): for i in range(anz): vecX = rs.VectorRotate(vec, deltaAngle*i, [random.uniform(-1,1),random.uniform(-1,1),random.uniform(-1,1)]) vecX = rs.VectorScale(vecX, random.uniform(0,1) ) vecX = rs.VectorAdd( vecX, center ) rs.AddPoint(vecX) for x in range( random.randint(5, 10) ): for y in range(random.randint(5, 10)): for z in range(random.randint(5, 10)): zFaktor = 1 if random.randint(0,100) < 5: zFaktor *= 5 coords.append( [x*5, y*2, z*zFaktor] ) random.shuffle( coords ) rs.AddCurve( coords, 20 )