SIN_60=0.866025403784439; $fn=40; $mount_height = 4; //For cable mount $wdth = 12; $height = 9; $len = 15; $internal_radius = 7.7/2; //End cable mount /* ================================== GENERIC SHAPES ================================== */ module hexagon(s=4, h=3) { A=0.5 * s; B=SIN_60 * s; C=s; translate([-s, -s * SIN_60, -h / 2]) linear_extrude(height=h) polygon([[0, B], [A, 0], [A + C, 0], [2 * C, B], [A + C, 2 * B], [A, 2 * B]], paths=[[0, 1, 2, 3, 4, 5]]); } module sector(radius, angles, fn = 174) { r = radius / cos(180 / fn); step = -360 / fn; points = concat([[0, 0]], [for(a = [angles[0] : step : angles[1] - 360]) [r * cos(a), r * sin(a)] ], [[r * cos(angles[1]), r * sin(angles[1])]] ); difference() { circle(radius, $fn = fn); polygon(points); } } module hole(x,y,size = 2.4) { translate([x,y,-0.01]) cylinder($mount_height + 0.01,r=(size/2)); } /* ================================== FASTENERS ================================== */ //PCB mounts (spacer) - cylinder - unthreaded module mount(x,y,size = 2.4, support = false) { // For 3mm screw translate([x,y,-0]) difference(){ cylinder($mount_height,r=size); cylinder($mount_height + 0.01,r=(size/2)); //if(support){ // polygon(x+ // } } } /* ================================== CABLE MANAGEMENT ================================== */ //Cable gland hole module cg_hole(coords,rot,tr=3.5){ translate(coords) rotate([90,0,rot]) cylinder(3.5,6.25,6.5); translate([coords[0]+tr,coords[1],coords[2]]) rotate([90,0,rot]) cylinder(3.5,10.25,10.5); } //Cable gland module gland(){ rotate([0,90,0]) difference(){ cylinder(8,5,5); cylinder(8.1,3,3); } } module cablemount(width,height,length,int){ difference(){ union(){ cube([15,width,height/2]); translate([0,width/2,$height/2]) rotate([90,0,90]) linear_extrude(length) sector(width/2,[0,180]); } //Hole rotate([0,90,0]) translate([-0.5-(height/2),width/2,-0.0005]) cylinder(length+0.001,r=int/2); } } /* ================================== DISPLAY MOUNT ================================== */ module midas(){ //For midas MCOB display difference(){ translate([-2.50,-2.5,5]) linear_extrude(1) square([80,36]); translate([5.05,7.8,5]) linear_extrude(1) square([66,16]); } difference(){ linear_extrude(5) translate([-2.5,-2.50,0]) square([80,36]); translate([1.9,3.2,0]) linear_extrude(5.01) square([71.2,25.2]); hole(0,31,2.5); hole(0,0,2.5); hole(75,0,2.5); hole(75,31,2.5); linear_extrude(2) translate([26,-2.5,0]) square([45,3]); } } //cablemount(12,$height,$len,7.7);