diff --git a/cad/display.scad b/cad/display.scad index 70df92e..a7290fa 100644 --- a/cad/display.scad +++ b/cad/display.scad @@ -34,9 +34,8 @@ translate([146.6, 0, 0]) rpi4_cover(); // hinge test -translate([100, -80, 0]){ - male_hinge(); -} +//translate([width+(thickness*2)/2), -20, 0]) + //male_hinge(); module usb_compartment(){ usb_tray_width=31; @@ -107,22 +106,13 @@ module rpi4_cover(){ } // left slope - difference(){ - translate([19+thickness, 0, height+thickness]) - left_slope(22, depth+(thickness*2), 23.4); - - translate([19+thickness, thickness, height+thickness]) - left_slope(22, depth, 25); - } + translate([19+thickness, 0, height+thickness]) + sloped_walls(22, depth+(thickness*2), 23.4, thickness); // right slope - difference(){ - translate([145+thickness, 0, height+thickness]) - right_slope(22, depth+(thickness*2), 23.4); - - translate([145+thickness, thickness, height+thickness]) - right_slope(22, depth, 25); - } + translate([145+thickness+22, 0, height+thickness]) + mirror([1,0,0]) + sloped_walls(22, depth+(thickness*2), 23.4, thickness); // logo translate([31+thickness+62, (depth+(thickness*2))/2, height+25]) @@ -131,16 +121,24 @@ module rpi4_cover(){ import(file="mk-logo.svg", center=true); } -module left_slope(w, d, h){ +module prism(width, depth, height){ polyhedron( - points=[[0,d,0], [0,0,0], [w,0,0], [w,d,0], [w,d,h], [w,0,h]], + points=[[0, depth, 0], + [0, 0, 0], + [width, 0, 0], + [width, depth, 0], + [width, depth, height], + [width, 0, height]], faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]); } -module right_slope(w, d, h){ - polyhedron( - points=[[0,d,0], [0,0,0], [w,0,0], [w,d,0], [0,d,h], [0,0,h]], - faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]); +module sloped_walls(width, depth, height, thickness){ + difference(){ + prism(width, depth, height); + + translate([0, thickness, 0]) + prism(width, depth-(thickness*2), height); + } } module male_hinge(){