// allviews bottom top top-display // testviews board assembly test-bottom test-side test-top // Les vis pour le PI et le dessus sont des m2.5 environ 8 mm long include len=92; height=26; width=62; screwboard=1.3; // Rayon pour les vis attachant le PI screwtop=1.3; // Rayon pour les vis attachant le dessus holew=51; holel=58; module board(){ difference(){ union(){ // thin plate cube([85,56,vs_first_layer_height]); // USB connector translate([5,0,0]) cube([8,4,5]); // HDMI connector translate([21.5,0,0]) cube([15,4,8]); // Power translate([47.5,0,0]) cube([7,4,7.5]); // Memory card translate([-3,23,0]) cube([4,12,vs_first_layer_height]); } union(){ off=2.5; translate([off+holel,off,-1]) cylinder(r=1.8,h=3,$fn=20); translate([off,off,-1]) cylinder(r=1.8,h=3,$fn=20); translate([off+holel,off+holew,-1]) cylinder(r=1.8,h=3,$fn=20); translate([off,off+holew,-1]) cylinder(r=1.8,h=3,$fn=20); } } } module post(){ translate([-2.5,-2.5,0]) difference(){ cube([5,5,5]); translate([2.5,2.5,0]) cylinder(r=screwboard,h=6,$fn=20); } } module attach(reverse){ difference(){ union(){ translate([0,reverse ? -8 : 0,0]) cube([8,8,3]); translate([4,reverse ? -8 : 8,0]) cylinder(r=4,h=3,$fn=20); } translate([4,reverse ? -8: 8,-1]) cylinder(r=2,h=5,$fn=20); } } module support(reverse){ h=6; off = reverse ? 5 : 0; translate([off,off, 0]) rotate([0,0,reverse ? 180 : 0]){ translate([0,0,height-h]){ difference(){ cube([5,5,h]); translate([5/2,5/2,1]) cylinder(r=screwtop,h=h,$fn=20); } } // Help to print, a progressive width translate([0,0,height-h-5]) intersection(){ cube([5,5,5]); rotate([45,0,0]) cube([10,10,10]); } } } module bottom(posts,supports,hooks){ // Position of the mounting holes l2=len-9; l1=l2-58; w1=6; w2=w1+51; offthick=0.5; difference(){ union(){ translate([-offthick,-offthick,0]) cube([len+2*offthick,width+2*offthick,height]); } union(){ translate([-10,1,1]) cube([len-2+10,width-2,26]); // Large holes for all USB and ethernet connectors translate([0,2,2]) cube([2,width-4,26]); // Hole for the micro-usb connector translate([l1+47,width-5,1+5]) cube([10,10,5]); // Hole for HDMI translate([l1+23,width-5,1+5+2]) cube([16,10,7]); // Hole for power translate([l1+9,width+5,1+5+4]) rotate([90,0,0]) cylinder(r=4,h=20,$fn=20); } } // Add a little front to support the connectors translate([-offthick,0,0]) cube([1+offthick,width,5]); // Posts to attach the board if (posts){ translate([1.5,0,0]){ translate([l1,w1+1,1]) post(); translate([l2,w1+1,1]) post(); translate([l1,w2,1]) post(); translate([l2,w2,1]) post(); } } // Four supports to screw the top if (supports){ translate([1,-5,0]) support(true); translate([len-6,-5,0]) support(true); translate([1,width,0]) support(false); translate([len-6,width,0]) support(false); } // Four hooks to attach the boxs if (hooks){ translate([len-8,3,0]) attach(true); translate([0,3,0]) attach(true); translate([len-8,width-3,0]) attach(false); translate([0,width-3,0]) attach(false); } } module top(display){ offthick=0.5; // patch dans bottom o2=2*offthick; l2=len+2; w2=width+2; r2=2.5; // The side difference(){ // A thick top with hear union(){ translate([-o2,0,0]) cube([l2+o2+o2,w2+o2+o2,3]); translate([0,-5-offthick,0]) cube([8,w2+10+o2,3]); translate([l2-8,-5-offthick,0]) cube([8,w2+10+o2,3]); } union(){ // Put the holes hr=screwtop+0.3; translate([4+0.2,-2+0.2,-1]) cylinder(r=hr,h=3,$fn=20); translate([l2-r2-1.5-0.2,-2,-1]) cylinder(r=hr,h=3,$fn=20); translate([4+0.4,w2+1,-1]) cylinder(r=hr,h=3,$fn=20); translate([l2-r2-1.5-0.2,w2+1,-1]) cylinder(r=hr,h=3,$fn=20); // Remove the interior translate([1,1,1]){ translate([-1,0,0]) cube([len+o2+o2,width+o2,4]); translate([0,-5-offthick,0]) cube([6,w2+8+o2,3]); translate([l2-8,-5-offthick,0]) cube([6,w2+8+o2,3]); } if (display) translate([10,7,-1]) cube([l2-10-6,52,5]); } } } module main_view(view){ if (view=="bottom"){ bottom(true,true,true); }else if (view=="test-bottom"){ offz=1-vs_first_layer_height; translate([0,0,-offz]){ intersection(){ difference(){ bottom(true,true,false); translate([10,10,-1]) cube([len-20,width-20,3]); } translate([-10,-10,offz]) cube([len+20,width+20,2]); } } }else if (view=="test-side"){ offz=1-vs_first_layer_height; translate([0,0,-offz]){ intersection(){ bottom(true,false,false); translate([-10,width-10,offz]) cube([len+20,width+20,height-8]); } } }else if (view=="top"){ top(false); }else if (view=="top-display"){ top(true); }else if (view=="test-top"){ intersection(){ translate([0,-10,0]) cube([20,100,10]); translate([0,0,-1+vs_first_layer_height]) top(); } }else if (view=="board"){ board(); }else if (view=="assembly"){ bottom(true,true,true); translate([85,60,6]) rotate([0,0,180]) board(); translate([-1,width+1,height+4]) rotate([180,0,0]) top(); } }