summaryrefslogtreecommitdiff
path: root/gcode/rings.py
blob: 2a9abe02a94599eae31c2b71c86ddd2bd90e2ff4 (plain) (blame)
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#! /usr/bin/python
# Copyright 2008 by Bdale Garbee <bdale@gag.com>.  GPLv2
# Copyright 2011 by Anthony Towns <aj@erisian.com.au>. GPLv2

import math
from rocket_gcode import *

Zfree = 0.2500          # height in Z to clear all obstructions
Speed = 10              # cutting speed

MMT_OD      = mm2inch(79.3)
Coupler_ID  = 3.74
Airframe_ID = 3.90
Nose_ID     = 3.75

FinCount = 3
FinWidth = mm2inch(6.25) # Actually 6.85, but allowance for wandering bit.


### AFT CR - Aeropack holes and fin slots - 1/8" bit
CutterOD = 0.125           # 1/8"
gcode = Gcode(output=open("mjbl3_cr_aft-aeropack.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)

RingThickness = 0.75
RingID = MMT_OD
RingOD = Airframe_ID
AeropackRotation = 15  # Get the holes out of alignment with fin slots.
AeropackDepth    = 0.8 # Go right through the bulkhead
AeropackStep     = 0.2 # cut in 0.2 inch increments
FinDepth     = RingThickness/2
FinIncrement = 0.1

gcode.comment("Aeropack retainer holes, depth %s" % (AeropackDepth,))
gcode.aeropack_75mm(AeropackRotation, AeropackDepth, AeropackStep)

gcode.comment("Fin slots, depth %1.3f in %1.1f increments" % (FinDepth, FinIncrement))
gcode.fin_slots(FinCount, RingID, RingOD, FinWidth, FinDepth, FinIncrement)

gcode.close()

### AFT CR - MMT/Airframe cuts - 1/4" bit.
CutterOD = 0.25           # 1/4" 
gcode = Gcode(output=open("mjbl3_cr_aft-rings.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)

RingID = MMT_OD
RingOD = Airframe_ID

for Zthrough in (0.25, 0.5, 0.8):
    gcode.Zdepth = Zthrough
    gcode.comment("MMT hole depth %s" % (Zthrough,))
    gcode.circle(RingID - CutterOD)

for Zthrough in (0.25, 0.5, 0.8):
    gcode.Zdepth = Zthrough
    gcode.comment("ring outer diameter")
    gcode.circle(RingOD + CutterOD)

gcode.close()

### FORWARD FIN CR - fin slots
CutterOD = 0.125           # 1/8"
gcode = Gcode(output=open("mjbl3_cr_finfwd-slots.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)

RingThickness = 0.75
RingID = MMT_OD
RingOD = Airframe_ID
FinDepth     = RingThickness/2
FinIncrement = 0.1

gcode.fin_slots(FinCount, RingID, RingOD, FinWidth, FinDepth, FinIncrement)

gcode.close()

### AFT CR - MMT/Airframe cuts - 1/4" bit.
CutterOD = 0.25           # 1/4" 
gcode = Gcode(output=open("mjbl3_cr_finfwd-rings.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)

RingID = MMT_OD
RingOD = Airframe_ID

for Zthrough in (0.25, 0.5, 0.8):
    gcode.Zdepth = Zthrough
    gcode.comment("MMT hole depth %s" % (Zthrough,))
    gcode.circle(RingID - CutterOD)

for Zthrough in (0.25, 0.5, 0.8):
    gcode.Zdepth = Zthrough
    gcode.comment("ring outer diameter")
    gcode.circle(RingOD + CutterOD)

gcode.close()

### ZIPPERLESS FORWARD CR
CutterOD = 0.25           # 1/4" 
gcode = Gcode(output=open("mjbl3_cr_zipperless.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)

RingID = MMT_OD
RingOD = Coupler_ID

for Zthrough in (0.25, 0.6):
    gcode.Zdepth = Zthrough
    gcode.comment("Zipperless CR, MMT diam")
    gcode.circle(RingID - CutterOD)

for Zthrough in (0.25, 0.6):
    gcode.Zdepth = Zthrough
    gcode.comment("Zipperless CR, coupler diam")
    gcode.circle(RingOD + CutterOD)

gcode.close()

### EBAY BULKHEAD HOLES
CutterOD = 0.125          # 1/8" 
gcode = Gcode(output=open("mjbl3_bh_ebay-holes1.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)

Allthread_width = 2.50

gcode.hole(x=0, y= (Allthread_width/2), depth=0.6, increment=0.3, speed=25)
gcode.hole(x=0, y=-(Allthread_width/2), depth=0.6, increment=0.3, speed=25)

gcode.close()

CutterOD = 0.25           # 1/4" 
gcode = Gcode(output=open("mjbl3_bh_ebay-holes2.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)

UBolt_width     = 0.945

gcode.hole(x= (UBolt_width/2), y=0, depth=0.6, increment=0.3, speed=25)
gcode.hole(x=-(UBolt_width/2), y=0, depth=0.6, increment=0.3, speed=25)

gcode.close()

### EBAY BULKHEADS
CutterOD = 0.25           # 1/4" 
gcode = Gcode(output=open("mjbl3_bh_ebay.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)

BulkheadOD      = Airframe_ID
StepOD          = Coupler_ID

gcode.Zdepth = 0.25
gcode.comment("ebay bulkhead - step, coupler diameter")
gcode.circle(StepOD + CutterOD)

for Zthrough in (0.25, 0.6):
    gcode.Zdepth = Zthrough
    gcode.comment("ebay bulkhead - outer diameter")
    gcode.circle(BulkheadOD + CutterOD)

gcode.close()

### Nosecone bulkhead
CutterOD = 0.25           # 1/4" 
gcode = Gcode(output=open("mjbl3_bh_nose.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)

BulkheadOD    = Nose_ID
HatchOD       = 2.0
HatchFlangeOD = 2.5

for Zthrough in (0.25, 0.6):
    gcode.Zdepth = Zthrough
    gcode.comment("Nose bulkhead, hatch.")
    gcode.circle(HatchOD - CutterOD)

gcode.Zdepth = 0.25
gcode.comment("Nose bulkhead, hatch flange")
gcode.circle(HatchFlangeOD - CutterOD)

for Zthrough in (0.25, 0.6):
    gcode.Zdepth = Zthrough
    gcode.comment("Nose bulkhead - outer diameter")
    gcode.circle(BulkheadOD + CutterOD)

gcode.close()

### Nosecone bulkhead - hatch slot
CutterOD = 0.125           # 1/8" 
gcode = Gcode(output=open("mjbl3_bh_nose-hatch-slot.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)

gcode.slot(startX=0, startY=0.75, stopX=0, stopY=-0.75, width=0.180, depth=0.6, increment=0.1)

gcode.close()

### Nosecone bulkhead - hatch
CutterOD = 0.25           # 1/4" 
gcode = Gcode(output=open("mjbl3_bh_nose-hatch.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)

HatchOD       = 2.0
HatchFlangeOD = 2.5

gcode.Zdepth = 0.25
gcode.comment("Nose bulkhead, hatch")
gcode.circle(HatchOD + CutterOD)

for Zthrough in (0.25, 0.6):
    gcode.Zdepth = Zthrough
    gcode.comment("Nose bulkhead, hatch flange.")
    gcode.circle(HatchFlangeOD + CutterOD)

gcode.close()