From d07138f86f342e77c96d567c3120c1abc8afc017 Mon Sep 17 00:00:00 2001 From: jaseg Date: Tue, 17 Jul 2018 15:56:47 +0200 Subject: Add/reorg enclosure OpenSCAD files --- .gitignore | 5 + enclosure/lyza/depthmap_03.png | Bin 0 -> 47301 bytes enclosure/lyza/depthmap_03_downscaled.png | Bin 0 -> 16735 bytes enclosure/lyza/lyza_enclosure.scad | 238 +++++++++++++++++++++++++ enclosure/lyza/lyza_enclosure_v2.scad | 233 ++++++++++++++++++++++++ enclosure/lyza/standoffs.scad | 17 ++ enclosure/lyza/test.blend | Bin 0 -> 2315380 bytes enclosure/rails/olsndot_base.scad | 110 ++++++++++++ enclosure/rails/olsndot_clamp_base.scad | 105 +++++++++++ enclosure/rails/olsndot_clamp_stoppers.scad | 20 +++ enclosure/rails/openstep_base.scad | 68 +++++++ enclosure/rails/raspi_adapter.scad | 68 +++++++ enclosure/rails/rs485_base.scad | 43 +++++ hardware/enclosure/olsndot_base.scad | 110 ------------ hardware/enclosure/olsndot_clamp_base.scad | 105 ----------- hardware/enclosure/olsndot_clamp_stoppers.scad | 20 --- 16 files changed, 907 insertions(+), 235 deletions(-) create mode 100644 enclosure/lyza/depthmap_03.png create mode 100644 enclosure/lyza/depthmap_03_downscaled.png create mode 100644 enclosure/lyza/lyza_enclosure.scad create mode 100644 enclosure/lyza/lyza_enclosure_v2.scad create mode 100644 enclosure/lyza/standoffs.scad create mode 100644 enclosure/lyza/test.blend create mode 100644 enclosure/rails/olsndot_base.scad create mode 100644 enclosure/rails/olsndot_clamp_base.scad create mode 100644 enclosure/rails/olsndot_clamp_stoppers.scad create mode 100644 enclosure/rails/openstep_base.scad create mode 100644 enclosure/rails/raspi_adapter.scad create mode 100644 enclosure/rails/rs485_base.scad delete mode 100644 hardware/enclosure/olsndot_base.scad delete mode 100644 hardware/enclosure/olsndot_clamp_base.scad delete mode 100644 hardware/enclosure/olsndot_clamp_stoppers.scad diff --git a/.gitignore b/.gitignore index b64c475..22acc11 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,11 @@ hardware/History hardware/Project Logs for olsndot hardware/__Previews +__pycache__ +.ipynb_checkpoints + +*.stl + # Windows image file caches Thumbs.db ehthumbs.db diff --git a/enclosure/lyza/depthmap_03.png b/enclosure/lyza/depthmap_03.png new file mode 100644 index 0000000..57e7c51 Binary files /dev/null and b/enclosure/lyza/depthmap_03.png differ diff --git a/enclosure/lyza/depthmap_03_downscaled.png b/enclosure/lyza/depthmap_03_downscaled.png new file mode 100644 index 0000000..5d093c5 Binary files /dev/null and b/enclosure/lyza/depthmap_03_downscaled.png differ diff --git a/enclosure/lyza/lyza_enclosure.scad b/enclosure/lyza/lyza_enclosure.scad new file mode 100644 index 0000000..b9695bb --- /dev/null +++ b/enclosure/lyza/lyza_enclosure.scad @@ -0,0 +1,238 @@ + +/* A small, arbitrary unit to guard against rounding errors */ +eps = 0.1; +alot = 1000; + +/* Base PCB size */ +pcb_width = 50; +pcb_height = 70; +/* Extra space around PCB */ +pcb_extra = 1; + +/* Offset of screw hole centers from left/right/top/bottom side of board */ +screw_offx_l = 5; +screw_offx_r = 5; +screw_offx_t = 5; +screw_offx_b = 5; + +/* Thickness of bottom, walls, lid (middle sections) */ +bottom_thickness = 1.5; +wall_thickness = 1.5; +lid_thickness = 1.5; + +/* Outside corner radius */ +corner_radius_wall = 3; +corner_radius_lid = 2; + +screw_base_dia = 8; +screw_base_h = 5; +screw_nut_dia = 5.4; +screw_nut_h = 6; +screw_hole_dia = 4.0; +screw_hole_h = 6; +board_thickness = 1.6; +height_above_board = 18; +height_lid_inner = 1; +lid_lip_depth = 1; +lid_lip_width = 1; +lid_lip_extra = 1; + +clamp_tube_dia = screw_base_dia; +clamp_tube_h = 0; //height_above_board+height_lid_inner; +clamp_tube_base_extra = 2; + +screw_head_hole_dia = 6.5; +screw_head_hole_depth = 3; + +module rounded_rect(w, h, r) { + hull(){ + translate([w/2-r, h/2-r]) circle(r); + translate([-(w/2-r), h/2-r]) circle(r); + translate([w/2-r, -(h/2-r)]) circle(r); + translate([-(w/2-r), -(h/2-r)]) circle(r); + } +} + +module shell(thickness, inner_height, inner_extra, radius_horiz) { + d = thickness + inner_height; + rh=radius_horiz; + difference(){ + r = corner_radius_wall; + w = pcb_width+pcb_extra+2*wall_thickness; + h = pcb_height+pcb_extra+2*wall_thickness; + hull() { + translate([0, 0, rh]) linear_extrude(height=d-rh) rounded_rect(w, h, r); + linear_extrude(height=eps) rounded_rect(w-2*rh, h-2*rh, r); + } + + iw = pcb_width+inner_extra; + ih = pcb_height+inner_extra; + translate([-iw/2, -ih/2, bottom_thickness]) cube([iw, ih, h]); + } +} + +module single_screw_base() { + translate([0, 0, bottom_thickness-eps]) linear_extrude(height=screw_base_h+eps) { + circle(d=screw_base_dia); + translate([-screw_base_dia/2, 0]) square([alot, alot]); + translate([0, -screw_base_dia/2]) square([alot, alot]); + } +} + +w = pcb_width; +h = pcb_height; +e = pcb_extra; +l = screw_offx_l; +r = screw_offx_r; +t = screw_offx_t; +b = screw_offx_b; +s1_pos = [w/2-l, h/2-b]; +s2_pos = [-w/2+r, -h/2+t]; +s3_pos = [w/2-l, -h/2+t]; +s4_pos = [-w/2+r, h/2-b]; +module screw_bases() { + intersection() { + union() { + translate(s1_pos) single_screw_base(); + translate(s2_pos) mirror([1,1,0]) single_screw_base(); + translate(s3_pos) mirror([0,1,0]) single_screw_base(); + translate(s4_pos) mirror([1,0,0]) single_screw_base(); + } + cube([w+e+eps, h+e+eps, alot], center=true); + } +} + +module single_screw_hole() { + translate([0, 0, bottom_thickness+screw_base_h+eps]) + mirror([0,0,1]) + union() { + cylinder(h=screw_nut_h+eps, d=screw_nut_dia); + cylinder(h=screw_hole_h+eps, d=screw_hole_dia); + } +} + +module screw_holes() { + translate(s1_pos) single_screw_hole(); + translate(s2_pos) mirror([1,1,0]) single_screw_hole(); + translate(s3_pos) mirror([0,1,0]) single_screw_hole(); + translate(s4_pos) mirror([1,0,0]) single_screw_hole(); +} + +conn_1_y = 12.0; +conn_1_l = 20.0; +conn_1_h = 7; +conn_2_y = conn_1_y+conn_1_l+6.0; +conn_2_l = conn_1_l; +conn_2_h = conn_1_h; +conn_pwr_y = 12.5; +conn_pwr_l = 10.0; +conn_pwr_h = 10; +conn_extra = 1; +module conn_holes() { + e = conn_extra; + translate([0, -e/2, -e/2]) + translate([0, 0, bottom_thickness+screw_base_h+board_thickness]) + translate([-pcb_width/2, -pcb_height/2]) { + translate([-alot, conn_1_y]) cube([alot, conn_1_l+e, conn_1_h+e]); + translate([-alot, conn_2_y]) cube([alot, conn_2_l+e, conn_2_h+e]); + translate([0, conn_pwr_y]) cube([alot, conn_pwr_l+e, conn_pwr_h+e]); + } +} + +module base() { + difference() { + union() { + screw_bases(); + shell(bottom_thickness, + screw_base_h + board_thickness + height_above_board, + pcb_extra, + radius_horiz=0); + } + screw_holes(); + conn_holes(); + } +} + +module single_clamp_stud_part(liph, clamp_tube_h, extra) { + translate([0, 0, lid_thickness-eps]) union() { + cylinder(h=clamp_tube_h, d=clamp_tube_dia+extra); + linear_extrude(height=liph+eps) { + translate([-clamp_tube_dia/2-extra/2, 0]) square([alot, alot]); + translate([0, -clamp_tube_dia/2-extra/2]) square([alot, alot]); + } + } +} + +module single_clamp_stud(liph) { + e = clamp_tube_base_extra; + single_clamp_stud_part(liph, liph+eps, e); + single_clamp_stud_part(liph, clamp_tube_h, 0); +} + +module lid_screw_hole() { + cylinder(h=alot, d=screw_hole_dia); + cylinder(h=screw_head_hole_depth+eps, d=screw_head_hole_dia); +} + +module lid() { + e = lid_lip_extra; + iw = pcb_width+pcb_extra-e+eps; + ih = pcb_height+pcb_extra-e+eps; + liph = lid_lip_depth+height_lid_inner; + difference() { + union() { + shell(lid_thickness, + height_lid_inner, + inner_extra=-eps, + radius_horiz=corner_radius_lid); + difference() { + translate([-iw/2, -ih/2, lid_thickness-eps]) cube([iw, ih, liph+eps]); + minkowski() { + translate([-iw/2+e/2+liph, -ih/2+e/2+liph, lid_thickness-eps]) cube([iw-e-liph*2, ih-e-liph*2, eps]); + cylinder(d1=0, d2=2*liph+2*eps, h=2*liph+2*eps); + }; + } + intersection() { + translate([-iw/2, -ih/2, lid_thickness-eps]) cube([iw, ih, alot]); + union() { + translate(s1_pos) single_clamp_stud(liph); + translate(s2_pos) mirror([1,1,0]) single_clamp_stud(liph); + translate(s3_pos) mirror([0,1,0]) single_clamp_stud(liph); + translate(s4_pos) mirror([1,0,0]) single_clamp_stud(liph); + } + } + } + translate([0, 0, -eps]) { + translate(s1_pos) lid_screw_hole(); + translate(s2_pos) lid_screw_hole(); + translate(s3_pos) lid_screw_hole(); + translate(s4_pos) lid_screw_hole(); + } + } +} + +module enclosure() { + + + intersection() { + //translate([-pcb_width, -40, 0]) cube (35, 20, 20); + //translate([-pcb_width-15, 0, 0]) base(); + }; + + + intersection() { + //translate([-alot/2, -10, -alot/2]) cube ([alot, 20, alot]); + union () { + render() lid(); + + render() translate([0,0,eps]) mirror([0,0,1]) intersection() { + translate([-alot/2, -alot/2, 0]) cube([alot, alot, alot]); + translate([0,0,-0.2]) scale([0.3, 0.3, 0.04]) surface("depthmap_03.png", center=true); + }; + + }; + }; + +} + +enclosure($fn=25); \ No newline at end of file diff --git a/enclosure/lyza/lyza_enclosure_v2.scad b/enclosure/lyza/lyza_enclosure_v2.scad new file mode 100644 index 0000000..739c42e --- /dev/null +++ b/enclosure/lyza/lyza_enclosure_v2.scad @@ -0,0 +1,233 @@ + +/* A small, arbitrary unit to guard against rounding errors */ +eps = 0.1; +alot = 1000; + +/* Base PCB size */ +pcb_width = 50; +pcb_height = 70; +/* Extra space around PCB */ +pcb_extra = 1; + +/* Offset of screw hole centers from left/right/top/bottom side of board */ +screw_offx_l = 5; +screw_offx_r = 5; +screw_offx_t = 5; +screw_offx_b = 5; + +/* Thickness of bottom, walls, lid (middle sections) */ +bottom_thickness = 2; +wall_thickness = 2; +lid_thickness = 2; + +/* Outside corner radius */ +corner_radius_wall = 3; +corner_radius_lid = 2; + +screw_base_dia = 8; +screw_base_h = 5; +screw_nut_dia = 5.4; +screw_nut_h = 6; +screw_hole_dia = 3.2; +screw_hole_h = 6; +board_thickness = 1.6; +height_above_board = 18; +height_lid_inner = 2; +lid_lip_depth = 2; +lid_lip_width = 2; +lid_lip_extra = 1; + +clamp_tube_dia = screw_base_dia; +clamp_tube_h = 0; //height_above_board+height_lid_inner; +clamp_tube_base_extra = 2; + +screw_head_hole_dia = 6.5; +screw_head_hole_depth = 3; + +module rounded_rect(w, h, r) { + hull(){ + translate([w/2-r, h/2-r]) circle(r); + translate([-(w/2-r), h/2-r]) circle(r); + translate([w/2-r, -(h/2-r)]) circle(r); + translate([-(w/2-r), -(h/2-r)]) circle(r); + } +} + +module shell(thickness, inner_height, inner_extra, radius_horiz) { + d = thickness + inner_height; + rh=radius_horiz; + difference(){ + r = corner_radius_wall; + w = pcb_width+pcb_extra+2*wall_thickness; + h = pcb_height+pcb_extra+2*wall_thickness; + hull() { + translate([0, 0, rh]) linear_extrude(height=d-rh) rounded_rect(w, h, r); + linear_extrude(height=eps) rounded_rect(w-2*rh, h-2*rh, r); + } + + iw = pcb_width+inner_extra; + ih = pcb_height+inner_extra; + translate([-iw/2, -ih/2, bottom_thickness]) cube([iw, ih, h]); + } +} + +module single_screw_base() { + translate([0, 0, bottom_thickness-eps]) linear_extrude(height=screw_base_h+eps) { + circle(d=screw_base_dia); + translate([-screw_base_dia/2, 0]) square([alot, alot]); + translate([0, -screw_base_dia/2]) square([alot, alot]); + } +} + +w = pcb_width; +h = pcb_height; +e = pcb_extra; +l = screw_offx_l; +r = screw_offx_r; +t = screw_offx_t; +b = screw_offx_b; +s1_pos = [w/2-l, h/2-b]; +s2_pos = [-w/2+r, -h/2+t]; +s3_pos = [w/2-l, -h/2+t]; +s4_pos = [-w/2+r, h/2-b]; +module screw_bases() { + intersection() { + union() { + translate(s1_pos) single_screw_base(); + translate(s2_pos) mirror([1,1,0]) single_screw_base(); + translate(s3_pos) mirror([0,1,0]) single_screw_base(); + translate(s4_pos) mirror([1,0,0]) single_screw_base(); + } + cube([w+e+eps, h+e+eps, alot], center=true); + } +} + +module single_screw_hole() { + translate([0, 0, bottom_thickness+screw_base_h+eps]) + mirror([0,0,1]) + union() { + cylinder(h=screw_nut_h+eps, d=screw_nut_dia); + cylinder(h=screw_hole_h+eps, d=screw_hole_dia); + } +} + +module screw_holes() { + translate(s1_pos) single_screw_hole(); + translate(s2_pos) mirror([1,1,0]) single_screw_hole(); + translate(s3_pos) mirror([0,1,0]) single_screw_hole(); + translate(s4_pos) mirror([1,0,0]) single_screw_hole(); +} + +conn_1_y = 12.0; +conn_1_l = 20.0; +conn_1_h = 7; +conn_2_y = conn_1_y+conn_1_l+6.0; +conn_2_l = conn_1_l; +conn_2_h = conn_1_h; +conn_pwr_y = 12.5; +conn_pwr_l = 10.0; +conn_pwr_h = 10; +conn_extra = 1; +module conn_holes() { + e = conn_extra; + translate([0, -e/2, -e/2]) + translate([0, 0, bottom_thickness+screw_base_h+board_thickness]) + translate([-pcb_width/2, -pcb_height/2]) { + translate([-alot, conn_1_y]) cube([alot, conn_1_l+e, conn_1_h+e]); + translate([-alot, conn_2_y]) cube([alot, conn_2_l+e, conn_2_h+e]); + translate([0, conn_pwr_y]) cube([alot, conn_pwr_l+e, conn_pwr_h+e]); + } +} + +module base() { + difference() { + union() { + screw_bases(); + shell(bottom_thickness, + screw_base_h + board_thickness + height_above_board, + pcb_extra, + radius_horiz=0); + } + screw_holes(); + conn_holes(); + } +} + +module single_clamp_stud_part(liph, clamp_tube_h, extra) { + translate([0, 0, lid_thickness-eps]) union() { + cylinder(h=clamp_tube_h, d=clamp_tube_dia+extra); + linear_extrude(height=liph+eps) { + translate([-clamp_tube_dia/2-extra/2, 0]) square([alot, alot]); + translate([0, -clamp_tube_dia/2-extra/2]) square([alot, alot]); + } + } +} + +module single_clamp_stud(liph) { + e = clamp_tube_base_extra; + single_clamp_stud_part(liph, liph+eps, e); + single_clamp_stud_part(liph, clamp_tube_h, 0); +} + +module lid_screw_hole() { + cylinder(h=alot, d=screw_hole_dia); + cylinder(h=screw_head_hole_depth+eps, d=screw_head_hole_dia); +} + +module lid() { + e = lid_lip_extra; + iw = pcb_width+pcb_extra-e+eps; + ih = pcb_height+pcb_extra-e+eps; + liph = lid_lip_depth+height_lid_inner; + difference() { + union() { + shell(lid_thickness, + height_lid_inner, + inner_extra=-eps, + radius_horiz=corner_radius_lid); + difference() { + translate([-iw/2, -ih/2, lid_thickness-eps]) cube([iw, ih, liph+eps]); + // FIXME translate([-iw/2+e/2, -ih/2+e/2, lid_thickness-eps]) cube([iw-e, ih-e, liph+2*eps]); + } + intersection() { + translate([-iw/2, -ih/2, lid_thickness-eps]) cube([iw, ih, alot]); + union() { + translate(s1_pos) single_clamp_stud(liph); + translate(s2_pos) mirror([1,1,0]) single_clamp_stud(liph); + translate(s3_pos) mirror([0,1,0]) single_clamp_stud(liph); + translate(s4_pos) mirror([1,0,0]) single_clamp_stud(liph); + } + } + } + translate([0, 0, -eps]) { + translate(s1_pos) lid_screw_hole(); + translate(s2_pos) lid_screw_hole(); + translate(s3_pos) lid_screw_hole(); + translate(s4_pos) lid_screw_hole(); + } + } +} + +module enclosure() { + + + intersection() { + //translate([-pcb_width, -40, 0]) cube (35, 20, 20); + translate([-pcb_width-15, 0, 0]) base(); + }; + +/* + intersection() { + //translate([-alot/2, -10, -alot/2]) cube ([alot, 20, alot]); + union () { + render() lid(); + render() translate([0,0,eps]) mirror([0,0,1]) intersection() { + translate([-alot/2, -alot/2, 0]) cube([alot, alot, alot]); + translate([0,0,-0.2]) scale([0.3, 0.3, 0.04]) surface("depthmap_03.png", center=true); + }; + }; + }; +*/ +} + +enclosure($fn=25); \ No newline at end of file diff --git a/enclosure/lyza/standoffs.scad b/enclosure/lyza/standoffs.scad new file mode 100644 index 0000000..61d3ef4 --- /dev/null +++ b/enclosure/lyza/standoffs.scad @@ -0,0 +1,17 @@ +inner_dia = 3.0; +outer_dia = inner_dia + 2*1.5; +height = 18.0; +eps = 0.1; + +module standoff() { + difference() { + cylinder(h=height, d=outer_dia); + translate([0, 0, -eps]) cylinder(h=height+2*eps, d=inner_dia); + } +} + +module standoff_group() { + standoff(); +} + +standoff_group($fn=25); \ No newline at end of file diff --git a/enclosure/lyza/test.blend b/enclosure/lyza/test.blend new file mode 100644 index 0000000..9c9e4d9 Binary files /dev/null and b/enclosure/lyza/test.blend differ diff --git a/enclosure/rails/olsndot_base.scad b/enclosure/rails/olsndot_base.scad new file mode 100644 index 0000000..2cea8b2 --- /dev/null +++ b/enclosure/rails/olsndot_base.scad @@ -0,0 +1,110 @@ + +/* A small, arbitrary unit to guard against rounding errors */ +eps = 0.1; +alot = 1000; + +/* Base PCB size */ +pcb_width = 90; +pcb_height = 50; + +bottom_thickness = 1.5; + +screw_base_dia = 8; +screw_base_h = 5; +screw_nut_dia = 5.4; +screw_nut_h = 6; +screw_hole_dia = 3.5; +screw_hole_h = 6; + +module rounded_rect(w, h, r) { + hull(){ + translate([w/2-r, h/2-r]) circle(r); + translate([-(w/2-r), h/2-r]) circle(r); + translate([w/2-r, -(h/2-r)]) circle(r); + translate([-(w/2-r), -(h/2-r)]) circle(r); + } +} + +module single_screw_base() { + translate([0, 0, bottom_thickness-eps]) linear_extrude(height=screw_base_h+eps) { + circle(d=screw_base_dia); + translate([-screw_base_dia/2, 0]) square([alot, alot]); + translate([0, -screw_base_dia/2]) square([alot, alot]); + } +} + +w = pcb_width+10; +h = pcb_height; +l = 10; +r = 10; +t = 5; +b = 5; +s1_pos = [ w/2-l, h/2-b]; +s2_pos = [-w/2+r, -h/2+t]; +s3_pos = [ w/2-l, -h/2+t]; +s4_pos = [-w/2+r, h/2-b]; +module screw_bases() { + intersection() { + union() { + translate(s1_pos) single_screw_base(); + translate(s2_pos) mirror([1,1,0]) single_screw_base(); + translate(s3_pos) mirror([0,1,0]) single_screw_base(); + translate(s4_pos) mirror([1,0,0]) single_screw_base(); + } + cube([w+eps, h+eps, alot], center=true); + } +} + + +module single_screw_hole() { + translate([0, 0, bottom_thickness+screw_base_h+eps]) + mirror([0,0,1]) + union() { + cylinder(h=screw_nut_h+eps, d=screw_nut_dia); + cylinder(h=screw_hole_h+eps, d=screw_hole_dia); + } +} + +module screw_holes() { + translate(s1_pos) single_screw_hole(); + translate(s2_pos) mirror([1,1,0]) single_screw_hole(); + translate(s3_pos) mirror([0,1,0]) single_screw_hole(); + translate(s4_pos) mirror([1,0,0]) single_screw_hole(); +} + +tab_w = 20; +tab_h = 30; +tab_thickness = 3; +tab_hole_d = 9; +module screw_tab() { + difference() { + translate([-tab_h/2, -eps, 0]) cube([tab_h, tab_w+eps, tab_thickness]); + rotate([0, 0, -50]) translate([-alot/2, tab_h*0.6, -eps]) cube([alot, alot, tab_h+2*eps]); + rotate([0, 0, 50]) translate([-alot/2, tab_h*0.6, -eps]) cube([alot, alot, tab_thickness+2*eps]); + translate([0, tab_w/2, -eps]) cylinder(d=tab_hole_d, h=tab_thickness+eps*2); + } +} + +wall_height = bottom_thickness + 3; +wall_thickness = 1.5; + +cutout_w = 25; +cutout_h = 70; + +module carrier() { + union() { + difference() { + translate([0, 0, wall_height/2]) cube([w, h, wall_height], center=true); + translate([0, 0, bottom_thickness + alot/2]) cube([w-wall_thickness*2+eps, h-wall_thickness*2+eps, alot], center=true); + cube([cutout_h, cutout_w, alot], center=true); + } + difference() { + screw_bases(); + screw_holes(); + } + translate([0, h/2, 0]) screw_tab(); + mirror([0,1,0]) translate([0, h/2, 0]) screw_tab(); + } +} + +carrier($fn=25); \ No newline at end of file diff --git a/enclosure/rails/olsndot_clamp_base.scad b/enclosure/rails/olsndot_clamp_base.scad new file mode 100644 index 0000000..ad09989 --- /dev/null +++ b/enclosure/rails/olsndot_clamp_base.scad @@ -0,0 +1,105 @@ +eps = 0.01; + +module clamp( + l=90, + w=14, + h=10, + d1=30, + d2=35, + o=10, + hdia1=5, + hdia2=10, + hd=5, + nw=7.8, + nd=3, + notch_sf=0.75, + notch_d=3, + notch_a=10, + notch_o=0.5, + edge_a=5, + edge_d=12) { + translate([-h-l/2, -w/2, 0]) union() { + translate([l+h-notch_d, 0, 0]) intersection() { + difference() { + cube([d1, w, d1]); + //scale([notch_sf, 1, 1]) translate([(d1-h)/2, 0, h+(d1-h)/2]) rotate([0, -135, 0]) translate([0, -eps/2, 0]) cube([d1, w+eps, d1]); + translate([notch_d, 0, h+notch_o]) mirror([1, 0, 0]) rotate([0, notch_a, 0]) translate([0, -eps/2, 0]) cube([d1, w+eps, d1]); + } + translate([d1-edge_a, 0, d1/2]) rotate([0, -90-45, 0]) cube([2*d1, w+eps, 2*d1]); + translate([-d1-edge_d, 0]) cube([2*d1, w+eps, 2*d1]); + } + difference() { + union() { + cube ([l+h, w, h]); + cube ([h, w, d2]); + } + rotate([0, 45, 0]) translate([-l/2, -eps/2, -d2/8*7]) cube([l, w+eps, d2]); + translate([0, 0, d2]) rotate([0, 90+45, 0]) translate([-l/2, -eps/2, -d2/8*7]) cube([l, w+eps, d2]); + translate([-eps/2, w/2, d2-o]) rotate([0, 90, 0]) union() { + cylinder(d=6, h=l); + cylinder(d=12, h=hd); + translate([-11/2, -11/2, h-4]) cube([11, 11, 5]); + } + } + } +} + +module hexagon(size, height) { + boxWidth = size/1.75; + for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true); +} + +nut_dia = 5.3; +nut_depth=5.5; +nut_off_y = 80/2; +nut_off_x = 20; + +module nut_holder( + a = 30, + b = 15, + c = 10, + d = 5.0, + e = 4.0, + ) { + + difference() { + union() { + translate([-b/2, -(a-b)/2, 0]) cube([b, a-b, c]); + translate([0, -(a-b)/2, 0]) cylinder(d=b, h=c); + translate([0, (a-b)/2, 0]) cylinder(d=b, h=c); + } + translate([0, a/2 - d, -eps]) { + translate([0, 0, c-nut_depth+2*eps]) cylinder(d=nut_dia, h=nut_depth); + cylinder(d=e, h=c+2*eps); + } + translate([0, -a/2 + d, -eps]) { + translate([0, 0, c-nut_depth+2*eps]) cylinder(d=nut_dia, h=nut_depth); + cylinder(d=e, h=c+2*eps); + } + } +} + +module base($fn=25, cw=93, sw=15, sh=15, strut_spacing=30, clamp_dist=90) { + d = 30; + clamp(l=cw, h=sh); + translate([-d, 0, 0]) nut_holder(); + translate([d, 0, 0]) nut_holder(); + /*difference() { + translate([0, -clamp_dist/2, 0]) union() { + */ + /* + translate([0, 0, 0]) clamp(l=cw, h=sh); + translate([-strut_spacing/2-sw, 0, 0]) cube([sw, clamp_dist, sh]); + translate([ strut_spacing/2, 0, 0]) cube([sw, clamp_dist, sh]); + */ + //} + /* + translate([nut_off_x, nut_off_y, -eps]) cylinder(d=nut_dia, h=nut_depth+eps); + translate([nut_off_x, -nut_off_y, -eps]) cylinder(d=nut_dia, h=nut_depth+eps); + translate([-nut_off_x, nut_off_y, -eps]) cylinder(d=nut_dia, h=nut_depth+eps); + translate([-nut_off_x, -nut_off_y, -eps]) cylinder(d=nut_dia, h=nut_depth+eps); + */ + //} +} + +base(); \ No newline at end of file diff --git a/enclosure/rails/olsndot_clamp_stoppers.scad b/enclosure/rails/olsndot_clamp_stoppers.scad new file mode 100644 index 0000000..95dc31e --- /dev/null +++ b/enclosure/rails/olsndot_clamp_stoppers.scad @@ -0,0 +1,20 @@ +w = 20; +h = w; +d = 7; +hole_dia = 6; +hole_d = 4; +hole_fringe = 1.5; +fringe_extra = 1.0; +eps = 0.001; + +module stopper() { + difference() { + union() { + translate([-w/2, -h/2, 0]) cube([w, h, d]); + translate([0, 0, d-eps]) cylinder(d1=hole_dia+2*hole_fringe+2*fringe_extra, d2=hole_dia+2*fringe_extra, h=hole_fringe); + } + translate([0, 0, d+hole_fringe-hole_d]) cylinder(d=hole_dia, h=hole_d+eps); + } +} + +stopper($fn=25); \ No newline at end of file diff --git a/enclosure/rails/openstep_base.scad b/enclosure/rails/openstep_base.scad new file mode 100644 index 0000000..aaa47db --- /dev/null +++ b/enclosure/rails/openstep_base.scad @@ -0,0 +1,68 @@ +eps=0.01; + +nut_dia = 5.3; +nut_depth=5.5; + +module nut_base(w=10, o) { + difference() { + cylinder(d=w, h=nut_depth+o); + translate([0, 0, o-eps]) cylinder(d=nut_dia, h=nut_depth+2*eps); + } +} + +module raspi_holder(w, h, x=4) { + difference() { + union() { + cube([50+w, 50+w, h]); + + translate([w/2, w/2, 0]) union() { + nut_base(o=h); + translate([50, 0, 0]) { + nut_base(o=h); + translate([0, 50, 0]) nut_base(o=h); + } + translate([0, 50, 0]) nut_base(o=h); + } + } + translate([w, w, -eps]) cube([50-w, 50-w, h+2*eps]); + + + translate([w/2, w/2, -eps]) { + cylinder(d=x, h=h+2*eps); + translate([50, 0, 0]) { + cylinder(d=x, h=h+2*eps); + translate([0, 50, 0]) cylinder(d=x, h=h+2*eps); + } + translate([0, 50, 0]) cylinder(d=x, h=h+2*eps); + } + } +} + +module rev_nut_base(w=10, h=5, a=45, x=4, th=7, tw=10) { + rotate([0, 0, a]) + translate([-w/2, -w, 0]) difference() { + union() { + cube([w, w, h]); + translate([w/2, w, 0]) cylinder(d=tw, h=th); + } + translate([w/2, w, -eps]) { + cylinder(d=nut_dia, h=nut_depth+2*eps); + cylinder(d=x, h=th+2*eps); + } + } +} + +module raspi_adapter(w=10, h=5, s=30) { + translate([-(50+w)/2, -(50+w)/2, 0]) raspi_holder(w=w, h=h); + difference() { + union() { + translate([-s, -(50+w)/2-5, 0]) rev_nut_base(a=-30-180); + translate([ s, -(50+w)/2-5, 0]) rev_nut_base(a=-60-90); + translate([-s, (50+w)/2+5, 0]) rev_nut_base(a=-60+90); + translate([ s, (50+w)/2+5, 0]) rev_nut_base(a=-30); + } + cube([60, 60, 100], center=true); + } +} + +raspi_adapter($fn=25); diff --git a/enclosure/rails/raspi_adapter.scad b/enclosure/rails/raspi_adapter.scad new file mode 100644 index 0000000..12d17a7 --- /dev/null +++ b/enclosure/rails/raspi_adapter.scad @@ -0,0 +1,68 @@ +eps=0.01; + +nut_dia = 5.3; +nut_depth=5.5; + +module nut_base(w=10, o) { + difference() { + cylinder(d=w, h=nut_depth+o); + translate([0, 0, o-eps]) cylinder(d=nut_dia, h=nut_depth+2*eps); + } +} + +module raspi_holder(w, h, x=4) { + difference() { + union() { + cube([58+w, 49+w, h]); + + translate([w/2, w/2, 0]) union() { + nut_base(o=h); + translate([58, 0, 0]) { + nut_base(o=h); + translate([0, 49, 0]) nut_base(o=h); + } + translate([0, 49, 0]) nut_base(o=h); + } + } + translate([w, w, -eps]) cube([58-w, 49-w, h+2*eps]); + + + translate([w/2, w/2, -eps]) { + cylinder(d=x, h=h+2*eps); + translate([58, 0, 0]) { + cylinder(d=x, h=h+2*eps); + translate([0, 49, 0]) cylinder(d=x, h=h+2*eps); + } + translate([0, 49, 0]) cylinder(d=x, h=h+2*eps); + } + } +} + +module rev_nut_base(w=10, h=5, a=45, x=4, th=7, tw=10) { + rotate([0, 0, a]) + translate([-w/2, -w, 0]) difference() { + union() { + cube([w, w, h]); + translate([w/2, w, 0]) cylinder(d=tw, h=th); + } + translate([w/2, w, -eps]) { + cylinder(d=nut_dia, h=nut_depth+2*eps); + cylinder(d=x, h=th+2*eps); + } + } +} + +module raspi_adapter(w=10, h=5, s=30) { + translate([-(58+w)/2, -(49+w)/2, 0]) raspi_holder(w=w, h=h); + difference() { + union() { + translate([-s, -(49+w)/2-5, 0]) rev_nut_base(a=-15-180); + translate([ s, -(49+w)/2-5, 0]) rev_nut_base(a=-75-90); + translate([-s, (49+w)/2+5, 0]) rev_nut_base(a=-75+90); + translate([ s, (49+w)/2+5, 0]) rev_nut_base(a=-15); + } + cube([64, 55, 100], center=true); + } +} + +raspi_adapter($fn=25); diff --git a/enclosure/rails/rs485_base.scad b/enclosure/rails/rs485_base.scad new file mode 100644 index 0000000..2b5afe5 --- /dev/null +++ b/enclosure/rails/rs485_base.scad @@ -0,0 +1,43 @@ +eps=0.01; + +nut_dia = 5.3; +nut_depth=5.5; + +bx=71.12; +by=35.56; + +w=8; +h=5; +s=30; +d=w; +bh=8; +sd=4; + +module qc(a, b, d, h) { + translate([-a, -b, 0]) cylinder(d=d, h=h); + translate([-a, b, 0]) cylinder(d=d, h=h); + translate([ a, -b, 0]) cylinder(d=d, h=h); + translate([ a, b, 0]) cylinder(d=d, h=h); +} + +module foo() { + difference() { + union() { + translate([0, by/2, h/2]) cube([2*s+w, w, h], center=true); + translate([0, -by/2, h/2]) cube([2*s+w, w, h], center=true); + translate([-bx/2, 0, h/2]) cube([w, by, h], center=true); + translate([bx/2, 0, h/2]) cube([w, by, h], center=true); + + qc(a=bx/2, b=by/2, d=d, h=bh); + qc(a=s, b=by/2, d=d, h=bh); + } + translate([0, 0, -eps]) { + qc(a=bx/2, b=by/2, d=sd, h=bh+2*eps); + qc(a=s, b=by/2, d=sd, h=bh+2*eps); + translate([0, 0, bh-nut_depth+eps]) qc(a=bx/2, b=by/2, d=nut_dia, h=nut_depth+eps); + qc(a=s, b=by/2, d=nut_dia, h=nut_depth+eps); + } + } +} + +foo($fn=25); \ No newline at end of file diff --git a/hardware/enclosure/olsndot_base.scad b/hardware/enclosure/olsndot_base.scad deleted file mode 100644 index 2cea8b2..0000000 --- a/hardware/enclosure/olsndot_base.scad +++ /dev/null @@ -1,110 +0,0 @@ - -/* A small, arbitrary unit to guard against rounding errors */ -eps = 0.1; -alot = 1000; - -/* Base PCB size */ -pcb_width = 90; -pcb_height = 50; - -bottom_thickness = 1.5; - -screw_base_dia = 8; -screw_base_h = 5; -screw_nut_dia = 5.4; -screw_nut_h = 6; -screw_hole_dia = 3.5; -screw_hole_h = 6; - -module rounded_rect(w, h, r) { - hull(){ - translate([w/2-r, h/2-r]) circle(r); - translate([-(w/2-r), h/2-r]) circle(r); - translate([w/2-r, -(h/2-r)]) circle(r); - translate([-(w/2-r), -(h/2-r)]) circle(r); - } -} - -module single_screw_base() { - translate([0, 0, bottom_thickness-eps]) linear_extrude(height=screw_base_h+eps) { - circle(d=screw_base_dia); - translate([-screw_base_dia/2, 0]) square([alot, alot]); - translate([0, -screw_base_dia/2]) square([alot, alot]); - } -} - -w = pcb_width+10; -h = pcb_height; -l = 10; -r = 10; -t = 5; -b = 5; -s1_pos = [ w/2-l, h/2-b]; -s2_pos = [-w/2+r, -h/2+t]; -s3_pos = [ w/2-l, -h/2+t]; -s4_pos = [-w/2+r, h/2-b]; -module screw_bases() { - intersection() { - union() { - translate(s1_pos) single_screw_base(); - translate(s2_pos) mirror([1,1,0]) single_screw_base(); - translate(s3_pos) mirror([0,1,0]) single_screw_base(); - translate(s4_pos) mirror([1,0,0]) single_screw_base(); - } - cube([w+eps, h+eps, alot], center=true); - } -} - - -module single_screw_hole() { - translate([0, 0, bottom_thickness+screw_base_h+eps]) - mirror([0,0,1]) - union() { - cylinder(h=screw_nut_h+eps, d=screw_nut_dia); - cylinder(h=screw_hole_h+eps, d=screw_hole_dia); - } -} - -module screw_holes() { - translate(s1_pos) single_screw_hole(); - translate(s2_pos) mirror([1,1,0]) single_screw_hole(); - translate(s3_pos) mirror([0,1,0]) single_screw_hole(); - translate(s4_pos) mirror([1,0,0]) single_screw_hole(); -} - -tab_w = 20; -tab_h = 30; -tab_thickness = 3; -tab_hole_d = 9; -module screw_tab() { - difference() { - translate([-tab_h/2, -eps, 0]) cube([tab_h, tab_w+eps, tab_thickness]); - rotate([0, 0, -50]) translate([-alot/2, tab_h*0.6, -eps]) cube([alot, alot, tab_h+2*eps]); - rotate([0, 0, 50]) translate([-alot/2, tab_h*0.6, -eps]) cube([alot, alot, tab_thickness+2*eps]); - translate([0, tab_w/2, -eps]) cylinder(d=tab_hole_d, h=tab_thickness+eps*2); - } -} - -wall_height = bottom_thickness + 3; -wall_thickness = 1.5; - -cutout_w = 25; -cutout_h = 70; - -module carrier() { - union() { - difference() { - translate([0, 0, wall_height/2]) cube([w, h, wall_height], center=true); - translate([0, 0, bottom_thickness + alot/2]) cube([w-wall_thickness*2+eps, h-wall_thickness*2+eps, alot], center=true); - cube([cutout_h, cutout_w, alot], center=true); - } - difference() { - screw_bases(); - screw_holes(); - } - translate([0, h/2, 0]) screw_tab(); - mirror([0,1,0]) translate([0, h/2, 0]) screw_tab(); - } -} - -carrier($fn=25); \ No newline at end of file diff --git a/hardware/enclosure/olsndot_clamp_base.scad b/hardware/enclosure/olsndot_clamp_base.scad deleted file mode 100644 index ad09989..0000000 --- a/hardware/enclosure/olsndot_clamp_base.scad +++ /dev/null @@ -1,105 +0,0 @@ -eps = 0.01; - -module clamp( - l=90, - w=14, - h=10, - d1=30, - d2=35, - o=10, - hdia1=5, - hdia2=10, - hd=5, - nw=7.8, - nd=3, - notch_sf=0.75, - notch_d=3, - notch_a=10, - notch_o=0.5, - edge_a=5, - edge_d=12) { - translate([-h-l/2, -w/2, 0]) union() { - translate([l+h-notch_d, 0, 0]) intersection() { - difference() { - cube([d1, w, d1]); - //scale([notch_sf, 1, 1]) translate([(d1-h)/2, 0, h+(d1-h)/2]) rotate([0, -135, 0]) translate([0, -eps/2, 0]) cube([d1, w+eps, d1]); - translate([notch_d, 0, h+notch_o]) mirror([1, 0, 0]) rotate([0, notch_a, 0]) translate([0, -eps/2, 0]) cube([d1, w+eps, d1]); - } - translate([d1-edge_a, 0, d1/2]) rotate([0, -90-45, 0]) cube([2*d1, w+eps, 2*d1]); - translate([-d1-edge_d, 0]) cube([2*d1, w+eps, 2*d1]); - } - difference() { - union() { - cube ([l+h, w, h]); - cube ([h, w, d2]); - } - rotate([0, 45, 0]) translate([-l/2, -eps/2, -d2/8*7]) cube([l, w+eps, d2]); - translate([0, 0, d2]) rotate([0, 90+45, 0]) translate([-l/2, -eps/2, -d2/8*7]) cube([l, w+eps, d2]); - translate([-eps/2, w/2, d2-o]) rotate([0, 90, 0]) union() { - cylinder(d=6, h=l); - cylinder(d=12, h=hd); - translate([-11/2, -11/2, h-4]) cube([11, 11, 5]); - } - } - } -} - -module hexagon(size, height) { - boxWidth = size/1.75; - for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true); -} - -nut_dia = 5.3; -nut_depth=5.5; -nut_off_y = 80/2; -nut_off_x = 20; - -module nut_holder( - a = 30, - b = 15, - c = 10, - d = 5.0, - e = 4.0, - ) { - - difference() { - union() { - translate([-b/2, -(a-b)/2, 0]) cube([b, a-b, c]); - translate([0, -(a-b)/2, 0]) cylinder(d=b, h=c); - translate([0, (a-b)/2, 0]) cylinder(d=b, h=c); - } - translate([0, a/2 - d, -eps]) { - translate([0, 0, c-nut_depth+2*eps]) cylinder(d=nut_dia, h=nut_depth); - cylinder(d=e, h=c+2*eps); - } - translate([0, -a/2 + d, -eps]) { - translate([0, 0, c-nut_depth+2*eps]) cylinder(d=nut_dia, h=nut_depth); - cylinder(d=e, h=c+2*eps); - } - } -} - -module base($fn=25, cw=93, sw=15, sh=15, strut_spacing=30, clamp_dist=90) { - d = 30; - clamp(l=cw, h=sh); - translate([-d, 0, 0]) nut_holder(); - translate([d, 0, 0]) nut_holder(); - /*difference() { - translate([0, -clamp_dist/2, 0]) union() { - */ - /* - translate([0, 0, 0]) clamp(l=cw, h=sh); - translate([-strut_spacing/2-sw, 0, 0]) cube([sw, clamp_dist, sh]); - translate([ strut_spacing/2, 0, 0]) cube([sw, clamp_dist, sh]); - */ - //} - /* - translate([nut_off_x, nut_off_y, -eps]) cylinder(d=nut_dia, h=nut_depth+eps); - translate([nut_off_x, -nut_off_y, -eps]) cylinder(d=nut_dia, h=nut_depth+eps); - translate([-nut_off_x, nut_off_y, -eps]) cylinder(d=nut_dia, h=nut_depth+eps); - translate([-nut_off_x, -nut_off_y, -eps]) cylinder(d=nut_dia, h=nut_depth+eps); - */ - //} -} - -base(); \ No newline at end of file diff --git a/hardware/enclosure/olsndot_clamp_stoppers.scad b/hardware/enclosure/olsndot_clamp_stoppers.scad deleted file mode 100644 index 95dc31e..0000000 --- a/hardware/enclosure/olsndot_clamp_stoppers.scad +++ /dev/null @@ -1,20 +0,0 @@ -w = 20; -h = w; -d = 7; -hole_dia = 6; -hole_d = 4; -hole_fringe = 1.5; -fringe_extra = 1.0; -eps = 0.001; - -module stopper() { - difference() { - union() { - translate([-w/2, -h/2, 0]) cube([w, h, d]); - translate([0, 0, d-eps]) cylinder(d1=hole_dia+2*hole_fringe+2*fringe_extra, d2=hole_dia+2*fringe_extra, h=hole_fringe); - } - translate([0, 0, d+hole_fringe-hole_d]) cylinder(d=hole_dia, h=hole_d+eps); - } -} - -stopper($fn=25); \ No newline at end of file -- cgit