/* Sensiplicity Sensor System * Controller Case * Designed by Nick Ames. * Copyright 2017 Sensiplicity Systems. All rights reserved. */ /* Configuration */ RPI_W = 85; /* Width of RPi PCB. */ RPI_H = 56; /* Height of RPi PCB. */ RPI_T = 1.5; /* Thickness of RPi PCB. */ RPI_HOLE_POS = [[3.5,3.5], /*[3.5,52.5],*/ [61.5,3.5], [61.5,52.5]]; S_THREAD_D = 2; S_CLEAR_D = 3.5; S_HEAD_D = 7; S_BOSS_D = 6; CLEARANCE = .25; /* Small gap around things to prevent tight fits. */ CASE_W = RPI_W + 15; CASE_H = RPI_H + 15; CASE_T = 36 + 6; CASE_R = 3; /* Corner radius */ CASE_OFF = [-7,-7,-6]; module centered_cube(size, axes){ translate([-axes[0]*size[0]/2, -axes[1]*size[1]/2, -axes[2]*size[2]/2])cube(size); } module internal_volume(){ vol_t = 26; translate([-CLEARANCE, -CLEARANCE, 0]){ /* PCB */ cube([RPI_W + 2*CLEARANCE, RPI_H + 2*CLEARANCE, RPI_T]); } difference(){ union(){ translate([-CLEARANCE, -CLEARANCE, -3]){ /* Bottom Side */ cube([RPI_W + CLEARANCE, RPI_H + CLEARANCE, 3]); } translate([0, 28, 0])centered_cube([3, 13, 3], [2, 1, 2]); /* SD */ translate([2.3, RPI_H, -3])centered_cube([51, 16, vol_t],[0,0,0]); /* Bride PCB */ cube([RPI_W, RPI_H, vol_t]); /* Internal volume. */ for(x = [0, 1, 2]){ /* RJ-12 Jack punch-outs. */ translate([x*16.51 + 10.6, 0, -2])centered_cube([13, 100, 15], [1,0,0]); } translate([RPI_W-20,10.5,RPI_T-.5])centered_cube([100,16.5,14.5], [0,1,0]); /* Ethernet jack punch-out. */ translate([RPI_W-20,29,RPI_T-.5])centered_cube([100,16,16.5], [0,1,0]); /* USB jack punch-out. */ translate([RPI_W-20,47,RPI_T-.5])centered_cube([100,16,16.5], [0,1,0]); /* USB jack punch-out. */ translate([32,20,RPI_T])centered_cube([15.5,100,7],[1,2,0]); /* HDMI */ translate([32,-1,RPI_T + 3.5])centered_cube([21,100,13],[1,2,1]); /* HDMI Clearance */ translate([10.6,20,RPI_T])centered_cube([8,100,3.5],[1,2,0]); /* Power */ translate([-3,7,0]){ translate([-1, -1, 0])cube([82,38,vol_t]); /* LCD PCB */ translate([4.3,5,20])cube([72,27.5,50]); /* LCD window */ translate([6,32,vol_t])cube([48,7,5]); /* LCD solder joint clearance. */ translate([74, 8,vol_t])cube([6,21,6]); /* LCD LED clearance */ for(x=[2.4,77.5]){ for(y=[2.4,33.4]){ /* LCD Screw Holes */ translate([x, y, vol_t])cylinder(d=2.5, h=5); } } } } translate([RPI_W,38,0])centered_cube([6, 4, vol_t], [2,1,0]); /* USB Separator */ translate([RPI_W,19.625,0])centered_cube([6, 4, vol_t], [2,1,0]); /* Eth Separators */ translate([RPI_W, 0, 17.5])centered_cube([4, RPI_H, vol_t], [2,0,0]); /* Eth/USB above */ translate([RPI_W, 0, RPI_T])centered_cube([26, 1.5, vol_t], [2,0,0]); /* Clamp */ for(p=RPI_HOLE_POS){ x=p[0]; y=p[1]; r = (y > 20)? 180 : 0; translate([x,y,0])rotate([0,0,r]){ union(){ /* RPi mounting bosses */ translate([0,0,-10]){ cylinder(d=S_BOSS_D, h=10); centered_cube([S_BOSS_D, 20, 10], [1,2,0]); } translate([0,0,RPI_T]){ cylinder(d=S_BOSS_D, h=100); centered_cube([S_BOSS_D, 6, 100], [1,2,0]); } } } } } /* RPi mounting holes */ for(p=RPI_HOLE_POS){ x=p[0]; y=p[1]; translate([x,y,0]){ union(){ translate([0,0,-5]){ cylinder(d=S_CLEAR_D, h=5); } translate([0,0,0]){ cylinder(d=S_THREAD_D, h=20); } translate([0,0,-20 - 5]){ cylinder(d=S_HEAD_D, h=20); } } } } translate([10.6,-.5,RPI_T + 3.5/2])centered_cube([13,100,12],[1,2,1]); /* Power Clearance */ translate([53.5, 0, 4])rotate([90, 0, 0])cylinder(d=6.5,h=100); /* Audio */ } module case_solid(){ translate(CASE_OFF){ hull(){ for(x=[CASE_R, CASE_W - 2*CASE_R]){ for(y=[CASE_R, CASE_H - 2*CASE_R]){ for(z=[CASE_R, CASE_T - 2*CASE_R]){ translate([x,y,z])sphere(r=CASE_R); } } } } } } module case_whole(){ difference(){ case_solid(); internal_volume(); } } module case_top(){ difference(){ case_whole(); translate([0,0,RPI_T])centered_cube([300,300,300], [1,1,2]); } } module case_bottom(){ difference(){ case_whole(); translate([0,0,RPI_T])centered_cube([300,300,300], [1,1,0]); } } rotate([0,180,0])case_top(); //case_bottom();