############################
### diag @ IAM @ DM2_w25 ###
### hu_02 setUp_ver00    ### see examples @ DM2_w23 hu_02 !
############################


##############################
import rhinoscriptsyntax as rs
import random, time, sys   ###
sys.path.append("P:/")     ###                  ### diag's path to DM_lib.py                                                 
sys.path.append("P:/WWW/lukschme/dm2/")             ### *your* path to DM_lib.py                                            
sys.path.append("/Users/macpro/Desktop/DM2")    ### *your* path to DM_lib.py         
sys.path.append("P:/WWW/sirren/")                ### *your* path to DM_lib.py         
import DM_lib as dm        ###                  ### "dm" is alias for DM_lib / for adressing definitions in  DM_lib
############################## reload(dm)
reload(dm)

for pth in sys.path: print pth
print


if 1:

    rs.ShowGrid(show=0)
    rs.ShowGridAxes(show=0)
    rs.ViewDisplayMode(mode="Wireframe")
    rs.EnableRedraw(0)
    dm.PointRadius(displayModeX=0, rad=3, styl=3)
    dm.printDisplay(state=0)
    
    rs.DeleteObjects(rs.AllObjects())
    
    allCoords = dm.setUp_hu_02( anzahl=8*4,  rotateSqu=random.uniform(0,1001) )
    coordsCir=allCoords[0]
    coordsSqu=allCoords[1]
    
    ##### check setup - just visualization of coords
    ##### don't execute  @ final version of homework
    if 1:
        rs.AddPoints( coordsCir )
        rs.AddPoints( coordsSqu )
    if 0:
        rs.ObjectColor(dm.textDots(coordsCir), [111,0,11])
        rs.ObjectColor(dm.textDots(coordsSqu), [11,0,111])
    if 0:
        rs.AddCurve( coordsCir, 1)
        rs.AddCurve( coordsSqu, 1)
        for i in range( len(coordsSqu) ):
            p0  = coordsCir[i]
            p1  = coordsSqu[i]
            lin = rs.AddLine(p0, p1)
            rs.ObjectName(lin, "linx_"+str(i))
            rs.ObjectColor(lin, [222*(i!=0), 22*(i!=0), 222])
            rs.ObjectPrintWidth( lin, 1.0*(i==0) )
    ##### end check setup




################ here you go as you go:
### rs.DeleteObjects( rs.AllObjects())

################
rs.ZoomExtents()




