-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dudetop.rb
executable file
·149 lines (136 loc) · 3.06 KB
/
Dudetop.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
require './Dude.rb'
$bitwidth = 2.0/25.4
$halfwidth = $bitwidth/2
class Duderon < Dude
def initialize(n,z)
@zstep = 4
super(n,z)
end
def max (x,y)
if (x>y) then return x
else return y end
end
def brasso_specifico(x,y)
skimtoPoint(x,y,0.1)
thetai = 0
maxrad = 1.0/8.0 - 1.0/25.4
radif = 1.0/8.0 - 2.0/25.4
i = 0
z = 0
incro = (Float(@depth) / Float(@zstep))
while z > -@depth do
z -= incro / NUMSEGS
radioi = maxrad - (z/-@depth)*radif
radioi /= 2.0
yy = radioi * Math.sin(2 * i * Math::PI / NUMSEGS)
xx = radioi * Math.cos(2 * i * Math::PI / NUMSEGS)
cutoPointDeepo(x+xx,y+yy,z)
i += 1
end
while z < 0 do
z += incro / NUMSEGS
radioi = maxrad - (z/-@depth)*radif
radioi /= 2.0
yy = radioi * Math.sin(2 * i * Math::PI / NUMSEGS)
xx = radioi * Math.cos(2 * i * Math::PI / NUMSEGS)
cutoPointDeepo(x+xx,y+yy,z)
i += 1
end
end
def dx(x)
return @@lipp + $halfwidth + (@wido*2)-x
#return x+@@lipp + $halfwidth
end
def brasso(x,y)
x = dx(x)
if @nodes=="BRASSO" then brasso_specifico(x,y)
else johnson(x,y) end
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.45
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,1.5,0)
end
def omronish(x,y)
x = dx(x)
tubo(x,y,0.35,0,-0.11,1)
tubo(x,y,0.38/2.0,-0.11,-0.4,3)
spyrtub(x,y,0.5,0)
end
def bomron(x,y)
omronish(x,y)
x=dx(x)
tubo(x,-y,0.25,0,-0.333,3)
spyrtub(x,-y,0.2,0)
end
def eights(x,y)
x = dx(x)
spyrtub(x,y,1.0/14,0.15/32)
end
def cronktor(x,y)
for i in 0..5 do
box(x-0.7,y-0.5+Float(i)/10,
x+0.7,y,
-Float(i)/15,-Float(i+1)/15,1)
end
end
def boxo
if @zygot=="FYRALL" then fyral()
else srine() end
xoff=0.70
yoff=1.95
#omronish(dx(xoff),yoff)
#omronish(dx(16-xoff),yoff)
#omronish(dx(16-xoff),-yoff)
#omronish(dx(xoff),-yoff)
cronktor(@hawi, 2.4)
end
end
dudderat(Duderon)