-
Notifications
You must be signed in to change notification settings - Fork 1
/
testsun.py
42 lines (26 loc) · 1.09 KB
/
testsun.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import rhinoscriptsyntax as rs
numberofpoints = rs.GetInteger("how many points?")
radius = rs.GetReal("what's the radius?")
rs.AddLayer("Sphere", [255,0,0])
rs.CurrentLayer("Sphere")
Sunsphere = rs.AddSphere([0,0,0], radius)
if ((numberofpoints > 0) and (radius > 0)):
#stuff if true
print "we're good"
dayname = rs.GetString("what day is this?")
print "the entered day name is:", dayname
rs.AddLayer(dayname, [0,0,255])
rs.CurrentLayer(dayname)
listofpoints = []
startpoint = rs.AddPoint([0,radius,0])
for i in range(numberofpoints):
elevation = rs.GetReal("what's the elevation?")
azimuth = rs.GetReal("what's the azimuth?")
azimuth *= -1
rs.RotateObject (startpoint, [0,0,0], elevation, axis=[1,0,0], copy=True)
rs.RotateObject (rs.FirstObject(), [0,0,0], azimuth, axis=[0,0,1], copy=False)
listofpoints.append(rs.FirstObject())
sunpath = rs.AddInterpCurve(listofpoints)
else:
#stuff if not true
print "please enter a real number above zero"