-
Notifications
You must be signed in to change notification settings - Fork 1
/
BotRit.rb
executable file
·56 lines (50 loc) · 1.31 KB
/
BotRit.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
module BotRit
$bitwidth = 0.125
$halfwidth = $bitwidth/2
TIERATE = 0.12
def drawzframe(minx,miny,maxx,maxy)
dwellus(0.1)
if minx > maxx then minx = maxx = (minx+maxx)/2 end
if miny > maxy then miny = maxy = (miny+maxy)/2 end
cutoPoint(minx,miny)
cutoPoint(minx,maxy)
cutoPoint(maxx,maxy)
cutoPoint(maxx,miny)
cutoPoint(minx,miny)
end
def drawzsquare(minx,miny,maxx,maxy)
minx += $halfwidth
miny += $halfwidth
maxx -= $halfwidth
maxy -= $halfwidth
drawzframe(minx,miny,maxx,maxy)
while (minx < maxx) and (miny < maxy)
minx += $bitwidth
miny += $bitwidth
maxx -= $bitwidth
maxy -= $bitwidth
drawzframe(minx,miny,maxx,maxy)
end
midx = (minx + maxx) / 2
#cutoPoint(midx,maxy)
#cutoPoint(midx,miny)
end
def box(minx,miny,maxx,maxy,zstart,zdepth,step)
incro = (Float(zdepth-zstart) / Float(step))
skimtoPoint(minx+$halfwidth,miny+$halfwidth,zstart+0.1)
for i in 1..step do
penetrate(zstart + (incro * i))
drawzsquare(minx,miny,maxx,maxy)
end
end
def dux(starx,stary,dendx,dendy,zstart,zdepth,step)
incro = (Float(zdepth-zstart) / Float(step))
skimtoPoint(starx,stary,zstart+0.1)
for i in 1..step do
penetrate(zstart + (incro * i))
if (i.divmod(2)[1] != 0) then
cutoPoint(dendx, dendy) else
cutoPoint(starx, stary) end
end
end
end