]> www.fi.muni.cz Git - bike-lights.git/commitdiff
part/statuslight.scad: holder for AZUB recumbents
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Sat, 21 Sep 2013 20:53:47 +0000 (22:53 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Sat, 21 Sep 2013 20:53:47 +0000 (22:53 +0200)
This is a status lights holder for AZUB recumbents (mine is AZUB Apus).
It is supposed to be installed on top of the front derailler tube.
The bottom hole is for speedometer illumination LED, and the rear hole
is for error/status LED.

The front derailler tube is -35 degrees from the horizontal plane,
and the line of sight (for the status LED) is + 15 degrees above
the horizontal plane. It is designed for 3mm LEDs.

This is a quick and dirty work, it is not parametrized enough.
FIXME: It would be better to have the object internal hole as two
cones, each for one of LEDs - it would simplify the LED installation.

parts/statuslights.scad [new file with mode: 0644]

diff --git a/parts/statuslights.scad b/parts/statuslights.scad
new file mode 100644 (file)
index 0000000..e46673b
--- /dev/null
@@ -0,0 +1,157 @@
+debug = 1;
+tube_diam = 25;
+tube_angle = 35;
+view_angle = 15;
+
+wall = 2;
+led_w = 3;
+screw_hole = 3.5;
+screw_head = 5;
+screw_base = 3;
+epsilon=0.01;
+
+module outer_shape() {
+       difference() {
+               hull() {
+                       translate([-26, 0, 5])
+                       rotate([0, -70, 0])
+                       scale([2, 1, 1])
+                               cylinder(r=6, h=1);
+
+                       scale([1, 1, 1/2])
+                               sphere(r=tube_diam/2, center=true);
+               }
+
+               translate([0, 0, -100+epsilon])
+                       cube(200, center=true);
+
+               translate([-25, 0, 0])
+                       rotate([0, -35, 0])
+                       translate([-100, 0, 0])
+                       cube(200, center=true);
+       }
+}
+
+module inner_shape() {
+       difference() {
+               hull() {
+                       translate([-26-epsilon, 0, 5])
+                       rotate([0, -70, 0])
+                       scale([2.5, 1, 1])
+                               cylinder(r=4, h=1);
+
+                       scale([1, 1, 1/2])
+                               sphere(r=tube_diam/2 - 4, center=true);
+               }
+
+               translate([0, 0, 2+-100+epsilon])
+                       cube(200, center=true);
+
+               translate([-22, 0, 0])
+                       rotate([0, -35, 0])
+                       translate([-100, 0, 0])
+                       cube(200, center=true);
+       }
+}
+
+module screw_hole(d1, d2, z_base) {
+       union() {
+               // body
+               translate([0, 0, -epsilon])
+                       cylinder(r=d1/2, h=z_base + 2*epsilon);
+               // head
+               translate([0, 0, z_base])
+                       cylinder(r=d2/2, h=20);
+       }
+}
+
+module front_hole() {
+       difference() {
+               inner_shape();
+               translate([-35, 0, 0])
+               rotate([0, view_angle + tube_angle, 0])
+               translate([100, 0, 0]) cube([200, 200, 200], center=true);
+       }
+}
+
+module inner_hole() {
+       intersection() {
+               inner_shape();
+
+               translate([-32, 0, 0])
+               rotate([0, view_angle + tube_angle, 0])
+               translate([100, 0, 0]) cube([200, 200, 200], center=true);
+
+               translate([-27, 0, 0])
+               rotate([0, 20, 0])
+               translate([100, 0, 0]) cube([200, 200, 200], center=true);
+
+               translate([-108, 0, 0]) cube([200, 200, 200], center=true);
+       }
+}
+
+module cable_hole() {
+       translate([-10, 0, -epsilon])
+       difference() {
+               cylinder(r=6.5, h=3);
+               translate([12-epsilon, 0, 0]) cube(20, center=true);
+       }
+}
+
+module tube() {
+       // presmykacova trubka
+       color("grey") {
+               rotate([0, -tube_angle, 0])
+               translate([0, 0, -50])
+               cylinder(r=tube_diam/2, h=50);
+       }
+}
+
+module led(h, w, h1, w1) {
+       union() {
+               translate([0, 0, h-w/2])
+                       sphere(r=w/2, $fn=64);
+               cylinder(r=w/2, h=h-w/2, $fn=64);
+               translate([0, 0, -h1])
+                       cylinder(r=w1/2, h=h1+epsilon, $fn=64);
+       }
+}
+
+module illum_led() {
+       translate([-24, 0, 3])
+       rotate([0, 180+tube_angle, 0])
+               led(h=5,w=3.5,h1=2,w1=4);
+};
+
+module status_led() {
+       translate([-21, 0, 8.5])
+       rotate([0, 270+view_angle+tube_angle, 0])
+               led(h=5,w=3.5,h1=2,w1=4);
+}
+
+module main() {
+       difference() {
+               outer_shape();
+               screw_hole(d1=4, d2=8, z_base=4);
+               front_hole();
+               inner_hole();
+               cable_hole($fn=8);
+               status_led();
+               illum_led();
+       };
+};
+
+if (debug == 1) {
+       rotate([0, -tube_angle, 0]) {
+               difference() {
+                       main($fn=16);
+                       translate([0, -100, 0]) cube([200, 200, 200], center=true);
+               };
+               color("red") status_led();
+               color("deepskyblue") illum_led();
+       };
+       color("gray") tube();
+} else {
+       main($fn=32);
+}
+