-
Notifications
You must be signed in to change notification settings - Fork 1
/
NobNob.rb
executable file
·82 lines (74 loc) · 1.56 KB
/
NobNob.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
require './PlumPott.rb'
$bitwidth = 2.0/25.4
$halfwidth = $bitwidth/2.0
class NobNob < PlumPott
MARJ = 0.05 #0.25
@@numero = 0
def initialize(starx, stary)
@width = 12
@heigh = 8
@depth = 0.6
@@lipp = 0.0
@zstep = 4
super(starx, stary)
end
def max (x,y)
if (x>y) then return x
else return y end
end
def alpsdot(x,y,theta)
skimtoPoint(x,y,0.1)
#innerrad =
outerrad = 3.1/25.4 - $halfwidth
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 = 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 dwank(x,y,r,p)
dux(x-0.175,y+(r*p),x+0.175,y+r*p,0,-0.3-0.125,2)
dux(x-0.175,y+r*p+0.01,x+0.175,y+r*p+0.01,0,-0.3-0.125,2)
end
def joff(x,y,r)
screwid = 0.125
threadoff = screwid/2 - $halfwidth
alpsdot(x,y,90)
alpsdot(x,y,90)
#tubo(x,y,3.1/25.4,0,-0.5,3)
tubo(x,y,0.35,0,-0.12,2)
dwank(x,y,r,0.333)
dwank(x,y,r,0.666)
dux(x-threadoff,y,x-threadoff,y+r,0,-0.3-(screwid/2),2)
dux(x+threadoff,y,x+threadoff,y+r,0,-0.3-(screwid/2),2)
box(x-0.125,y+1.2,x+0.125,y+1.5,0,-0.3-0.125,2)
spyrtub(0,0,r,r)
end
def boxo()
joff(0,0,1.5)
end
def ducatop
end
def ducabot
end
def duxo
return 0 end
end
stutterat(NobNob)