-
Notifications
You must be signed in to change notification settings - Fork 1
/
BotRot.rb
executable file
·99 lines (90 loc) · 1.79 KB
/
BotRot.rb
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
require './BotRit.rb'
module BotRot
include BotRit
NUMSEGS = 32
def drawzcirque(x,y,r)
numsegs = Integer(r*32+1)
for i in 0..NUMSEGS do
xx = r * Math.sin(2 * i * Math::PI / NUMSEGS)
yy = r * Math.cos(2 * i * Math::PI / NUMSEGS)
cutoPoint(x+xx,y+yy)
end
end
def drawzdisque(x,y,r)
r -= $halfwidth
while r > 0
drawzcirque(x,y,r)
r -= $bitwidth
end
end
def tubo(x,y,r,zstart,zdepth,step)
incro = (Float(zdepth-zstart) / Float(step))
skimtoPoint(x,y,zstart+0.1)
for i in 1..step do
penetrate(zstart + (incro * i))
drawzdisque(x,y,r)
end
end
def drawzarc(x,y,r)
numsegs = Integer(r*32+1)
for i in 0..NUMSEGS do
xx = r * Math.sin(i * Math::PI / NUMSEGS)
yy = r * Math.cos(i * Math::PI / NUMSEGS)
cutoPoint(x+xx,y+yy)
end
end
def drawzare(x,y,r)
numsegs = Integer(r*32+1)
for i in 0..NUMSEGS do
yy = r * Math.sin(i * Math::PI / NUMSEGS)
xx = r * Math.cos(i * Math::PI / NUMSEGS)
cutoPoint(x+xx,y+yy)
end
end
def drawzlun(x,y,r)
if (r<0) then
r += $halfwidth
while r < 0
drawzarc(x,y,r)
r += $bitwidth
end
else
r -= $halfwidth
while r > 0
drawzarc(x,y,r)
r -= $bitwidth
end
end
end
def drawzrun(x,y,r)
if (r<0) then
r += $halfwidth
while r < 0
drawzare(x,y,r)
r += $bitwidth
end
else
r -= $halfwidth
while r > 0
drawzare(x,y,r)
r -= $bitwidth
end
end
end
def lune(x,y,r,zstart,zdepth,step)
incro = (Float(zdepth-zstart) / Float(step))
skimtoPoint(x,y,zstart+0.1)
for i in 1..step do
penetrate(zstart + (incro * i))
drawzlun(x,y,r)
end
end
def rune(x,y,r,zstart,zdepth,step)
incro = (Float(zdepth-zstart) / Float(step))
skimtoPoint(x,y,zstart+0.1)
for i in 1..step do
penetrate(zstart + (incro * i))
drawzrun(x,y,r)
end
end
end