]> www.fi.muni.cz Git - things.git/commitdiff
led-arrow: bigger version with two screw mounts
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 20 May 2015 18:51:03 +0000 (20:51 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 20 May 2015 18:51:03 +0000 (20:51 +0200)
led-arrow.scad

index 768bba5c203776308c243cd94a4cd43d99e956bf..22719e41ead0469981450968928d811ce2b87a9b 100644 (file)
@@ -1,77 +1,86 @@
 eps = 0.01;
 infty = 100;
 
-module chamber() {
-       hull() {
-               for (i = [-1, 1]) {
-                       translate([-3, 0, 0.5])
-                               scale([1.25, 1, 1])
-                               cylinder(r1 = 8, r2 = 9, h = 4, $fn = 3);
-                       rotate([0, 35*i, 0]) {
-                               translate([0, 0, 7])
-                               rotate([0, 0, 45])
-                               cylinder(r = 10/2, h = 4, $fn = 4);
-                       }
-               }
-       }
-       for (i = [-1, 1]) {
-                       rotate([0, 35*i, 0])
-                               translate([0, 0, 10])
-                                       cylinder(r = 6.0/2, h = 5, $fn = 6);
-                               intersection() {
-                               rotate([0, 35*i, 0])
-                               translate([0, 0, 15-eps])
-                                       cylinder(r = 8/2, h = 10, $fn = 6);
-                               translate([-30/2, -15/2, eps])
-                                       cube([30, 15, 15]);
-                               }
-               difference() {
-                       translate([-32/2, -16/2, 15])
-                               cube([32, 16, 20]);
-                       
-                       translate([screw_x-12/2, screw_y-12/2,0])
-                               cube([12, 12, infty]);
-               }
-       }
+wall = 1.5;
 
-}
+led_d = 10 + 0.5;
+led_angle = 10;
+led_depth = 4;
+led_x = led_d/2+0.75;
+
+body_x = led_d + 2*led_x + 15;
+body_d = 14;
+top_off = body_d*tan(led_angle);
+body_y = led_d + 2*top_off + 5*wall;
+base_w = led_d + 4*wall;
+
+screw_d = 3.8;
+screw_head = 8;
+// screw_y = led_d/2+screw_head/2+wall;
+screw_x = body_x/2 +wall + screw_head/2;
+screw_wall = 2.5;
 
-screw_x = 5;
-screw_y = 11;
+cable_w = 7;
+cable_h = screw_wall;
 
 module body() {
        hull() {
-               // top cube
-               translate([-36/2, -20/2, 15])
-                       cube([36, 20, 5]);
-               // bottom triangle
-               translate([-3, 0, 0])
-                       scale([1.5, 1, 1])
-                       cylinder(r = 11, h = eps, $fn = 3);
-               // screw base
-               translate([screw_x-12/2, screw_y-12/2,17])
-                       cube([12, 12, 3]);
+               for (i = [-1, 1]) translate([i*led_x, 0, 0])
+                       cylinder(r = base_w/2, h = eps);
+       //      translate([-led_x-led_d/2-wall, -led_d/2-wall, 0])
+       //              cube([2*led_x + led_d + 2*wall, led_d+2*wall, eps]);
+               translate([-body_x/2, -body_y/2, body_d-screw_wall])
+                       cube([body_x, body_y, screw_wall]);
+               for (i = [-1, 1]) scale([i, 1, 1]) {
+                       translate([screw_x-screw_head/2, -screw_head/2-wall, body_d-screw_wall])
+                               cube([screw_head, screw_head+2*wall, screw_wall]);
+                       translate([screw_x-screw_head/2, -screw_head/2-wall, 0])
+                               cube([screw_head/2, screw_head+2*wall, eps]);
+               }
+       }
+};
+       
+
+module main_hole() {
+       hull() {
+               for (i = [-1, 1])
+                       rotate([led_angle, 0, 0]) {
+                               translate([i*led_x, 0, led_depth])
+                                       cylinder(r = led_d/2+wall/2, h = eps);
+                       }
+               translate([-body_x/2+wall, -body_y/2+wall, body_d-screw_wall])
+                       cube([body_x-2*wall, body_y-2*wall, screw_wall+eps]);
        }
+       for (i = [-1, 1])
+               rotate([led_angle, 0, 0])
+                       translate([i*led_x, 0, led_depth])
+                               cylinder(r = led_d/2+wall/2, h = infty);
 }
 
-module light() {
+difference() {
+       body();
+       // LED holes
+       for (i = [-1, 1])
+               rotate([led_angle, 0, 0])
+                       translate([i*led_x, 0, -infty/2])
+                               cylinder(r = led_d/2, h = infty);
+       // main hole
        difference() {
-               body();
-               chamber();
+               main_hole();
+//             translate([-screw_head/2-wall, screw_y-screw_head/2-wall, 0])
+//                     cube([screw_head+2*wall, screw_head+2*wall, infty]);
+       };
+       for (i = [-1, 1]) scale([i, 1, 1]) {
                // screw head hole
-               translate([-4+screw_x, screw_y-8/2, 17-infty])
-                       cube([8, infty, infty]);
+               translate([screw_x-screw_head/2, -screw_head/2, -eps])
+                       cube([screw_head+wall, screw_head, body_d-screw_wall]);
                // screw hole
-               translate([screw_x-4, screw_y-4/2, -eps])
-                       cube([8, 4, infty]);
-
-               // cable hole
-               translate([-9-eps, 0, 17])
-                       cube([8, infty, infty]);
-
-               // debug
-               // translate([-infty/2, -infty, -infty/2]) cube(infty);
+               translate([screw_x-screw_d/2, -screw_head/2, -eps])
+                       cube([screw_d, screw_head, infty]);
        }
+       // cable hole
+       translate([-led_x, 0, 0])
+               rotate([0, 0, 30])
+               translate([-infty, -cable_w/2, body_d-cable_h])
+                       cube([infty, cable_w, cable_h+eps]);
 }
-
-light();