############################
### diag @ IAM @ DM2_w25 ###
### hu_03 setUp_ver00    ### see examples @ DM2_w23 hu_03 !
############################


##############################
import rhinoscriptsyntax as rs
import random, time, sys   ###
sys.path.append("P:/")     ###                  ### diag's path to DM_lib.py  .. please keep it !                                               
sys.path.append("P:/TUGonlineUsernam/dm2/")     ### *your* path to DM_lib.py                                            
sys.path.append("P:/WWW/ver30/dm2/hue3/") ### *your* path to DM_lib.py                                            
sys.path.append("/Users/macpro/Desktop/DM2")    ### *your* path to DM_lib.py      
import DM_lib as dm        ###                  ### "dm" is alias for DM_lib / for adressing definitions etc in "DM_lib.py"
############################## 

reload(dm) # library wird dadurch immer neu geladen

rs.ShowGrid(show=1)
rs.ShowGridAxes(show=1)
rs.ViewDisplayMode(mode="Wireframe")
rs.EnableRedraw(0)

dm.PointRadius(displayModeX=0, rad=3, styl=3)                   ### displayModeX=0="Wireframe" / rad=size of points / styl=pointStyle (try 0..5) / default 3, 3
dm.printDisplay(state=1, scale=1, thickness=1, color="Display") ### state=0/1 = off/on / for showing printWidth etc

dm.eAA()

### BASIC SETUP / mandatory input:
allInOne = 1
allCoords = dm.coordsCub (what="F")
allCoords = dm.coordsCub (edge_len=10, anz_pts=10, what="A", angle=random.uniform(0,360), axe=dm.randVec(-1,1), pos=[0,0,10], allInOne=allInOne)

coordsSph = allCoords[0]
coordsCub = allCoords[1]



##### check setup - just visualization of coords
##### don't execute  @ final version of homework
if 0:
    rs.AddPoints( coordsSph )
    
    if allInOne:
        rs.AddPoints( coordsCub )
    else:
        for i,coords in enumerate(coordsCub): 
            pts = rs.AddPoints( coords )
##### end check setup

#######################################
################ HERE YOU GO AS YOU GO:

dm.setTime()
anzahl = 20
coords = []
for x in range(anzahl):
    #rs.Addpoint( [x,0,0] )
    for y in range(anzahl):
        #rs.Addpoint( [x,y,0] )
        for z in range(10):
            coords.append( [x,y,z] )
            #rs.Addpoint( [x,y,z] )



# Kugel radius durchmesser punkt
# sphere
pS = [5,0,0]
coords = []
for i in range( 10001 ):
    pX = rs.VectorRotate( pS, 10.0*random.uniform(0,200), [0,0,1] )
    coords.append( pX)
rs.AddPoints( coords )
dm.getTime( 1 )





#################
#dm.eDup( 1 )
dm.zA( 0.9 )



