// Author: Martin Spinler // Info: Box for u1G4 probe // Make: Compile&Render + export to STL in OpenSCAD dim_x = 158.5; dim_y = 66; dim_z = 25; //dim_x = 10; // Small size for test print dim_front = 4; dim_top = 2.5; dim_side = 4; // Select, if print with support in connector holes (Ethernet, USB, Power) print_support = false; // Select, which part of box print //bottom(); top(); module outer_body() { intersection() { cube(size = [dim_x + dim_front*2, dim_y + dim_side*2, dim_z + dim_top*2], center = true); rotate(a = [0, 90, 0]) cylinder(h = dim_x + dim_front*2, r = dim_y/2 + dim_side, center = true, $fn = 100); } } module inner_body() { intersection() { cube(size = [dim_x, dim_y, dim_z], center = true); rotate(a = [0, 90, 0]) cylinder(h = dim_x, r = dim_y/2, center = true, $fn = 100); } } module pcbguides() { z1 = -10.0; z2 = -5.7; y = 1.3; for(i = [-dim_y/2 + y, dim_y/2 - y]) { translate([0, i, z1]) cube(size = [dim_x, 2, 3.5], center = true); translate([0, i, z2]) cube(size = [dim_x, 2, 1.5], center = true); } } module panel_back() { // Ethernet translate([-dim_x/2 - dim_front/2, 0, 0]) cube(size = [dim_front*1.1, 58.6, 14.5], center = true); } module panel_front() { // USB-A translate([dim_x/2 + dim_front/2, -2.5, -2.8]) cube(size = [dim_front*1.1, 17, 9], center = true); // Power Connector translate([dim_x/2 + dim_front/2, -17.6, -0.5]) rotate(a = [0,90,0]) cylinder(r1 = 4.8, r2 = 4.8, h = dim_front*1.1, center = true); // MicroSD slot /* translate([dim_x/2 + dim_front/2, 13, -6]) { translate([0, 0, 1]) rotate(a = [0, 90, 0]) cylinder(r = 2.5, h = dim_front*1.1, center = true); cube(size = [dim_front*1.1, 12, 3], center = true); }*/ // MicroSD slot window translate([dim_x/2 , 12.5, -6]) cube(size = [dim_front*1.1, 13, 4], center = true); // MicroUSB /*translate([dim_x/2 + dim_front/2, 25, 2]) cube(size = [dim_front*1.1, 8, 3], center = true);*/ } module feet() { for(x = [-dim_x*2/5, +dim_x*2/5]) for(y = [-dim_y/3, +dim_y/3]) translate([x, y, -dim_z/2 - dim_top + 1]) cylinder(h = 2.2, r = 5, center = true); } module cooling_hole() { for(x = [-4, 4]) translate([x, 0, 0]) cylinder(h = dim_top*1.1, r = 2, center = true, $fn = 12); cube(size = [8, 4, dim_top*1.1], center = true); } module cooling_top() { for(x = [-dim_x*6/15 : dim_x*2/15 : +dim_x*6/15+1]) for(y = [ -dim_y/3, -dim_y/9, dim_y/3, +dim_y/9]) translate([x, y, dim_z/2 + dim_top/2]) cooling_hole(); } module cooling_bottom() { for(x = [-dim_x/5 : dim_x/5 : +dim_x/5]) for(y = [0, -dim_y/3, +dim_y/3]) translate([x, y, -dim_z/2 - dim_top/2]) cooling_hole(); for(x = [-dim_x*2/5, +dim_x*2/5]) translate([x, 0, -dim_z/2 - dim_top/2]) cooling_hole(); } module cut_top() { // Front cut translate([-(dim_x/2 + dim_front), 0, 0]) cube(size = [dim_front*2 + 0.1, dim_y*2, dim_z + dim_top*2 + 0.1], center = true); // Inner cube cube(size = [dim_x, dim_y + dim_side, dim_top], center = true); // Side cut translate([0, 0, dim_z/4 + dim_top/2 + 0.1]) cube(size = [dim_x, dim_y + dim_side*2, dim_z/2 + dim_top + 0.1], center = true); } module cut_bottom() { // Front cut translate([dim_x/2 + dim_front, 0, 0]) cube(size = [dim_front*2 + 0.1, dim_y*2, dim_z*2], center = true); difference() { // Inner cube translate([0, 0, -dim_z/4 - dim_top/2 - 0.1]) cube(size = [dim_x + 0.1, dim_y + dim_side*2, dim_z/2 + dim_top + 0.1], center = true); // Side cut cube(size = [dim_x, dim_y + dim_side, dim_top], center = true); } } module screw_holes() { translate([dim_x/2 + dim_front/2, 0, dim_z/2 - 2]) rotate(a = [90, 0, 90]) for(y = [-dim_y/2+4, +dim_y/2-4]) translate([y, 0, 0]) { cylinder(h = dim_front*1.1, r1 = 0, r2 = 2.65, center = true, $fn = 12); cylinder(h = dim_front*1.1, r1 = 1.2, r2 = 1.2, center = true, $fn = 12); } } module screw_blocks() { for(y = [-dim_y/2 + 4, +dim_y/2 - 4]) translate([dim_x/2 - 4, y, dim_z/2 - 2]) { difference() { cube(size = [8, 8, 6], center = true); rotate([0, 90, 0]) cylinder(h = 10, r1 = 0.85, r2 = 1, center = true, $fn = 12); } } } module support_zigzag(x, y, z) { count = round(y / x/2); translate([-x, 0, 0]) for (c = [0 : count]) { translate([0, 2*(c-count/2)*x , 0]) { translate([x/2, 0, 0]) rotate([0, 0, -45]) cube([0.2, x*sqrt(2), z] , center = true); translate([x/2, x, 0]) rotate([0, 0, +45]) cube([0.2, x*sqrt(2), z], center = true); } } } module support_top() { translate([-dim_x/2-0.2, 0, 0]) support_zigzag(dim_front*0.9,60,16); } module support_bottom() { translate([dim_x/2-0.2 + dim_front, -13.5, 0]) support_zigzag(dim_front*0.65,30,16); } module bottom() { difference() { outer_body(); panel_front(); cooling_bottom(); inner_body(); screw_holes(); cut_top(); } pcbguides(); if(print_support == true) support_bottom(); } module top() { rotate([180, 0, 0]) { difference() { outer_body(); panel_back(); cooling_top(); inner_body(); cut_bottom(); } screw_blocks(); if(print_support == true) support_top(); } }