-
Notifications
You must be signed in to change notification settings - Fork 1
/
CornuTop.rb
executable file
·154 lines (145 loc) · 4.31 KB
/
CornuTop.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
150
151
152
153
154
require './Jacksloon.rb'
require './Okuda.rb'
require './plumbENGRAVE/cornuSZILK.rb'
$bitwidth = 2.0/25.4
$halfwidth = $bitwidth/2
class CornuTop < Jacksloon
MARJ = 0.05 #0.25
@@numero = 0
def initialize(starx, stary)
@width = 6
@heigh = 4.7 ###1.95 ####wasz 2!!!
@depth = 0.55
@@lipp = 0.0
@zstep = 4
super(starx, stary)
end
def organoPHORM(arr,x,y,sig)
skimtoPoint(x+(sig*arr[0][1]),
y+(sig*arr[0][0]),0.1)
penetrate(-0.08)
arr.each{|rr| cutoPoint(x+(sig*rr[1]),y+(sig*rr[0]))}
end
def johnson(x,y)
grantubo(x,y,5.1/32,5.0/32,0,-@depth,3)
end
NUMSEGS = 32
def alpscirque(x,y,theta)
innerrad = 0.28
outerrad = 0.31
for i in 0..32 do
thetai = i
radioi = innerrad
if i < 3 then
thetai = 2
radioi = outerrad
end
if i >29 then
thetai = 30
radioi = outerrad
end
thetai += theta*NUMSEGS/360
yy = radioi * Math.sin(2 * thetai * Math::PI / NUMSEGS)
xx = radioi * Math.cos(2 * thetai * Math::PI / NUMSEGS)
cutoPoint(x+xx,y+yy)
end
thetai = 2 + theta*NUMSEGS/360
yy = outerrad * Math.sin(2 * thetai * Math::PI / NUMSEGS)
xx = outerrad * Math.cos(2 * thetai * Math::PI / NUMSEGS)
cutoPoint(x+xx,y+yy)
end
def alpspot(x,y,theta)
incro = (Float(0-@depth) / Float(@zstep))
skimtoPoint(x,y,0.1)
for i in 1..@zstep do
penetrate((incro * i))
alpscirque(x,y,theta)
end
end
def rotaframe(x,y,wido,hido,theta)
wido -= $bitwidth
hido -= $bitwidth
wido /= 2
hido /= 2
theta = Math::PI*theta/180
angol = Math.atan(hido/wido)
radio = Math.sqrt(hido*hido+wido*wido)
euler=Complex.polar(radio,angol+theta)
cutoPoint(x+euler.real,y+euler.imag)
euler=Complex.polar(radio,Math::PI-angol+theta)
cutoPoint(x+euler.real,y+euler.imag)
euler=Complex.polar(radio,Math::PI+angol+theta)
cutoPoint(x+euler.real,y+euler.imag)
euler=Complex.polar(radio,0-angol+theta)
cutoPoint(x+euler.real,y+euler.imag)
euler=Complex.polar(radio,angol+theta)
cutoPoint(x+euler.real,y+euler.imag)
end
def rotabox(x,y,wido,hido,theta)
incro = (Float(0-@depth) / Float(@zstep))
skimtoPoint(x,y,0.1)
for i in 1..@zstep do
penetrate((incro * i))
rotaframe(x,y,wido,hido,theta)
end
end
def swdpdt(x,y,theta)
#rotabox(x,y,0.32+$bitwidth,0.36,theta)
#rotabox(x,y,0.36,0.32+$bitwidth,theta)
rotabox(x,y,0.35,0.36+$bitwidth,theta)
end
def looscrew(x,y)
if $bitwidth == 0.125 then
drillus(x,y,0,-@depth)
else
tubo(x,y,1.0/14,0,-@depth,@zstep)
end
end
def boxo()
@curxo += MARJ
widochub = @width/2
organoPHORM($cornuSZILK,@curxo+widochub,@heighchub,1)
#alpspot(0,0,0)
drillus(@curxo+widochub-2.2,@heighchub-1.6,0,-@depth)
#drillus(@curxo+widochub-2.25,@heighchub-2.25,0,-@depth)
looscrew(@curxo+widochub-2.25,@heighchub-2.25)
tubo(@curxo+widochub-2.255,@heighchub-2.626,3.3/32,0,-@depth,@zstep)
#drillus(@curxo+widochub-2.25,@heighchub-4.55,0,-@depth)
looscrew(@curxo+widochub-2.25,@heighchub-4.55)
swdpdt(@curxo+widochub-1.443,@heighchub-2.740,-17)
alpspot(@curxo+widochub-1.665,@heighchub-3.274,180+163)
alpspot(@curxo+widochub-0.848,@heighchub-2.765,180+163)
alpspot(@curxo+widochub-1.058,@heighchub-3.709,180+163)
johnson(@curxo+widochub-0.131,@heighchub-2.748)
johnson(@curxo+widochub-0.426,@heighchub-4.016)
johnson(@curxo+widochub+0.521,@heighchub-2.681)
alpspot(@curxo+widochub+0.637,@heighchub-4.021,180+169)
johnson(@curxo+widochub+1.155,@heighchub-2.640)
tubo(@curxo+widochub+1.293,@heighchub-3.196,3.3/32,0,-@depth,@zstep)
johnson(@curxo+widochub+1.322,@heighchub-3.849)
johnson(@curxo+widochub+1.725,@heighchub-2.650)
tubo(@curxo+widochub+1.785,@heighchub-3.115,3.3/32,0,-@depth,@zstep)
johnson(@curxo+widochub+1.844,@heighchub-3.643)
drillus(@curxo+widochub+2.2,@heighchub-1.6,0,-@depth)
#drillus(@curxo+widochub+2.25,@heighchub-2.25,0,-@depth)
looscrew(@curxo+widochub+2.25,@heighchub-2.25)
tubo(@curxo+widochub+2.234,@heighchub-2.697,3.3/32,0,-@depth,@zstep)
#drillus(@curxo+widochub+2.25,@heighchub-4.55,0,-@depth)
looscrew(@curxo+widochub+2.25,@heighchub-4.55)
@curxo += @width /2
@myOkuda = Okuda.new(@curxo,@stary,@width+MARJ*2+$bitwidth,@heigh+@@lipp*2+$bitwidth,0.3)
@curxo += @width /2
@curxo += MARJ
return @curxo
end
def ducatop
end
def ducabot
@myOkuda.bokchoy(-@depth,1.0,12,10)
end
def duxo
@curxo += $bitwidth
return @curxo
end
end
stutterat(CornuTop)