diff --git a/README.md b/README.md new file mode 100644 index 0000000..7527b71 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Productivity module + +## Parts + +[pogo pin](https://www.digikey.fr/fr/products/detail/mill-max-manufacturing-corp/0965-0-15-20-80-14-11-0/2784013) +[8mm led](https://www.digikey.fr/en/products/detail/kingbright/WP793ID/3084252) + diff --git a/module.scad b/module.scad index 773f156..6516091 100644 --- a/module.scad +++ b/module.scad @@ -1,13 +1,14 @@ include box_width=30; -box_height=12; -box_border_width=0.5; +box_height=13; +box_border_width=0.8; rounding_edge=1; screw_offset=2.7; -box_hull=1.5; +box_hull=1.2; led_diameter=8; +led_length=11; led_margin=1.5; led_box_height=2.5; led_ring=0.5; @@ -24,142 +25,262 @@ m2_head_diam=3.8; m2_head_height=1.4; m2_hole=2.1; +screw_throught_plastic_diam=2.7; +screw_throught_plastic_depth=3.2; +pcb_pad=5; +pcb_width=0.8; +pcb_top_margin=2; +pcb_gap=2.2; + fn=64; -module WireCache(wire_count){ +module 8mm_led(){ + union(){ + translate([0,0,led_length-led_diameter/2]) + sphere(r=led_diameter/2,$fn=fn); + cylinder(h=led_length-led_diameter/2,r=led_diameter/2,$fn=fn); + }; +} + +module pcb_top(){ + + difference(){ + union(){ + + color("green") + translate([0,0,pcb_width/2]) + cuboid([box_width-2*box_hull-0.1,box_width-2*box_hull-0.1,pcb_width], rounding=rounding_edge, edges = "Z",$fn=fn); + } + + union(){ + translate([box_width/2-2*pcb_pad,-box_width/2+pcb_pad-1,-0.01]) + cylinder(h=pcb_width+0.02,r=m2_hole/2,$fn=fn); + + translate([-box_width/2+2*pcb_pad,box_width/2-pcb_pad+1,-0.01]) + cylinder(h=pcb_width+0.02,r=m2_hole/2,$fn=fn); + } + } + + rotate([0,0,45]){ + translate([-led_diameter-2*led_ring,0,pcb_width]) + 8mm_led(); + translate([0,0,pcb_width]) + 8mm_led(); + translate([led_diameter+2*led_ring,0,pcb_width]) + 8mm_led(); + } +} + +module pcb_bottom(){ + + difference(){ + union(){ + + color("green") + translate([0,0,-pcb_width/2]) + cuboid([box_width-2*box_hull-0.1,box_width-2*box_hull-0.1,pcb_width], rounding=rounding_edge, edges = "Z",$fn=fn); + + color("gray") + translate([0,-1.75+box_width/2-box_hull,-pcb_width-1.65]) + rotate([90,90,0]) + cuboid([3.3,9,6.5], rounding=0.8, edges = "Z",$fn=fn); + } + + union(){ + translate([-box_width/2+box_hull+pcb_pad/2,box_width/2-box_hull-pcb_pad/2,-pcb_width-0.01]) + cylinder(h=pcb_width+0.02,r=m2_hole/2,$fn=fn); + + translate([box_width/2-box_hull-pcb_pad/2,-box_width/2+box_hull+pcb_pad/2,-pcb_width-0.01]) + cylinder(h=pcb_width+0.02,r=m2_hole/2,$fn=fn); + } + } +} + + +module wire_cache(wire_count){ difference(){ cuboid([wire_count*wire_diam+2*wire_cache,wire_diam+2*wire_cache,wire_cache*2], rounding=wire_cache+wire_diam/2, edges = "Z",$fn=fn); cuboid([wire_count*wire_diam,wire_diam,wire_cache*2+0.1], rounding=wire_diam/2, edges = "Z",$fn=fn); }; } +module indicator(){ + translate([0,0,led_box_height/2-rounding_edge/2]) + cuboid([3*led_diameter+2*led_margin+6*led_ring,led_diameter+2*led_margin+2*led_ring,led_box_height+rounding_edge], rounding=rounding_edge,$fn=fn); + + rotate([90,0,0]) + translate([wire_offset,wire_diam/2+wire_cache,led_diameter/2+led_margin+led_ring]) + wire_cache(4); + + translate([-led_diameter-2*led_ring,0,led_box_height]) + cylinder(h=led_ring,r=led_diameter/2+led_ring,$fn=fn); + + translate([0,0,led_box_height]) + cylinder(h=led_ring,r=led_diameter/2+led_ring,$fn=fn); + + translate([led_diameter+2*led_ring,0,led_box_height]) + cylinder(h=led_ring,r=led_diameter/2+led_ring,$fn=fn); +} -module Module(){ +module indicator_hole(){ + translate([0,0,led_box_height/2-rounding_edge/2-box_hull]) + cuboid([3*led_diameter+2*led_margin+6*led_ring-2*box_hull,led_diameter+2*led_margin+2*led_ring-2*box_hull,led_box_height+rounding_edge], rounding=rounding_edge, edges = "Z",$fn=fn); + + rotate([90,0,0]) + translate([wire_offset,wire_diam/2+wire_cache,led_diameter/2+led_margin+led_ring]) + cuboid([4*wire_diam,wire_diam,5], rounding=wire_diam/2,$fn=fn); + + translate([-led_diameter-2*led_ring,0,0]) + cylinder(h=led_box_height+led_ring+0.001,r=led_diameter/2,$fn=fn); + cylinder(h=led_box_height+led_ring+0.001,r=led_diameter/2,$fn=fn); + translate([led_diameter+2*led_ring,0,0]) + cylinder(h=led_box_height+led_ring+0.001,r=led_diameter/2,$fn=fn); +} + +module mounting_pad_top(){ + for (r = [ 0 : 180 : 360 ]) + rotate([0,0,r]) + difference(){ + translate([-box_width/2+box_hull+pcb_pad-0.5,box_width/2-box_hull-pcb_pad,pcb_top_margin+pcb_width]) + cube([pcb_pad*2,pcb_pad,3]); + } +} + +module mounting_pad_bottom(){ + for (r = [ 90 : 180 : 360 ]) + rotate([0,0,r]) + difference(){ + translate([-(-box_width/2+box_hull+pcb_pad),box_width/2-box_hull-pcb_pad,-pcb_gap-pcb_top_margin-pcb_width]) + cube([pcb_pad,pcb_pad,4]); + } +} + +module mounting_hole_top(){ + for (r = [ 0 : 180 : 360 ]) + rotate([0,0,r]) + translate([-box_width/2+2*pcb_pad,box_width/2-pcb_pad+1,pcb_top_margin+pcb_width-0.01]) + cylinder(h=screw_throught_plastic_depth,r=screw_throught_plastic_diam/2,$fn=fn); +} + +module mounting_hole_bottom(){ + for (r = [ 90 : 180 : 360 ]) + rotate([0,0,r]) + translate([-(-box_width/2+box_hull+pcb_pad/2),box_width/2-box_hull-pcb_pad/2,-pcb_gap+pcb_top_margin-pcb_width-screw_throught_plastic_depth]) + cylinder(h=screw_throught_plastic_depth+0.01,r=screw_throught_plastic_diam/2,$fn=fn); +} + +module box_eyelet_hole(){ + for (r = [ 0 : 90 : 360 ]){ + rotate([0,0,r]){ + offset_x = box_width/2-(1.5*rounding_edge+m14_head/2+box_border_width); + offset_y = -box_width/2-box_border_width; + translate([offset_x,offset_y,0]) + cuboid([m14_head+box_border_width,m14_head+box_border_width,6], rounding=m14_head/2+box_border_width/2, $fn=fn); + + translate([-offset_x,offset_y,0]) + cuboid([m14_head+box_border_width,m14_head+box_border_width,6], rounding=m14_head/2+box_border_width/2, $fn=fn); + } + } +} + +module box_top_hole(){ + for (r = [ 0 : 90 : 360 ]){ + rotate([0,0,r]){ + translate([box_width/2-screw_offset,box_width/2-screw_offset,box_height/2]) + cylinder(h=m2_head_height,r=m2_head_diam/2,center=true,$fn=fn); + translate([box_width/2-screw_offset,box_width/2-screw_offset,box_height/2]) + cylinder(h=5,r=m2_hole/2,center=true,$fn=fn); + } + } +} + +module box_eyelet(){ + difference(){ + union(){ + translate([0,0,-box_border_width]) + cylinder(h=box_border_width,r=m14_head/2+box_border_width,$fn=fn); + cylinder(h=box_border_width,r=m14_head/2+box_border_width/2,$fn=fn); + } + translate([0,0,-box_border_width-0.1]) + cylinder(h=3*box_border_width-0.1,r=m14_hole/2,$fn=fn); + } +} + +module box(){ + difference(){ + union(){ + cuboid([box_width,box_width,box_height], rounding=rounding_edge,$fn=fn); + + translate([0,0,-box_border_width/2]) + cuboid([box_width+2*box_border_width,box_width+2*box_border_width,box_border_width], rounding=rounding_edge+box_border_width, edges = "Z",$fn=fn); + } + union(){ + box_eyelet_hole(); + box_top_hole(); + cuboid([box_width-2*box_hull,box_width-2*box_hull,box_height-2*box_hull], rounding=rounding_edge, edges = "Z",$fn=fn); + } + } + + for (r = [ 0 : 90 : 360 ]){ + rotate([0,0,r]){ + offset_x=box_width/2-(1.5*rounding_edge+m14_head/2+box_border_width); + offset_y=-box_width/2-box_border_width; + + translate([offset_x,offset_y,0]) + box_eyelet(); + + translate([-offset_x,offset_y,0]) + box_eyelet(); + } + } +} + +module productivity_module(){ + + color("red") difference(){ union() { - color("red"){ - - difference(){ - union(){ - cuboid([box_width,box_width,box_height], rounding=rounding_edge,$fn=fn); - - translate([0,0,-box_border_width/2]) - cuboid([box_width+2*box_border_width,box_width+2*box_border_width,box_border_width], rounding=rounding_edge+box_border_width, edges = "Z",$fn=fn); - } - union(){ - for (r = [ 0 : 90 : 360 ]){ - rotate([0,0,r]){ - translate([box_width/2-(1.5*rounding_edge+m14_head/2+box_border_width),-box_width/2-box_border_width,0]) - cuboid([m14_head+box_border_width,m14_head+box_border_width,6], rounding=m14_head/2+box_border_width/2, $fn=fn); - translate([-box_width/2+(1.5*rounding_edge+m14_head/2+box_border_width),-box_width/2-box_border_width,0]) - cuboid([m14_head+box_border_width,m14_head+box_border_width,6], rounding=m14_head/2+box_border_width/2, $fn=fn); - - translate([box_width/2-screw_offset,box_width/2-screw_offset,box_height/2]) - cylinder(h=m2_head_height,r=m2_head_diam/2,center=true,$fn=fn); - translate([box_width/2-screw_offset,box_width/2-screw_offset,box_height/2]) - cylinder(h=5,r=m2_hole/2,center=true,$fn=fn); - } - } - cuboid([box_width-2*box_hull,box_width-2*box_hull,box_height-2*box_hull], rounding=rounding_edge, edges = "Z",$fn=fn); - } - } - - for (r = [ 0 : 90 : 360 ]){ - rotate([0,0,r]){ - - difference(){ - union(){ - translate([box_width/2-(1.5*rounding_edge+m14_head/2+box_border_width),-box_width/2-box_border_width,-box_border_width]) - cylinder(h=box_border_width,r=m14_head/2+box_border_width,$fn=fn); - translate([box_width/2-(1.5*rounding_edge+m14_head/2+box_border_width),-box_width/2-box_border_width,0]) - cylinder(h=box_border_width,r=m14_head/2+box_border_width/2,$fn=fn); - } - translate([box_width/2-(1.5*rounding_edge+m14_head/2+box_border_width),-box_width/2-box_border_width,-box_border_width-0.1]) - cylinder(h=3*box_border_width-0.1,r=m14_hole/2,$fn=fn); - } - - difference(){ - union(){ - translate([-box_width/2+(1.5*rounding_edge+m14_head/2+box_border_width),-box_width/2-box_border_width,-box_border_width]) - cylinder(h=box_border_width,r=m14_head/2+box_border_width,$fn=fn); - translate([-box_width/2+(1.5*rounding_edge+m14_head/2+box_border_width),-box_width/2-box_border_width,0]) - cylinder(h=box_border_width,r=m14_head/2+box_border_width/2,$fn=fn); - } - translate([-box_width/2+(1.5*rounding_edge+m14_head/2+box_border_width),-box_width/2-box_border_width,-box_border_width-0.1]) - cylinder(h=3*box_border_width-0.1,r=m14_hole/2,$fn=fn); - } - } - } + box(); + mounting_pad_top(); + mounting_pad_bottom(); - rotate([90,0,90]) - translate([0,wire_height,box_width/2]) - WireCache(4); + rotate([90,0,90]) + translate([0,wire_height,box_width/2]) + wire_cache(4); - } - - rotate([0,0,45]){ - translate([0,0,box_height/2]){ + rotate([0,0,45]) + translate([0,0,box_height/2]) + indicator(); - color("red") - translate([0,0,led_box_height/2-rounding_edge/2]) - cuboid([3*led_diameter+2*led_margin+6*led_ring,led_diameter+2*led_margin+2*led_ring,led_box_height+rounding_edge], rounding=rounding_edge,$fn=fn); - - - color("red") - rotate([90,0,0]) - translate([wire_offset,wire_diam/2+wire_cache,led_diameter/2+led_margin+led_ring]) - WireCache(4); - - color("red") - translate([-led_diameter-2*led_ring,0,led_box_height]) - cylinder(h=led_ring,r=led_diameter/2+led_ring,$fn=fn); - color("red") - translate([0,0,led_box_height]) - cylinder(h=led_ring,r=led_diameter/2+led_ring,$fn=fn); - color("red") - translate([led_diameter+2*led_ring,0,led_box_height]) - cylinder(h=led_ring,r=led_diameter/2+led_ring,$fn=fn); - - /* - translate([-led_diameter-2*led_ring,0,led_box_height+led_ring/2]) - sphere(led_diameter/2,$fn=fn); - translate([0,0,led_box_height+led_ring/2]) - sphere(led_diameter/2,$fn=fn); - translate([led_diameter+2*led_ring,0,led_box_height+led_ring/2]) - sphere(led_diameter/2,$fn=fn); - */ } - } - } - union(){ - rotate([0,0,45]){ - translate([0,0,box_height/2]){ - union(){ - translate([0,0,led_box_height/2-rounding_edge/2-box_hull]) - cuboid([3*led_diameter+2*led_margin+6*led_ring-2*box_hull,led_diameter+2*led_margin+2*led_ring-2*box_hull,led_box_height+rounding_edge], rounding=rounding_edge, edges = "Z",$fn=fn); - - rotate([90,0,0]) - translate([wire_offset,wire_diam/2+wire_cache,led_diameter/2+led_margin+led_ring]) - cuboid([4*wire_diam,wire_diam,5], rounding=wire_diam/2,$fn=fn); - - translate([-led_diameter-2*led_ring,0,0]) - cylinder(h=led_box_height+led_ring+0.001,r=led_diameter/2,$fn=fn); - cylinder(h=led_box_height+led_ring+0.001,r=led_diameter/2,$fn=fn); - translate([led_diameter+2*led_ring,0,0]) - cylinder(h=led_box_height+led_ring+0.001,r=led_diameter/2,$fn=fn); - } - } + union(){ + mounting_hole_top(); + mounting_hole_bottom(); + + rotate([0,0,45]) + translate([0,0,box_height/2]) + indicator_hole(); + + rotate([90,0,90]) + translate([0,wire_height,box_width/2]) + cuboid([4*wire_diam,wire_diam,5], rounding=wire_diam/2, edges = "Z",$fn=fn); + + translate([0,-1.75+box_width/2-box_hull+0.5,-pcb_gap+pcb_top_margin-pcb_width-1.65]) + rotate([90,90,0]) + cuboid([3.5,9.2,6.5], rounding=0.8, edges = "Z",$fn=fn); } - - rotate([90,0,90]) - translate([0,wire_height,box_width/2]) - cuboid([4*wire_diam,wire_diam,5], rounding=wire_diam/2, edges = "Z",$fn=fn); - } } } +translate([0,0,pcb_top_margin]) + pcb_top(); + +translate([0,0,-pcb_gap+pcb_top_margin]) + pcb_bottom(); + difference(){ - Module(); - //translate([0,0,box_height-0.001]) + //productivity_module(); + //translate([0,0,(box_height-0.001)]) // cube([1.5*box_width,1.5*box_width,2*box_height],center=true); } +