-
Notifications
You must be signed in to change notification settings - Fork 1
/
DudeDuderon.rb
executable file
·92 lines (81 loc) · 1.71 KB
/
DudeDuderon.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
require './Dude.rb'
require './Okuda.rb'
$bitwidth = 2.0/25.4
$halfwidth = $bitwidth/2
class Duderon < Dude
def initialize(n,z)
# @depth=0.85
@zstep = 4
super(n,z)
end
def dx(x)
return @@lipp + $halfwidth + (@wido*2)-x
#return x+@@lipp + $halfwidth
end
def bomron(x,y)
x = dx(x)
spyrtub(x,-y,0.333,0.333)
end
def eights(x,y)
x = x+@@lipp + $halfwidth
drillus(x,y,0,-0.2)
end
def alpsdot(x,y,theta)
skimtoPoint(x,y,0.1)
#innerrad =
outerrad = 3.0/25.4 - $halfwidth #3.2!
i = 0
z = 0
deepak = -0.40
incro = (Float(-deepak) / Float(@zstep))
drepak = deepak - incro
while z > drepak do
z -= incro / NUMSEGS
zz = max(z,deepak)
thetai = i % NUMSEGS
radioi = outerrad
if thetai < 6 then
thetai = 6
end
if thetai >26 then
thetai = 26
end
thetai += theta*NUMSEGS/360
yy = radioi * Math.sin(2 * thetai * Math::PI / NUMSEGS)
xx = radioi * Math.cos(2 * thetai * Math::PI / NUMSEGS)
cutoPointDeepo(x+xx,y+yy,zz)
i += 1
end
while z < 0 do
z += incro / NUMSEGS
zz = max(z,deepak)
thetai = i % NUMSEGS
radioi = outerrad
if thetai < 6 then
thetai = 7
end
if thetai >26 then
thetai = 25
end
thetai += theta*NUMSEGS/360
yy = radioi * Math.sin(2 * thetai * Math::PI / NUMSEGS)
xx = radioi * Math.cos(2 * thetai * Math::PI / NUMSEGS)
cutoPointDeepo(x+xx,y+yy,zz)
i += 1
end
end
def balmet(x,y)
x = dx(x)
alpsdot(x,y,90)
alpsdot(x,y,90)
#alpsdot(x,y,90)
tubo(x,y,0.35,0,-0.12,2)
spyrtub(x,y,2.2,2.2)
end
def boxo
fyral()
end
def ducabot
end
end
dudderat(Duderon)