Browse Source

optimizing rail-laser (v2)

Thomas Buck 1 year 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,7 +4,7 @@ $fn = 50;
4 4
 
5 5
 bodies_gap = 0.05;
6 6
 
7
-laser_dia = 6.5;
7
+laser_dia = 6.5 + 0.2;
8 8
 laser_len = 14.0;
9 9
 
10 10
 bat_width = 18.0;
@@ -24,7 +24,7 @@ body_width = 25.0;
24 24
 body_length = 50.0;
25 25
 body_height = 42.0;
26 26
 body_frame_offset = 2.5;
27
-body_frame_gap = 0.5;
27
+body_frame_gap = 0.2;
28 28
 body_cube_rounding = 1.0;
29 29
 body_bat_off = 5.5;
30 30
 body_switch_off_x = bat_height + 6.0;
@@ -46,10 +46,10 @@ rail_lip_height = 1.0;
46 46
 rail_lock_width = 20.0;
47 47
 rail_lock_depth = 10.0;
48 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 51
 rail_lock_pin_height = 5.0;
52
-rail_lock_tab_len = 1.0;
52
+rail_lock_tab_len = 0.5;
53 53
 rail_lock_tab_depth = 2.0;
54 54
 rail_lock_whole_width = body_width + (2 * rail_lock_tab_len);
55 55
 rail_lock_tab_width = (rail_lock_whole_width - rail_lock_width) / 2;
@@ -59,23 +59,28 @@ rail_lock_spring_hole = 1.0;
59 59
 
60 60
 frame_gap = 0.25;
61 61
 frame_sphere = 20;
62
-frame_add_touch = 4.0;
62
+frame_add_touch = 3.0;
63 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 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 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 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 75
 frame_hole_off = 1.8;
74 76
 frame_hole_neg_off = 10;
75 77
 frame_hole_neg_len = 15;
76 78
 frame_hole_neg_deg_a = 9;
77 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 84
 frame_hole_neg_rad_small = frame_mid_len + ((frame_sphere + frame_tail_len) / 2) - frame_hole_off;
80 85
 frame_hole_neg_rad_large = frame_mid_len + ((frame_sphere + frame_tail_len) / 2) + frame_hole_off;
81 86
 frame_len = frame_sphere + frame_mid_len + frame_tail_len;
@@ -83,12 +88,15 @@ frame_len = frame_sphere + frame_mid_len + frame_tail_len;
83 88
 //body_frame_off = body_height - rail_height - (frame_sphere / 2) - body_frame_offset;
84 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 94
 module rail_lip(l) {
87 95
     hull() {
88
-        translate([-1, -0.001, 0])
96
+        translate([-1, -0.01, 0])
89 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,7 +125,7 @@ module rail_lock_internal(add = 0.0) {
117 125
         cube([rail_lock_tab_width + add, rail_lock_tab_depth + add, rail_lock_base_height + add], center = true);
118 126
     } else {
119 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 130
             translate([(rail_lock_width + add + rail_lock_tab_width + add) / 2, 0, 0])
123 131
             cube([rail_lock_tab_width + add, rail_lock_tab_depth + add, rail_lock_base_height + add + rail_lock_travel], center = true);
@@ -171,13 +179,22 @@ module laser_frame(added_gap = 0, negative = 0) {
171 179
             sphere(d = frame_sphere + added_gap);
172 180
             
173 181
             if (negative == 0) {
182
+                %translate([0, 0, frame_len - frame_sphere / 2])
183
+                cylinder(d = 0.5, h = 50);
184
+                
174 185
                 // mid section
175 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 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 198
                     //roundedcube([frame_tail_width + added_gap, frame_tail_width + added_gap, frame_tail_len]);
182 199
                 }
183 200
             } else {
@@ -199,17 +216,30 @@ module laser_frame(added_gap = 0, negative = 0) {
199 216
         
200 217
         if (negative == 0) {
201 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 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 224
             rotate([0, 90, 45]) {
208 225
                 cylinder(d = frame_mount_hole, h = frame_sphere);
209 226
             
210 227
                 rotate([-90, 0, 0])
211 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 244
             // x-axis holes
215 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,9 +267,9 @@ module switch(add = 0.0) {
237 267
     cube([switch_nub, switch_nub, switch_nub]);
238 268
     
239 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 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,13 +280,17 @@ module body(hole_dia) {
250 280
         //roundedcube([body_length, body_width, body_height], false, body_cube_rounding);
251 281
         
252 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 284
         rail(body_length + 2);
255 285
         
256 286
         // cutout and preview for laser frame
257 287
         translate([body_length - frame_len, body_width / 2, body_frame_off])
258 288
         rotate([0, 90, 0]) {
259 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 294
             %laser_frame();
261 295
         }
262 296
         
@@ -267,7 +301,7 @@ module body(hole_dia) {
267 301
         }
268 302
         
269 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 305
         rotate([-90, 0, 0]) {
272 306
             switch(body_switch_add);
273 307
             %switch(0);
@@ -275,14 +309,16 @@ module body(hole_dia) {
275 309
             // cutout for cabling
276 310
             // TODO not very nice,
277 311
             // with hardcoded values
278
-            translate([-0.001, -2.5, -8])
312
+            translate([-0.01, -2.5, -8])
279 313
             cube([18.5, 30, 9.5]);
280 314
         }
281 315
         
282 316
         // cutout and preview for rail locking mechanism
283 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 319
             rail_lock(0.5);
320
+            
321
+            translate([0, 0, -(rail_lock_travel * $t)])
286 322
             %rail_lock();
287 323
         }
288 324
         
@@ -330,8 +366,13 @@ module print() {
330 366
     rotate([90, 0, 0])
331 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 377
     translate([body_length + 10, 20, rail_lock_base_height / 2])
337 378
     rotate([0, 0, 90])
@@ -343,9 +384,9 @@ module print() {
343 384
 }
344 385
 
345 386
 //laser_frame();
346
-rail_lock();
387
+//rail_lock();
347 388
 
348 389
 //body_half(0);
349 390
 //body_half(1);
350 391
 
351
-//print();
392
+print();

Loading…
Cancel
Save