### https://iam.tugraz.at/diag/dm2/ue_03/demo_1030_01.py
### grabbed:  2021-10-22 10:59:45
#################################


import rhinoscriptsyntax as rs
import random, time, sys
##############################

rs.EnableRedraw( 0 )
rs.DeleteObjects( rs.AllObjects() )

abst = 5.5
radiusX= 10.5

def coords2sphere(myRadius, anzPts, makeCrvs, mindesZ):
    for i in range (anzPts):
        rco = [random.uniform(-abst, abst), random.uniform(-abst, abst), random.uniform(-abst, abst)]
        rs. AddPoint( cor ) 
        uni_vec= rs.VectorUnitize( cor )
        vec_sph= rs.VectorScale(uni_vec, myRadius)
        if makeCrvs and cor[2] >  mindesZ:
            rs.AddLine( cor, vec_sph )
        if cor[2] >  mindesZ:
            rs.Addpoint( vec_sph )

#rs.AddSphere ( [0,0,0], radiusX)
#rs.AddPoint (cor)


coords2sphere(10.8,1001, 1, 3.1)

#cor = {1.898, 8989.0, 0.776]
#print cor[2]
#print cor[0: -1]

#rs.ZoomExtents()