X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=bike-lights.git;a=blobdiff_plain;f=parts%2Frearlight.scad;h=05a79cb31cca19163c5507e42e9ebbcc8b97b229;hp=2c8e7a97c7605ee51c1a64c2b1bd0bfd854b982a;hb=HEAD;hpb=2767677de5d10d1aba770c8d051c431801360fcf diff --git a/parts/rearlight.scad b/parts/rearlight.scad index 2c8e7a9..05a79cb 100644 --- a/parts/rearlight.scad +++ b/parts/rearlight.scad @@ -5,19 +5,22 @@ epsilon = 0.01; infty = 100; debug = 0; -wall_thickness = 2; -fraen_diam = 30.75; -fraen_h = 29.8; +wall_thickness = 1.5; +fraen_diam = 30.90; +fraen_h = 29.3; pin_diam = 4; pin_offset = 10.35*1.4142; pin_len = 9.2; front_add = 4; +rear_pin_dist = 9.1; +rear_pin_diam = 3.25; + side_barrier_x_offset = 13; side_barrier_pin_z_offset = 4.2; side_barrier_thickness = 2; -heatsink_thickness = 2.5; +heatsink_thickness = 2; clip_h1 = 27; // front height (on the heatsink side) clip_h2 = 20; // rear height (on the lens side) @@ -25,14 +28,15 @@ clip_l = 28; clip_wall = wall_thickness; clip_space = 3.5; clip_bolt1_z = 6; -clip_bolt1_x = 20; +clip_bolt1_x = 19.5; clip_bolt2_z = 22; -clip_bolt2_x = 23; -clip_angle = 24; +clip_bolt2_x = 21; +clip_angle = 18; clip_top_xoff = clip_l*tan(clip_angle); -clip_y_off = 37; -clip_x_off = 0; +clip_y_off = 34; +clip_x_off = 2; +clip_x_rot = -3; // z-axis is up module bolt_mount(d, h, w1, w2, fn) { @@ -65,8 +69,8 @@ module seat_clip() { // top part hull() { - translate([-clip_wall, -clip_space/2-clip_wall, 0]) - cube([clip_wall+epsilon, 2*clip_wall+clip_space, epsilon]); + translate([-2*clip_wall, -clip_space/2-clip_wall, 0]) + cube([2*clip_wall+epsilon, 2*clip_wall+clip_space, epsilon]); translate([-clip_wall+clip_top_xoff, -clip_space/2-clip_wall, clip_l]) cube([clip_wall+epsilon, 2*clip_wall+clip_space, epsilon]); }; @@ -74,19 +78,19 @@ module seat_clip() { // bolt mounts translate([clip_bolt1_x, clip_space/2 + clip_wall, clip_bolt1_z]) rotate([-90, 0, 0]) - bolt_mount(6.5, 2, 7, 12, 32); + bolt_mount(6.5, 2, 7, 12, 6); translate([clip_bolt1_x, -clip_space/2 - clip_wall, clip_bolt1_z]) rotate([90, 0, 0]) - bolt_mount(6.5, 2, 7, 12, 6); + bolt_mount(6.5, 2, 7, 12, 32); translate([clip_bolt2_x, clip_space/2 + clip_wall, clip_bolt2_z]) rotate([-90, 0, 0]) - bolt_mount(6.5, 2, 7, 12, 32); + bolt_mount(6.5, 2, 7, 12, 6); translate([clip_bolt2_x, -clip_space/2 - clip_wall, clip_bolt2_z]) rotate([90, 0, 0]) - bolt_mount(6.5, 2, 7, 12, 6); + bolt_mount(6.5, 2, 7, 12, 32); }; // bolt holes translate([clip_bolt1_x, infty/2, clip_bolt1_z]) @@ -113,7 +117,7 @@ module round_part() { rotate([0, 0, angle+45]) translate([pin_offset, 0, -epsilon]) cylinder(r=pin_diam/2, - h=epsilon, $fn=32); + h=epsilon); }; } @@ -127,7 +131,7 @@ module round_part() { rotate([0, 0, angle+45]) translate([pin_offset, 0, epsilon]) cylinder(r=pin_diam/2, - h=pin_len+epsilon, $fn=32); + h=pin_len+epsilon); }; }; @@ -137,7 +141,7 @@ module round_part() { intersection() { cylinder(r=fraen_diam/2+epsilon, h=infty); translate([-infty/2, side_barrier_x_offset, - wall_thickness + pin_len - side_barrier_pin_z_offset - side_barrier_thickness ]) + pin_len - side_barrier_pin_z_offset - side_barrier_thickness ]) cube([infty, infty, side_barrier_thickness]); }; }; @@ -150,7 +154,7 @@ module square_cone() { h = epsilon); for (angle = [0, 90, 180, 270]) rotate([0, 0, angle]) - translate([9.1, 9.1, 0]) + translate([rear_pin_dist, rear_pin_dist, 0]) cylinder(r=wall_thickness+3.75/2, h = epsilon); } hull() { @@ -159,36 +163,52 @@ module square_cone() { h = epsilon); for (angle = [0, 90, 180, 270]) { rotate([0, 0, angle]) - translate([9.1, 9.1, -epsilon]) + translate([rear_pin_dist, rear_pin_dist, -epsilon]) cylinder(r=3.75/2, h = epsilon); rotate([0, 0, angle+45]) translate([pin_offset, 0, fraen_h - pin_len + epsilon]) cylinder(r=pin_diam/2, - h=epsilon, $fn=32); + h=epsilon); } } } } -rear_spring_w = 4; +rear_spring_w = 2*rear_pin_dist-rear_pin_diam-2; +rear_spring_h = 1.5; +rear_spring_center_w = 4; +led_zoff = 6; module rear_spring() { translate([0, 0, wall_thickness/2]) - cube([18+2*wall_thickness+3.5, rear_spring_w, wall_thickness], center=true); - difference() { - rotate([90, 0, 0]) - translate([0, 0, -rear_spring_w/2]) - cylinder(r=6-heatsink_thickness, h = rear_spring_w); - translate([0, 0, -infty/2+epsilon]) - cube(infty, center=true); - }; -}; + cube([rear_spring_center_w, rear_spring_w, wall_thickness], + center=true); + translate([0, rear_spring_w/2-wall_thickness/2, + (led_zoff-heatsink_thickness)/2]) + cube([rear_spring_center_w, + wall_thickness, led_zoff-heatsink_thickness], + center=true); + translate([0, -rear_spring_w/2+wall_thickness/2, + (led_zoff-heatsink_thickness)/2]) + cube([rear_spring_center_w, + wall_thickness, led_zoff-heatsink_thickness], + center=true); + + for (angle=[0, 180]) { + rotate([0, 0, angle]) + translate([5.5, 0, rear_spring_h/2]) + rotate([0, 0, 45]) { + cube([wall_thickness, 14, rear_spring_h], + center=true); + } + } +} module heatsink_holder() { for (angle = [0, 180]) { rotate([0, 0, angle]) - translate([9.1+wall_thickness, 0, 6/2]) - cube([3.5/2+wall_thickness, 2*9.1-3.5-0.5, 6], center=true); + translate([rear_pin_dist+wall_thickness, 0, (led_zoff+wall_thickness)/2]) + cube([rear_pin_diam/2+wall_thickness, 2*rear_pin_dist-rear_pin_diam-2, led_zoff+wall_thickness], center=true); } } @@ -206,49 +226,74 @@ module lens_holder() { cube([infty, 0.5, infty]); // cable hole, 2*3mm - translate([9.1, 0, 6+3]) + translate([rear_pin_dist, 0, 6+3]) rotate([0, 0, 60]) cube([infty, 2, 3]); // side LED hole, 3mm translate([0, 0, fraen_h - pin_len]) rotate([90, 0, 0]) - cylinder(r=3.5/2, h=infty, $fn=6); + cylinder(r=rear_pin_diam/2, h=infty, $fn=6); }; rear_spring(); heatsink_holder(); }; -union() { - lens_holder($fn = 128); - translate([clip_x_off, clip_y_off, 0]) - seat_clip(); -/* -hull() { - translate([0, 9.1+3.5/2+epsilon, wall_thickness/2]) - cube([9.1, epsilon, wall_thickness], center=true); - translate([20-clip_wall/2, 40-clip_space/2-clip_wall+epsilon, wall_thickness/2]) - cube([9.1, epsilon/2, wall_thickness], center=true); +module full_joint() { + difference() { + hull() { + intersection() { + rotate([-90, 0, 0]) + scale([0.25, 1, 1]) + cylinder(r = fraen_h-pin_len, h = rear_pin_dist + wall_thickness+rear_pin_diam/2); + translate([-infty/2, rear_pin_dist + wall_thickness + rear_pin_diam/2 - epsilon, 0]) + cube(infty); + }; + translate([clip_x_off, clip_y_off, 0]) + intersection() { + seat_clip_rotated(); + translate([(fraen_h-pin_len)*tan(clip_angle)-clip_wall, -clip_space/2-0.1*clip_wall+epsilon, 0]) + rotate([90+clip_x_rot, 0, 0]) + scale([0.45, 1, 1]) + cylinder(r = fraen_h-pin_len, h = epsilon); + }; + }; + hull() { + translate([0, 0, fraen_h - pin_len + epsilon]) + cylinder(r = fraen_diam/2 + pin_diam/2 + wall_thickness/2, + h = epsilon); + for (angle = [0, 90, 180, 270]) + rotate([0, 0, angle]) + translate([rear_pin_dist, rear_pin_dist, -epsilon]) + cylinder(r=wall_thickness/2+3.75/2, h = epsilon); + }; + } }; -hull() { - translate([0, 9.1+3.5/2+epsilon, wall_thickness/2]) - cube([2*.259+3.5, epsilon, wall_thickness], center=true); - translate([20-clip_wall/2, 40-clip_space/2-clip_wall+epsilon, wall_thickness/2]) - cube([clip_h1+clip_wall, epsilon/2, wall_thickness], center=true); +module seat_clip_rotated() { + difference() { + translate([clip_space/2+clip_wall, 0, 0]) + rotate([clip_x_rot, 0, 0]) + translate([-clip_space/2-clip_wall, 0, sin(clip_x_rot)*(clip_space/2+clip_wall+epsilon)]) + seat_clip(); + translate([-infty/2, -infty/2, -infty]) + cube(infty); + }; }; - -translate([7.5, 13.3, 0]) - cube([wall_thickness, 23, fraen_h - pin_len - wall_thickness]); - - } - //translate([-infty/2, -infty/2, 8]) - // cube(infty); -*/ + +module main() { + lens_holder(); + translate([clip_x_off, clip_y_off, 0]) + seat_clip_rotated(); + // xy_joint(); + // yz_joint(); + full_joint(); }; +// scale([1, -1, 1]) main($fn=128); +main($fn = 128); // vnitrni prumer kruhu by mel byt 30.75mm // vnejsi prumer aspon 35 mm // pin od stredu 10.35mm na x a y