Browse Source

optimizing rail-laser (v2)

Thomas Buck 4 years ago
parent
commit
6d93a16621
1 changed files with 73 additions and 32 deletions
  1. 73
    32
      rail-laser/rail-laser.scad

+ 73
- 32
rail-laser/rail-laser.scad View File

4
 
4
 
5
 bodies_gap = 0.05;
5
 bodies_gap = 0.05;
6
 
6
 
7
-laser_dia = 6.5;
7
+laser_dia = 6.5 + 0.2;
8
 laser_len = 14.0;
8
 laser_len = 14.0;
9
 
9
 
10
 bat_width = 18.0;
10
 bat_width = 18.0;
24
 body_length = 50.0;
24
 body_length = 50.0;
25
 body_height = 42.0;
25
 body_height = 42.0;
26
 body_frame_offset = 2.5;
26
 body_frame_offset = 2.5;
27
-body_frame_gap = 0.5;
27
+body_frame_gap = 0.2;
28
 body_cube_rounding = 1.0;
28
 body_cube_rounding = 1.0;
29
 body_bat_off = 5.5;
29
 body_bat_off = 5.5;
30
 body_switch_off_x = bat_height + 6.0;
30
 body_switch_off_x = bat_height + 6.0;
46
 rail_lock_width = 20.0;
46
 rail_lock_width = 20.0;
47
 rail_lock_depth = 10.0;
47
 rail_lock_depth = 10.0;
48
 rail_lock_base_height = 3.0;
48
 rail_lock_base_height = 3.0;
49
-rail_lock_pin_size = 5.0;
50
-rail_lock_pin_width = 10.0;
49
+rail_lock_pin_size = 5.23 - 0.1;
50
+rail_lock_pin_width = 12.0;
51
 rail_lock_pin_height = 5.0;
51
 rail_lock_pin_height = 5.0;
52
-rail_lock_tab_len = 1.0;
52
+rail_lock_tab_len = 0.5;
53
 rail_lock_tab_depth = 2.0;
53
 rail_lock_tab_depth = 2.0;
54
 rail_lock_whole_width = body_width + (2 * rail_lock_tab_len);
54
 rail_lock_whole_width = body_width + (2 * rail_lock_tab_len);
55
 rail_lock_tab_width = (rail_lock_whole_width - rail_lock_width) / 2;
55
 rail_lock_tab_width = (rail_lock_whole_width - rail_lock_width) / 2;
59
 
59
 
60
 frame_gap = 0.25;
60
 frame_gap = 0.25;
61
 frame_sphere = 20;
61
 frame_sphere = 20;
62
-frame_add_touch = 4.0;
62
+frame_add_touch = 3.0;
63
 frame_wall = 1.5;
63
 frame_wall = 1.5;
64
-frame_mount_hole = 3.0;
65
-frame_mount_hole_off = 6.0;
64
+frame_mount_hole = 2.85;
65
+frame_mount_hole_off_1 = 3.0;
66
+frame_mount_hole_off_2 = 8.0;
66
 frame_mid_len = (frame_mount_hole / 4) + (2 * frame_wall);
67
 frame_mid_len = (frame_mount_hole / 4) + (2 * frame_wall);
67
-frame_mid_dia = laser_dia + (2 * frame_wall);
68
+frame_mid_dia = 8; //laser_dia + (2 * frame_wall);
68
 frame_tail_len = 8.0;
69
 frame_tail_len = 8.0;
69
-frame_tail_width = frame_mid_dia + 0.5;
70
+frame_tail_len_add = 1.0;
71
+frame_tail_width = 5.5; //frame_mid_dia + 0.5;
70
 frame_negative_width = frame_sphere * 2 / 3 + 7;
72
 frame_negative_width = frame_sphere * 2 / 3 + 7;
71
-frame_hole_dia = 2.9;
72
-frame_hole_dia_arch = 3.3;
73
+frame_hole_dia = 2.85;
74
+frame_hole_dia_arch = 3.0 + 0.1;
73
 frame_hole_off = 1.8;
75
 frame_hole_off = 1.8;
74
 frame_hole_neg_off = 10;
76
 frame_hole_neg_off = 10;
75
 frame_hole_neg_len = 15;
77
 frame_hole_neg_len = 15;
76
 frame_hole_neg_deg_a = 9;
78
 frame_hole_neg_deg_a = 9;
77
 frame_hole_neg_deg_b = frame_hole_neg_deg_a;
79
 frame_hole_neg_deg_b = frame_hole_neg_deg_a;
78
 
80
 
81
+frame_brim_height = 0.5;
82
+frame_brim_width = 20.0;
83
+
79
 frame_hole_neg_rad_small = frame_mid_len + ((frame_sphere + frame_tail_len) / 2) - frame_hole_off;
84
 frame_hole_neg_rad_small = frame_mid_len + ((frame_sphere + frame_tail_len) / 2) - frame_hole_off;
80
 frame_hole_neg_rad_large = frame_mid_len + ((frame_sphere + frame_tail_len) / 2) + frame_hole_off;
85
 frame_hole_neg_rad_large = frame_mid_len + ((frame_sphere + frame_tail_len) / 2) + frame_hole_off;
81
 frame_len = frame_sphere + frame_mid_len + frame_tail_len;
86
 frame_len = frame_sphere + frame_mid_len + frame_tail_len;
83
 //body_frame_off = body_height - rail_height - (frame_sphere / 2) - body_frame_offset;
88
 //body_frame_off = body_height - rail_height - (frame_sphere / 2) - body_frame_offset;
84
 body_frame_off = (frame_sphere / 2) + body_frame_offset;
89
 body_frame_off = (frame_sphere / 2) + body_frame_offset;
85
 
90
 
91
+laser_preview_angle_x = -10 + (20 * $t);
92
+laser_preview_angle_y = -10 + (20 * $t);
93
+
86
 module rail_lip(l) {
94
 module rail_lip(l) {
87
     hull() {
95
     hull() {
88
-        translate([-1, -0.001, 0])
96
+        translate([-1, -0.01, 0])
89
         cube([l + 2, 0.2, rail_lip_width_big]);
97
         cube([l + 2, 0.2, rail_lip_width_big]);
90
-        translate([-1, rail_lip_height - 0.001, (rail_lip_width_big - rail_lip_width_small) / 2])
91
-        cube([l + 2, 0.001, rail_lip_width_small]);
98
+        translate([-1, rail_lip_height - 0.01, (rail_lip_width_big - rail_lip_width_small) / 2])
99
+        cube([l + 2, 0.01, rail_lip_width_small]);
92
     }
100
     }
93
 }
101
 }
94
 
102
 
117
         cube([rail_lock_tab_width + add, rail_lock_tab_depth + add, rail_lock_base_height + add], center = true);
125
         cube([rail_lock_tab_width + add, rail_lock_tab_depth + add, rail_lock_base_height + add], center = true);
118
     } else {
126
     } else {
119
         translate([0, 0, -rail_lock_travel / 2]) {
127
         translate([0, 0, -rail_lock_travel / 2]) {
120
-            cube([rail_lock_width + add + 0.001, rail_lock_depth + add, rail_lock_base_height + add + rail_lock_travel + 0.001], center = true);
128
+            cube([rail_lock_width + add + 0.01, rail_lock_depth + add, rail_lock_base_height + add + rail_lock_travel + 0.01], center = true);
121
         
129
         
122
             translate([(rail_lock_width + add + rail_lock_tab_width + add) / 2, 0, 0])
130
             translate([(rail_lock_width + add + rail_lock_tab_width + add) / 2, 0, 0])
123
             cube([rail_lock_tab_width + add, rail_lock_tab_depth + add, rail_lock_base_height + add + rail_lock_travel], center = true);
131
             cube([rail_lock_tab_width + add, rail_lock_tab_depth + add, rail_lock_base_height + add + rail_lock_travel], center = true);
171
             sphere(d = frame_sphere + added_gap);
179
             sphere(d = frame_sphere + added_gap);
172
             
180
             
173
             if (negative == 0) {
181
             if (negative == 0) {
182
+                %translate([0, 0, frame_len - frame_sphere / 2])
183
+                cylinder(d = 0.5, h = 50);
184
+                
174
                 // mid section
185
                 // mid section
175
                 translate([0, 0, frame_len - frame_sphere - frame_mid_len - 0.5])
186
                 translate([0, 0, frame_len - frame_sphere - frame_mid_len - 0.5])
176
-                cylinder(d = frame_mid_dia + added_gap, h = frame_mid_len + frame_add_touch + 1.0);
187
+                hull() {
188
+                    translate([-(frame_tail_width + added_gap) / 2, -(frame_tail_width + added_gap) / 2, 0])
189
+                    cube([frame_tail_width + added_gap, frame_tail_width + added_gap, frame_tail_len]);
190
+                    
191
+                    translate([0, 0, frame_mid_len + frame_add_touch])
192
+                    cylinder(d = frame_mid_dia + added_gap, h = 1.0);
193
+                }
177
                 
194
                 
178
                 // bottom cube
195
                 // bottom cube
179
-                translate([-(frame_tail_width + added_gap) / 2, -(frame_tail_width + added_gap) / 2, frame_len - frame_sphere - frame_mid_len - frame_tail_len]) {
180
-                    cube([frame_tail_width + added_gap, frame_tail_width + added_gap, frame_tail_len]);
196
+                translate([-(frame_tail_width + added_gap) / 2, -(frame_tail_width + added_gap) / 2, frame_len - frame_sphere - frame_mid_len - frame_tail_len - frame_tail_len_add]) {
197
+                    cube([frame_tail_width + added_gap, frame_tail_width + added_gap, frame_tail_len + frame_tail_len_add]);
181
                     //roundedcube([frame_tail_width + added_gap, frame_tail_width + added_gap, frame_tail_len]);
198
                     //roundedcube([frame_tail_width + added_gap, frame_tail_width + added_gap, frame_tail_len]);
182
                 }
199
                 }
183
             } else {
200
             } else {
199
         
216
         
200
         if (negative == 0) {
217
         if (negative == 0) {
201
             // cutout for laser itself
218
             // cutout for laser itself
202
-            translate([0, 0, -1])
203
-            cylinder(d = laser_dia + (2 * frame_gap), h = frame_len + 2);
219
+            translate([0, 0, frame_len - frame_sphere + 1])
220
+            cylinder(d = laser_dia + (2 * frame_gap), h = frame_sphere);
204
         
221
         
205
             // holding screws for laser
222
             // holding screws for laser
206
-            translate([0, 0, frame_len - (frame_mount_hole / 2) - frame_mount_hole_off])
223
+            translate([0, 0, frame_len - (frame_mount_hole / 2) - frame_mount_hole_off_1])
207
             rotate([0, 90, 45]) {
224
             rotate([0, 90, 45]) {
208
                 cylinder(d = frame_mount_hole, h = frame_sphere);
225
                 cylinder(d = frame_mount_hole, h = frame_sphere);
209
             
226
             
210
                 rotate([-90, 0, 0])
227
                 rotate([-90, 0, 0])
211
                 cylinder(d = frame_mount_hole, h = frame_sphere);
228
                 cylinder(d = frame_mount_hole, h = frame_sphere);
212
             }
229
             }
230
+            translate([0, 0, frame_len - (frame_mount_hole / 2) - frame_mount_hole_off_2])
231
+            rotate([0, 90, 45]) {
232
+                cylinder(d = frame_mount_hole, h = frame_sphere);
233
+            
234
+                rotate([-90, 0, 0])
235
+                cylinder(d = frame_mount_hole, h = frame_sphere);
236
+            }
237
+            
238
+            // cable cutout for laser
239
+            //rotate([0, 0, -90])
240
+            translate([0, 5, 6.5])
241
+            rotate([30, 0, 0])
242
+            cylinder(d = 2.5, h = 10);
213
             
243
             
214
             // x-axis holes
244
             // x-axis holes
215
             translate([-frame_tail_width / 2 - 1, 0, frame_len - frame_sphere - frame_mid_len - frame_tail_len + (frame_tail_len / 2) - frame_hole_off])
245
             translate([-frame_tail_width / 2 - 1, 0, frame_len - frame_sphere - frame_mid_len - frame_tail_len + (frame_tail_len / 2) - frame_hole_off])
237
     cube([switch_nub, switch_nub, switch_nub]);
267
     cube([switch_nub, switch_nub, switch_nub]);
238
     
268
     
239
     translate([(switch_length - switch_length_body) / 4, switch_width / 2, 0]) {
269
     translate([(switch_length - switch_length_body) / 4, switch_width / 2, 0]) {
240
-        cylinder(d = switch_hole_dia, h = switch_height + (switch_nub * 4));
270
+        cylinder(d = switch_hole_dia, h = switch_height + 1);
241
         translate([switch_hole_dist, 0, 0])
271
         translate([switch_hole_dist, 0, 0])
242
-        cylinder(d = switch_hole_dia, h = switch_height + (switch_nub * 4));
272
+        cylinder(d = switch_hole_dia, h = switch_height + 1);
243
     }
273
     }
244
 }
274
 }
245
 
275
 
250
         //roundedcube([body_length, body_width, body_height], false, body_cube_rounding);
280
         //roundedcube([body_length, body_width, body_height], false, body_cube_rounding);
251
         
281
         
252
         // cutout for rail
282
         // cutout for rail
253
-        translate([-1, (body_width - rail_width) / 2, body_height - rail_height + 0.001])
283
+        translate([-1, (body_width - rail_width) / 2, body_height - rail_height + 0.01])
254
         rail(body_length + 2);
284
         rail(body_length + 2);
255
         
285
         
256
         // cutout and preview for laser frame
286
         // cutout and preview for laser frame
257
         translate([body_length - frame_len, body_width / 2, body_frame_off])
287
         translate([body_length - frame_len, body_width / 2, body_frame_off])
258
         rotate([0, 90, 0]) {
288
         rotate([0, 90, 0]) {
259
             laser_frame(body_frame_gap, 1);
289
             laser_frame(body_frame_gap, 1);
290
+            
291
+            translate([0, 0, frame_len - frame_sphere / 2])
292
+            rotate([laser_preview_angle_x, laser_preview_angle_y, 180])
293
+            translate([0, 0, -(frame_len - frame_sphere / 2)])
260
             %laser_frame();
294
             %laser_frame();
261
         }
295
         }
262
         
296
         
267
         }
301
         }
268
         
302
         
269
         // cutout and preview for switch
303
         // cutout and preview for switch
270
-        translate([body_switch_off_x, body_width - switch_height + 0.001, body_height - rail_height - body_switch_off_y])
304
+        translate([body_switch_off_x, body_width - switch_height + 0.01, body_height - rail_height - body_switch_off_y])
271
         rotate([-90, 0, 0]) {
305
         rotate([-90, 0, 0]) {
272
             switch(body_switch_add);
306
             switch(body_switch_add);
273
             %switch(0);
307
             %switch(0);
275
             // cutout for cabling
309
             // cutout for cabling
276
             // TODO not very nice,
310
             // TODO not very nice,
277
             // with hardcoded values
311
             // with hardcoded values
278
-            translate([-0.001, -2.5, -8])
312
+            translate([-0.01, -2.5, -8])
279
             cube([18.5, 30, 9.5]);
313
             cube([18.5, 30, 9.5]);
280
         }
314
         }
281
         
315
         
282
         // cutout and preview for rail locking mechanism
316
         // cutout and preview for rail locking mechanism
283
         translate([body_length - body_rail_lock_off_x, body_width / 2, rail_lock_base_height / 2 + body_height - rail_height - body_rail_lock_off_z])
317
         translate([body_length - body_rail_lock_off_x, body_width / 2, rail_lock_base_height / 2 + body_height - rail_height - body_rail_lock_off_z])
284
-        rotate([0, 0, 90]) {
318
+        rotate([0, 0, -90]) {
285
             rail_lock(0.5);
319
             rail_lock(0.5);
320
+            
321
+            translate([0, 0, -(rail_lock_travel * $t)])
286
             %rail_lock();
322
             %rail_lock();
287
         }
323
         }
288
         
324
         
330
     rotate([90, 0, 0])
366
     rotate([90, 0, 0])
331
     body_half(1);
367
     body_half(1);
332
     
368
     
333
-    translate([body_length + 10, body_height + 2, 0])
334
-    laser_frame(0, 0);
369
+    translate([body_length + (frame_brim_width / 2) + 5, body_height + (frame_brim_width / 2) + 5, 0]) {
370
+        translate([0, 0, frame_tail_len_add])
371
+        laser_frame(0, 0);
372
+        
373
+        translate([0, 0, frame_brim_height / 2])
374
+        cube([frame_brim_width, frame_brim_width, frame_brim_height], center = true);
375
+    }
335
     
376
     
336
     translate([body_length + 10, 20, rail_lock_base_height / 2])
377
     translate([body_length + 10, 20, rail_lock_base_height / 2])
337
     rotate([0, 0, 90])
378
     rotate([0, 0, 90])
343
 }
384
 }
344
 
385
 
345
 //laser_frame();
386
 //laser_frame();
346
-rail_lock();
387
+//rail_lock();
347
 
388
 
348
 //body_half(0);
389
 //body_half(0);
349
 //body_half(1);
390
 //body_half(1);
350
 
391
 
351
-//print();
392
+print();

Loading…
Cancel
Save