diff --git a/README.md b/README.md index 4387dba..a639ad6 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,13 @@ If you happen to own the same components as I do (Noctua NH-L12s, Zotac 1080 Min use the example stl files directly. ## Parameters to edit -In mini-itx.scad, you'll need to choose the power supply type (psu_type of "sfx", "sfx-l", or "flexatx), the CPU heatsink -(heatsink_type of "aio", "noctua_nh_l12s", "noctua_nh_u9s", "cryorig_c7", or create your own), and probably measure -your GPU if you don't happen to own the Zotac 1080 Mini like I do. +In mini-itx.scad, you'll need to choose + * the power supply type (psu_type) from: "sfx", "sfx-l", or "flexatx + * the CPU heatsink (heatsink_type) from: "aio", "noctua_nh_l12s", "noctua_nh_u9s", "cryorig_c7", "bequiet_shadowrock_lp", or create your own), + * your GPU (gpu_type) from: "zotac_1080_mini", "accelero_970", or "gt730_1g" +If you don't happen to own any of the parts mentioned before, you probably need to measure and input your own. - traditional(show_body = true, show_lid = false, show_internals = false, heatsink_type = "noctua_nh_l12s", psu_type = "sfx"); + traditional(show_body = true, show_lid = false, show_internals = false, heatsink_type = "noctua_nh_l12s", psu_type = "sfx", gpu_type = "zotac_1080_mini"); Beyond that, there are a range of optional items you can adjust. * The front fan with case_fan_size and case_fan_thickness @@ -29,7 +31,7 @@ Beyond that, there are a range of optional items you can adjust. * Extra clearance for your gpu power plug if needed with gpu_power_height * Airflow clearance for your heatsink if you want more than the default 5mm with cpu_fan_clearance * Thickness of all walls with wall in defaults.scad - + ## Printing You'll need to print the body and the lid one at a time. Note that the case is likely going to push up to or past the size limits of many consumer 3d printers. I've been printing them pretty successfully on a Prusa i3 MK3. diff --git a/gpu.scad b/gpu.scad index 77096eb..16d2400 100644 --- a/gpu.scad +++ b/gpu.scad @@ -16,25 +16,56 @@ pci_e_spacing = 47.29-26.97; // Transform from pci e card datum to bracket datum pci_e_to_bracket = [-64.13, 2.84-pcb_thickness, 100.36]; -module dual_gpu(length) { +module dual_gpu( length, height) { // Using the bottom center of the notch as the datum color("Green", 1.0) { difference() { - translate([pci_e_front_edge, -pcb_thickness/2, 0]) cube([length, pcb_thickness, 111.15]); + translate([pci_e_front_edge, -pcb_thickness/2, 0]) cube([length, pcb_thickness, height]); translate([pci_e_front_edge-extra, -pcb_thickness/2-extra/2, 0-extra]) cube([-pci_e_front_edge+extra-12.15, pcb_thickness+extra, pci_e_cutout_height]); translate([72.15, -pcb_thickness/2-extra/2, 0-extra]) cube([length-72.15+extra, pcb_thickness+extra, pci_e_cutout_height]); } } - + translate(pci_e_to_bracket) { pci_bracket(); translate([0, -pci_e_spacing, 0]) pci_bracket(); } } +module single_bracket_gpu( length, height) { + // Using the bottom center of the notch as the datum + color("Green", 1.0) { + difference() { + translate([pci_e_front_edge, -pcb_thickness/2, 0]) cube([length, pcb_thickness, height]); + translate([pci_e_front_edge-extra, -pcb_thickness/2-extra/2, 0-extra]) cube([-pci_e_front_edge+extra-12.15, pcb_thickness+extra, pci_e_cutout_height]); + translate([72.15, -pcb_thickness/2-extra/2, 0-extra]) cube([length-72.15+extra, pcb_thickness+extra, pci_e_cutout_height]); + } + } + + translate(pci_e_to_bracket) { + pci_bracket(); + } +} + +module quad_gpu_cutout() { + slot_extra = 0.1; + + translate(pci_e_to_bracket) { + pci_bracket_cutout(); + translate([0, -pci_e_spacing, 0]) pci_bracket_cutout(); + translate([0, -pci_e_spacing*2, 0]) pci_bracket_cutout(); + translate([0, -pci_e_spacing*3, 0]) pci_bracket_cutout(); + // Handle the gap between the two brackets, typically one piece on dual slot GPUs + /* translate([-(11.43-5.08), -pci_e_spacing, 0]) cube([11.43, pci_e_spacing, 40]); */ + /* translate([-(11.43-5.08), -pci_e_spacing*2, 0]) cube([11.43, pci_e_spacing, 40]); */ + /* translate([-(11.43-5.08), -pci_e_spacing*3, 0]) cube([11.43, pci_e_spacing, 40]); */ + } + +} + module dual_gpu_cutout() { slot_extra = 0.1; - + translate(pci_e_to_bracket) { pci_bracket_cutout(); translate([0, -pci_e_spacing, 0]) pci_bracket_cutout(); @@ -43,43 +74,55 @@ module dual_gpu_cutout() { } } +module single_bracket_gpu_cutout() { + slot_extra = 0.1; + + translate(pci_e_to_bracket) { + pci_bracket_cutout(); + } +} + + zotac_1080_mini_pcb = [172.48, 110]; zotac_1080_thickness = 41.9; zotac_1080_mini_length = 36+zotac_1080_mini_pcb[0]; // TODO: Needs measurement zotac_1080_front_fan = 100; zotac_1080_back_fan = 90; +zotac_1080_fan_thickness = 15; + +zotac_1080_mini_size = [zotac_1080_mini_length, zotac_1080_mini_pcb[1], zotac_1080_thickness]; module zotac_1080_mini() { // Brackets and PCB - dual_gpu(zotac_1080_mini_pcb[0]); - - fan_thickness = 15; - + dual_gpu(zotac_1080_mini_pcb[0], 111.15); + + + // Body color("DimGray", 1.0) { - translate([pci_e_front_edge, -(zotac_1080_thickness-3)+fan_thickness, pci_e_cutout_height]) { - cube([zotac_1080_mini_length, zotac_1080_thickness-fan_thickness, zotac_1080_mini_pcb[1]]); + translate([pci_e_front_edge, -(zotac_1080_thickness-3)+zotac_1080_fan_thickness, pci_e_cutout_height]) { + cube([zotac_1080_mini_length, zotac_1080_thickness-zotac_1080_fan_thickness, zotac_1080_mini_pcb[1]]); } } - + // Add the fans translate([pci_e_front_edge, -(zotac_1080_thickness-3), pci_e_cutout_height+zotac_1080_mini_pcb[1]/2]) { - - translate([zotac_1080_back_fan/2, 0, 0]) rotate([-90, 0, 0]) fan(zotac_1080_back_fan, fan_thickness, 9); - translate([zotac_1080_back_fan+zotac_1080_front_fan/2, 0, 0]) rotate([-90, 0, 0]) fan(zotac_1080_front_fan, fan_thickness, 8); + + translate([zotac_1080_back_fan/2, 0, 0]) rotate([-90, 0, 0]) fan(zotac_1080_back_fan, zotac_1080_fan_thickness, 9); + translate([zotac_1080_back_fan+zotac_1080_front_fan/2, 0, 0]) rotate([-90, 0, 0]) fan(zotac_1080_front_fan, zotac_1080_fan_thickness, 8); } } module zotac_1080_mini_cutout() { dual_gpu_cutout(); - + // Side panel fan cutouts translate([pci_e_front_edge+(zotac_1080_back_fan+zotac_1080_front_fan)/2, -(zotac_1080_thickness-3), pci_e_cutout_height+zotac_1080_mini_pcb[1]/2]) { rotate([90, 0, 0]) { vent_rectangular([zotac_1080_back_fan+zotac_1080_front_fan, zotac_1080_front_fan], 10, 2.0); } } - + // Front panel cutout translate([pci_e_front_edge+zotac_1080_mini_length, -(zotac_1080_thickness-3)/2+wall, pci_e_cutout_height+zotac_1080_mini_pcb[1]/2]) { rotate([0, 90, 0]) { @@ -88,5 +131,103 @@ module zotac_1080_mini_cutout() { } } -//zotac_1080_mini(); -//% zotac_1080_mini_cutout(); +// +accelero_970_pcb = [172.48, 110]; +accelero_970_thickness = 40; +accelero_970_main_fan = 120; +accelero_fan_thickness = 20; + +accelero_970_length = 36+accelero_970_pcb[0]; // TODO: Needs measurement +accelero_970_height = accelero_970_pcb[1] + 50; +accelero_970_depth = accelero_970_thickness + accelero_fan_thickness + 5; + +accelero_970_size = [accelero_970_length, accelero_970_height, accelero_970_depth]; + +module accelero_970() { + // Brackets and PCB + dual_gpu(accelero_970_pcb[0], 111.15); + + + + // Body + color("DimGray", 1.0) { + translate([pci_e_front_edge, -(accelero_970_thickness/2), pci_e_cutout_height]) { + union(){ + translate([accelero_970_length-160, -accelero_970_thickness/2, 10]){ + cube([138, accelero_970_thickness, 136]); + } + } + } + } + + // Add the fan + translate([pci_e_front_edge, -(accelero_970_thickness/2), pci_e_cutout_height+accelero_970_pcb[1]/2]) { + translate([accelero_970_length-90, -accelero_970_thickness, 20]) rotate([-90, 0, 0]) fan(accelero_970_main_fan, accelero_fan_thickness, 9); + } +} + +module accelero_970_cutout() { + dual_gpu_cutout(); + + // Side panel fan cutouts + translate([pci_e_front_edge+(accelero_970_main_fan), -(accelero_970_thickness)-40, pci_e_cutout_height+accelero_970_pcb[1]/2 + 20]) { + rotate([90, 0, 0]) { + vent_rectangular([accelero_970_main_fan, accelero_970_main_fan], 10, 2.0); + } + } +} + +// sizes for GT730 +gt730_1G_pcb = [114, 69]; +gt730_1G_thickness = 33; +//gt730_1G_length = gt730_1G_pcb[0]; // TODO: Needs measurement +//gt730_1G_height = gt730_1G_pcb[1]; +gt730_1G_depth = gt730_1G_thickness + 5; + +gt730_1G_size = [gt730_1G_pcb[0], gt730_1G_pcb[1], gt730_1G_depth]; + +module gt730_1G() { + // Brackets and PCB + single_bracket_gpu(gt730_1G_pcb[0], gt730_1G_pcb[1]); + + // Body + color("DimGray", 1.0) { + translate([pci_e_front_edge, -(gt730_1G_thickness/2), -gt730_1G_pcb[1]/2 ]) { + union(){ + translate([73, gt730_1G_thickness/2, gt730_1G_pcb[1]+7]) { + rotate([90, 0, 0]) { heatsink([76, 55, gt730_1G_thickness], 3, 11); } + } + } + } + } +} + +module gt730_1G_cutout() { + // @todo: clean this up + dual_gpu_cutout(); + //single_bracket_gpu_cutout(); +} + + + +_gpus=[ + ["zotac_1080_mini", zotac_1080_mini_size], + ["accelero_970", accelero_970_size], + //["gt730_1g", [gt730_1G_pcb[0], gt730_1G_pcb[1], gt730_1G_thickness+5]], + ["gt730_1g", gt730_1G_size], + ]; + +// Return the height of the GPU by name +function gpu_size(gpu) = _gpus[search([gpu], _gpus, 1, 0)[0]][1]; + +/************ place for testing the elements above ****************/ + +// zotac_1080_mini(); +// %zotac_1080_mini_cutout(); + +// translate ([300, 0, 0]){ +// accelero_970(); +// %accelero_970_cutout(); +// } + +//gt730_1G(); diff --git a/heatsink.scad b/heatsink.scad index 5d3a29b..e3dc3b6 100644 --- a/heatsink.scad +++ b/heatsink.scad @@ -40,7 +40,6 @@ module cryorig_c7() { } noctua_nh_l12s_size = [146, 128, 70]; - module noctua_nh_l12s() { translate([noctua_nh_l12s_size[0]/2-66, 0, noctua_nh_l12s_size[2]-20]) heatsink([noctua_nh_l12s_size[0], noctua_nh_l12s_size[1], 20], 0, 80); translate([noctua_nh_l12s_size[0]/2-66, 0, noctua_nh_l12s_size[2]-15-20]) fan(120, 15, 9); @@ -50,13 +49,38 @@ module noctua_nh_l12s() { } noctua_nh_u9s_size = [95, 95, 125]; - module noctua_nh_u9s() { color("Gainsboro") { translate([-noctua_nh_u9s_size[0]/2, -noctua_nh_u9s_size[1]/2, 0]) cube(noctua_nh_u9s_size); } } + +bequiet_shadowrock_lp_size = [122, 134.21, 75.4]; +module bequiet_shadowrock_lp() { + rotate([0,0,-90]){ + // cpu-block + color("Gainsboro") { + translate([-20, -20, 0]) { cube([40, 40, 15]); } + } + // middle heatsink + translate([0, -10, 19.9]) { + heatsink([76, 76, 31.7-19.9], 0, 80); + } + //upper heatsink + translate([bequiet_shadowrock_lp_size[0]/2-66, 20, 31.7]) { + //rotate([0,0, 90]) + heatsink([bequiet_shadowrock_lp_size[0], bequiet_shadowrock_lp_size[1], 50-31.7], 0, 80); + } + + // fan + translate([bequiet_shadowrock_lp_size[0]/2-66, 20, 50]){ + fan(120, 25, 9); + } + } +} + + // Dimensions including stock fan corsair_h60_size = [27+25, 152, 120]; corsair_h60_fan = [120, 25]; @@ -68,7 +92,7 @@ module corsair_h60() { color("DarkSlateGray", 1.0) { translate([fan_thickness, 0, 0]) { cube([corsair_h60_size[0]-fan_thickness, corsair_h60_size[1], corsair_h60_size[2]]); - + // Add placeholders for the tubes tube_r = 6; // TODO: measure this translate([0, corsair_h60_size[1]-tube_r, corsair_h60_size[2]/4]) { @@ -77,7 +101,7 @@ module corsair_h60() { } } } - + translate([0, corsair_h60_size[1]/2-corsair_h60_fan_offset, corsair_h60_fan[0]/2]) rotate([0, 90, 0]) fan(corsair_h60_fan[0], fan_thickness, 7); } @@ -89,6 +113,8 @@ module heatsink_type(type) { noctua_nh_l12s(); } else if (type == "noctua_nh_u9s") { noctua_nh_u9s(); + } else if (type == "bequiet_shadowrock_lp") { + bequiet_shadowrock_lp(); } else if (type == "aio") { aio_pump(); } else { @@ -96,10 +122,11 @@ module heatsink_type(type) { } } -_heatsinks=[ - ["cryorig_c7", cryorig_c7_size[2]], +_heatsinks=[ + ["cryorig_c7", cryorig_c7_size[2]], ["noctua_nh_l12s", noctua_nh_l12s_size[2]], ["noctua_nh_u9s", noctua_nh_u9s_size[2]], + ["bequiet_shadowrock_lp", bequiet_shadowrock_lp_size[2]], ["aio", aio_pump_size[2]] ]; @@ -110,4 +137,5 @@ function heatsink_height(heatsink) = _heatsinks[search([heatsink], _heatsinks, 1 //cryorig_c7(); //noctua_nh_l12s(); +//bequiet_shadowrock_lp(); //corsair_h60(); diff --git a/micro-atx.scad b/micro-atx.scad new file mode 100644 index 0000000..d911d9c --- /dev/null +++ b/micro-atx.scad @@ -0,0 +1,393 @@ +// Parametric Micro-ATX Case +// https://github.com/eclecticc/ParametricCase +// +// BSD 2-Clause License +// Copyright (c) 2018, Nirav Patel, http://eclecti.cc +// +// The main file with the case itself + +include ; +include ; +include ; +include ; +include ; +include ; +include ; +include ; +include ; +include ; + +// Uxcell M3 threaded inserts from Amazon +insert_r = 5.3/2+0.1; +insert_h = 5.0; + +module motherboard_standoff() { + difference() { + cylinder(r = (0.4*25.4)/2, h = microatx_bottom_keepout); + translate([0, 0, microatx_bottom_keepout-insert_h]) cylinder(r = insert_r - 0.1, h = insert_h+extra); + } +} + +module motherboard_standoffs_microatx() { + $fn = 50; + + // Mounting holes for the motherboard + translate([microatx_hole_b[0], microatx_hole_b[1], 0]) { + motherboard_standoff(); + for (hole = [microatx_hole_c, microatx_hole_d, microatx_hole_e, microatx_hole_f, microatx_hole_g, microatx_hole_h, microatx_hole_i, microatx_hole_j]) { + translate([hole[0], hole[1], 0]) motherboard_standoff(); + } + } +} + +// Just a little wedge to provide support for the PSU +module psu_ledge() { + cube_size = 15; + translate([0, extra, 0]) difference() { + translate([-cube_size/2, 0, 0]) rotate([-45, 0, 0]) cube([cube_size, cube_size, cube_size], true); + translate([-cube_size*1.5, -cube_size*1.5, 0]) cube([cube_size*2, cube_size*2, cube_size*2]); + translate([-cube_size*1.5, 0, -cube_size*1.5]) cube([cube_size*2, cube_size*2, cube_size*2]); + } +} + +module psu_corner_ledge() { + cube_size = 25; + translate([-extra, -extra, 0]) difference() { + translate([-cube_size/5, -cube_size/5, 0]) rotate([0, 0, -45]) rotate([45, 0, 0]) cube([cube_size, cube_size, cube_size], true); + translate([-cube_size*1.1, -cube_size*1.1, 0]) cube([cube_size*2, cube_size*2, cube_size*2]); + translate([-cube_size*2, -cube_size*1.1, -cube_size]) cube([cube_size*2, cube_size*2, cube_size*2]); + translate([-cube_size*1.1, -cube_size*2, -cube_size]) cube([cube_size*2, cube_size*2, cube_size*2]); + } +} + +module cable_wrap_holder() { + wrap_width = 15; + + difference () { + translate([wall, -wall-wrap_width/2, 0]) { + cube([wall, wall*2+wrap_width, wall*2]); + translate([-wall*1.5, 0, 0]) cube([wall*2, wall, wall*2]); + translate([-wall*1.5, wall+wrap_width, 0]) cube([wall*2, wall, wall*2]); + translate([wall, 0, 0]) rotate([0, -45-90, 0]) cube([wall*2, wall, wall*4]); + translate([wall, wall+wrap_width, 0]) rotate([0, -45-90, 0]) cube([wall*2, wall, wall*4]); + } + translate([-wall/2-10, -wall-wrap_width, -10]) cube([10, wrap_width*2+wall*2, 20]); + } +} + +// The tab that the pci bracket screws into +module pci_bracket_holder() { + tab_depth = 11.43; + + bottom_wall = 1.0; + + translate(pci_e_to_bracket) { + difference() { + // The body of the tab + translate([pci_bracket_back_edge, -pci_e_spacing+pci_bracket_right_edge-pci_bracket_slot_extra, -tab_depth]) cube([tab_depth, pci_e_spacing+pci_bracket_total_width+pci_bracket_slot_extra*2-2.54, tab_depth]); + // Chop it at 45 degrees to make it printable + translate([pci_bracket_back_edge+tab_depth, -pci_e_spacing+pci_bracket_right_edge-pci_bracket_slot_extra-extra/2, -tab_depth]) rotate([0, -45-90, 0]) cube([tab_depth*2, pci_e_spacing+pci_bracket_total_width+pci_bracket_slot_extra*2-2.54+extra, tab_depth]); + } + } +} + +module pci_bracket_holder_cutout() { + $fn = 20; + + bottom_wall = 1.0; + + translate(pci_e_to_bracket) { + // Cut out the holes for the threaded insert and the bolt + for( i = [ 0, 1, 2, 3]) { + translate([0, -pci_e_spacing*i, -insert_h]) { + cylinder(r = insert_r - 0.1, h = insert_h+extra); + translate([0, 0, -bottom_wall-extra/2]) cylinder(r = 1.5, h = bottom_wall+extra); + } + } + } +} + +module top_lid(size) { + cube([size[0], size[1], wall]); + translate([0, 0, wall/2]) rotate([45, 0, 0]) translate([0, -wall/4, -wall/4]) cube([size[0], wall/2, wall/2]); + translate([0, size[1], wall/2]) rotate([45, 0, 0]) translate([0, -wall/4, -wall/4]) cube([size[0], wall/2, wall/2]); + translate([size[0], 0, wall/2]) rotate([45, 0, 90]) translate([0, -wall/4, -wall/4]) cube([size[1], wall/2, wall/2]); +} + +module back_to_back() { + motherboard_microatx(false, am4_holes, am4_socket); + + translate([am4_holes[0], am4_holes[1], am4_socket[2]+microatx[2]]) cryorig_c7(); + + translate([0, microatx[1]-flexatx_size[2], -microatx_bottom_keepout-wall]) { + rotate([-90, 0, 0]) flexatx(); + } + + translate([microatx_pci_e_baseoffset[0], microatx_pci_e_baseoffset[1]+100, -40]) { + rotate([90, 0, 0]) zotac_1080_mini(); + } +} + +module traditional(show_body, show_lid, show_internals, heatsink_type, psu_type, gpu_type) { + // Airflow clearance for CPU fan + cpu_fan_clearance = 5; + heatsink_height = heatsink_height(heatsink_type); + psu_size = psu_size(psu_type); + + // Extra height for cable clearance for 8-pin connectors on the top of the card + gpu_power_height = 5; // FIXME: gpu thickness doesn't account for bracket width + gpu_size = gpu_size(gpu_type); + + // @todo: use variable to position the cpu + gpu_location = microatx_pci_e_position_0; + case_origin = [microatx_motherboard_back_edge-wall, -gpu_size[2]-wall+microatx_pci_e_offset_3[1]+3, -microatx_bottom_keepout-wall]; // TODO: Clean up the Y calculation + + m2_size = [110, 22+10]; + m2_location = [microatx[0]/2, 30]; // Note that this should be adjusted to match the mobo used + + case_fan_size = 140; + case_fan_thickness = 25; + case_exhaust_fan_size = 80; + case_exhaust_fan_thickness = 15; + + // Figure out the stacked heights of the tallest components to use for case height + psu_heatsink_stack = -case_origin[2]+microatx[2]+am4_socket[2]+heatsink_height+cpu_fan_clearance+psu_size[2]+wall; + gpu_stack = -case_origin[2]+wall+microatx_pci_e_offset_0[2]+microatx[2]+pci_e_cutout_height+gpu_size[1]+gpu_power_height; + + // Figure out the stacked lengths of the longest components to use for case length + microatx_cooling_length = -microatx_motherboard_back_edge+wall*3+microatx[0]+(heatsink_type == "aio" ? corsair_h60_size[0] : case_fan_thickness); + gpu_length = gpu_size[0]+wall*3; // Note the extra wall length for assembly margin + + case_size = [max(microatx_cooling_length, gpu_length), microatx[1]-case_origin[1]+microatx_motherboard_back_panel_overhang+motherboard_back_panel_lip, max(psu_heatsink_stack, gpu_stack)]; + + psu_location = [microatx_motherboard_back_edge, case_origin[1]+case_size[1]-psu_size[1]-wall-wall/4, case_origin[2]+case_size[2]-psu_size[2]-wall]; + + cable_wrap_location = [psu_location[0] + psu_size[0] + (case_size[0] - psu_size[0])/3, case_origin[1]+case_size[1]-wall, case_origin[2]+case_size[2]-psu_size[2]-wall]; + + case_fan_location = [case_size[0]-wall-case_fan_thickness, (case_fan_size >= 120) ? case_size[1]/2-case_origin[1]/2 : case_size[1]/2, case_fan_size/2+wall*2]; + case_exhaust_fan_location = [wall, case_size[1]-psu_size[1]-case_exhaust_fan_size/2-wall, case_size[2]-case_exhaust_fan_size/2-wall]; + + power_switch_location = [case_origin[0]+case_size[0], case_origin[1]+power_switch_r+wall*2.5, case_origin[2]+power_switch_r+wall*2.5]; + dual_usb_location = [case_origin[0]+case_size[0]-wall, case_origin[1]+case_size[1]-wall-dual_usb_size[2]-0.5, case_origin[2]+case_size[2]/2]; + + // Calculate the case size in liters + case_volume = case_size[0]*case_size[1]*case_size[2]/1000000.0; + echo("Case dimensions X:", case_size[0], " Y:", case_size[1], " Z:", case_size[2], " L:", case_volume); + + corsair_h60_location = [case_size[0]-wall-corsair_h60_size[0], case_size[1]-wall*2-corsair_h60_size[1], case_size[2]-wall*2-corsair_h60_size[2]]; + + // Using the bottom corner of the motherboard near the GPU as the origin + if (show_internals == true) { + motherboard_microatx(true, microatx_am4_holes, am4_socket); + + translate([microatx_am4_holes[0], microatx_am4_holes[1], am4_socket[2]+microatx[2]]) { + heatsink_type(heatsink_type); + } + + translate(psu_location) psu_type(psu_type); + if (psu_type == "flexatx") { + // The exhaust fan only fits (sort of) with flexatx + translate(case_origin) { + translate(case_exhaust_fan_location) { + rotate([0, 90, 0]) fan(case_exhaust_fan_size, case_exhaust_fan_thickness, 10); + } + } + } + + translate(gpu_location) { + if ( gpu_type == "zotac_1080_mini" ) { + zotac_1080_mini(); + } else if ( gpu_type == "accelero_970" ) { + accelero_970(); + } else if (gpu_type == "gt730_1g" ) { + gt730_1G(); + } + + } + + translate(case_origin) { + // Put into place a radiator for AIO cooling + if (heatsink_type == "aio") { + translate(corsair_h60_location) { + corsair_h60(); + } + } else { + // Otherwise put a standard case fan in the front + translate(case_fan_location) { + rotate([0, 90, 0]) fan(case_fan_size, case_fan_thickness, 10); + } + } + } + + translate(power_switch_location) { + rotate([0, 90, 0]) power_switch(); + } + + translate(dual_usb_location) { + rotate([-90, 0, 0]) rotate([0, 0, 90]) dual_usb(); + } + } + + // Make the lid separately so it can be printed on its own + if (show_lid == true) color("WhiteSmoke", 0.5) { + translate(case_origin) { + translate([0, wall, case_size[2]-wall]) top_lid([case_size[0]-wall, case_size[1]-wall*2]); + } + } + + // The actual case + if (show_body == true) color("WhiteSmoke", 0.5) { + // Motherboard standoffs taking threaded inserts + translate([0, 0, -microatx_bottom_keepout]) { + motherboard_standoffs_microatx(); + } + + // Part that the GPU screws into + translate(gpu_location) { + difference() { + pci_bracket_holder(); + pci_bracket_holder_cutout(); + } + } + + // Attach ledges to the walls to help hold up the PSU + translate(psu_location) { + translate([psu_size[0], psu_size[1], 0]) psu_ledge(); + translate([0, psu_size[1], 0]) rotate([0, 0, -90]) psu_corner_ledge(); + } + + // Put some cable wrap holders on the wall near the PSU + translate(cable_wrap_location) { + rotate([0, 0, -90]) { + cable_wrap_holder(); + translate([0, 0, psu_size[2]-wall*4]) cable_wrap_holder(); + } + } + + difference() { + // Body of the case + translate(case_origin) { + difference() { + cube(case_size); + translate([wall, wall, wall]) cube([case_size[0]-wall*2, case_size[1]-wall*2, case_size[2]]); + minkowski() { + translate([0-extra, wall, case_size[2]-wall]) top_lid([case_size[0]-wall+extra, case_size[1]-wall*2]); + cube([0.2, 0.2, 0.2], center = true); + } + } + } + + translate(case_origin) { + translate([8, 0.2, 8]) { + rotate([90, 0, 0]) linear_extrude(wall) { + text(str(case_volume), font = "Helvetica:style=Normal", size = 20); + } + } + } + + motherboard_microatx_back_panel_cutout(); + + // Put a vent in the bottom for a typical M.2 SSD location. + translate([m2_location[0], m2_location[1], case_origin[2]]) vent_rectangular(m2_size, 10, 2.0); + + // Put in a vent for the radiator for AIO cooling + if (heatsink_type == "aio") { + translate(case_origin) translate(corsair_h60_location) translate([corsair_h60_size[0]+wall, corsair_h60_size[1]/2-corsair_h60_fan_offset, corsair_h60_fan[0]/2]) { + rotate([0, 90, 0]) { + fan_cutout(corsair_h60_fan[0]); + } + } + } else { + // Otherwise put in a regular case fan vent + translate(case_origin) translate([case_fan_location[0]+case_fan_thickness+wall, case_fan_location[1], case_fan_location[2]]) { + rotate([0, 90, 0]) { + fan_cutout(case_fan_size); + } + } + } + + if (psu_type == "sfx" || psu_type == "sfx_l") { + translate(psu_location) { + sfx_cutout(); + } + + // Put in vents on the back wall to improve airflow + back_panel_vent_v = [sfx_size[2], motherboard_back_panel_size[0]-sfx_size[1]]; + translate(psu_location) translate([0, -back_panel_vent_v[1]/2+wall, back_panel_vent_v[0]/2-wall]) { + rotate([0, 90, 0]) vent_rectangular(back_panel_vent_v, 10, 2.0); + } + + back_panel_vent_h = [case_size[2]-sfx_size[2]-wall*3-motherboard_back_panel_size[1]-microatx_bottom_keepout, motherboard_back_panel_size[0]]; + translate(psu_location) translate([0, sfx_size[1]-back_panel_vent_h[1]/2+wall, -back_panel_vent_h[0]/2]) { + rotate([0, 90, 0]) vent_rectangular(back_panel_vent_h, 10, 2.0); + } + + } else { + translate(psu_location) { + flexatx_cutout(true); + } + + translate(case_origin) translate([case_exhaust_fan_location[0]-wall, case_exhaust_fan_location[1], case_exhaust_fan_location[2]]) { + rotate([0, -90, 0]) { + fan_cutout(case_exhaust_fan_size); + } + } + } + + // @todecide: split this into generic card-slot cutouts and gpu-cutout + translate(gpu_location) { + if ( gpu_type == "zotac_1080_mini" ) { + zotac_1080_mini_cutout(); + } else if ( gpu_type == "accelero_970" ) { + accelero_970_cutout(); + } else if (gpu_type == "gt730_1g" ) { + gt730_1G_cutout(); + } + pci_bracket_holder_cutout(); + // todo: add side fan to compensate for larger distance to case + } + + translate(power_switch_location) { + rotate([0, 90, 0]) power_switch_cutout(); + } + + translate(dual_usb_location) { + rotate([-90, 0, 0]) rotate([0, 0, 90]) dual_usb_cutout(); + } + + // Prevent corner lift by angling the bottom corners + translate(case_origin) { + rotate([0, 0, -45]) rotate([45, 0, 0]) cube([wall*3, wall*2, wall*2], center = true); + translate([case_size[0], 0, 0]) rotate([0, 0, 45]) rotate([45, 0, 0]) cube([wall*3, wall*2, wall*2], center = true); + translate([case_size[0], case_size[1], 0]) rotate([0, 0, 135]) rotate([45, 0, 0]) cube([wall*3, wall*2, wall*2], center = true); + translate([0, case_size[1], 0]) rotate([0, 0, -135]) rotate([45, 0, 0]) cube([wall*3, wall*2, wall*2], center = true); + } + } + } +} + +module traditional_tower_cooler(gpu_type) { + motherboard_microatx(false, microatx_am4_holes, am4_socket); + + translate([microatx_am4_holes[0], microatx_am4_holes[1], am4_socket[2]+microatx[2]]) noctua_nh_u9s(); + + translate([0, microatx[1]-flexatx_size[2], flexatx_size[1]+microatx[2]+45]) rotate([-90, 0, 0]) { + flexatx(); + } + + translate([microatx_pci_e_offset_0[0]+15, microatx_pci_e_offset_0[1]+4, microatx_pci_e_offset_0[2]+microatx[2]]) { + if ( gpu_type == "zotac_1080_mini" ) { + zotac_1080_mini(); + } else if ( gpu_type == "accelero_970" ) { + accelero_970(); + } else if (gpu_type == "gt730_1g" ) { + gt730_1G(); + } + } +} + +//traditional(show_body = true, show_lid = false, show_internals = true, heatsink_type = "noctua_nh_l12s", psu_type = "sfx_l"); +traditional(show_body = true, show_lid = false, show_internals = true, heatsink_type = "bequiet_shadowrock_lp", psu_type = "sfx", gpu_type = "gt730_1g"); +//traditional(show_body = true, show_lid = false, show_internals = true, heatsink_type = "aio", psu_type = "sfx"); + +translate ([300, -300, 0]){ traditional_tower_cooler(gpu_type = "zotac_1080_mini"); }; diff --git a/mini-itx.scad b/mini-itx.scad index 215cd4c..b3d08c7 100644 --- a/mini-itx.scad +++ b/mini-itx.scad @@ -30,7 +30,7 @@ module motherboard_standoff() { module motherboard_standoffs_miniitx() { $fn = 50; - + // Mounting holes for the motherboard translate([miniitx_hole_c[0], miniitx_hole_c[1], 0]) { motherboard_standoff(); @@ -62,7 +62,7 @@ module psu_corner_ledge() { module cable_wrap_holder() { wrap_width = 15; - + difference () { translate([wall, -wall-wrap_width/2, 0]) { cube([wall, wall*2+wrap_width, wall*2]); @@ -78,9 +78,9 @@ module cable_wrap_holder() { // The tab that the pci bracket screws into module pci_bracket_holder() { tab_depth = 11.43; - + bottom_wall = 1.0; - + translate(pci_e_to_bracket) { difference() { // The body of the tab @@ -93,9 +93,9 @@ module pci_bracket_holder() { module pci_bracket_holder_cutout() { $fn = 20; - + bottom_wall = 1.0; - + translate(pci_e_to_bracket) { // Cut out the holes for the threaded insert and the bolt translate([0, 0, -insert_h]) { @@ -118,67 +118,70 @@ module top_lid(size) { module back_to_back() { motherboard_miniitx(false, am4_holes, am4_socket); - + translate([am4_holes[0], am4_holes[1], am4_socket[2]+miniitx[2]]) cryorig_c7(); translate([0, miniitx[1]-flexatx_size[2], -miniitx_bottom_keepout-wall]) { rotate([-90, 0, 0]) flexatx(); } - translate([pci_e_offset[0], pci_e_offset[1]+100, -40]) { + translate([miniitx_pci_e_offset[0], miniitx_pci_e_offset[1]+100, -40]) { rotate([90, 0, 0]) zotac_1080_mini(); } } -module traditional(show_body, show_lid, show_internals, heatsink_type, psu_type) { +module traditional(show_body, show_lid, show_internals, heatsink_type, psu_type, gpu_type) { // Airflow clearance for CPU fan cpu_fan_clearance = 5; heatsink_height = heatsink_height(heatsink_type); psu_size = psu_size(psu_type); + // Extra height for cable clearance for 8-pin connectors on the top of the card gpu_power_height = 5; + gpu_size = gpu_size(gpu_type); + // FIXME: gpu thickness doesn't account for bracket width - gpu_location = [pci_e_offset[0], pci_e_offset[1], pci_e_offset[2]+miniitx[2]]; - case_origin = [motherboard_back_edge-wall, -zotac_1080_thickness-wall+pci_e_offset[1]+3, -miniitx_bottom_keepout-wall]; // TODO: Clean up the Y calculation - + gpu_location = [miniitx_pci_e_offset[0], miniitx_pci_e_offset[1], miniitx_pci_e_offset[2]+miniitx[2]]; + case_origin = [miniitx_motherboard_back_edge-wall, -gpu_size[2]-wall+miniitx_pci_e_offset[1]+3, -miniitx_bottom_keepout-wall]; // TODO: Clean up the Y calculation + m2_size = [110, 22+10]; m2_location = [miniitx[0]/2, 30]; // Note that this should be adjusted to match the mobo used - + case_fan_size = 140; case_fan_thickness = 25; case_exhaust_fan_size = 80; case_exhaust_fan_thickness = 15; - + // Figure out the stacked heights of the tallest components to use for case height psu_heatsink_stack = -case_origin[2]+miniitx[2]+am4_socket[2]+heatsink_height+cpu_fan_clearance+psu_size[2]+wall; - gpu_stack = -case_origin[2]+wall+pci_e_offset[2]+miniitx[2]+pci_e_cutout_height+zotac_1080_mini_pcb[1]+gpu_power_height; - + gpu_stack = -case_origin[2]+wall+miniitx_pci_e_offset[2]+miniitx[2]+pci_e_cutout_height+gpu_size[1]+gpu_power_height; + // Figure out the stacked lengths of the longest components to use for case length - miniitx_cooling_length = -motherboard_back_edge+wall*3+miniitx[0]+(heatsink_type == "aio" ? corsair_h60_size[0] : case_fan_thickness); - gpu_length = zotac_1080_mini_length+wall*3; // Note the extra wall length for assembly margin - - case_size = [max(miniitx_cooling_length, gpu_length), miniitx[1]-case_origin[1]+motherboard_back_panel_overhang+motherboard_back_panel_lip, max(psu_heatsink_stack, gpu_stack)]; - - psu_location = [motherboard_back_edge, case_origin[1]+case_size[1]-psu_size[1]-wall-wall/4, case_origin[2]+case_size[2]-psu_size[2]-wall]; - + miniitx_cooling_length = -miniitx_motherboard_back_edge+wall*3+miniitx[0]+(heatsink_type == "aio" ? corsair_h60_size[0] : case_fan_thickness); + gpu_length = gpu_size[0]+wall*3; // Note the extra wall length for assembly margin + + case_size = [max(miniitx_cooling_length, gpu_length), miniitx[1]-case_origin[1]+miniitx_motherboard_back_panel_overhang+motherboard_back_panel_lip, max(psu_heatsink_stack, gpu_stack)]; + + psu_location = [miniitx_motherboard_back_edge, case_origin[1]+case_size[1]-psu_size[1]-wall-wall/4, case_origin[2]+case_size[2]-psu_size[2]-wall]; + cable_wrap_location = [psu_location[0] + psu_size[0] + (case_size[0] - psu_size[0])/3, case_origin[1]+case_size[1]-wall, case_origin[2]+case_size[2]-psu_size[2]-wall]; - + case_fan_location = [case_size[0]-wall-case_fan_thickness, (case_fan_size >= 120) ? case_size[1]/2-case_origin[1]/2 : case_size[1]/2, case_fan_size/2+wall*2]; case_exhaust_fan_location = [wall, case_size[1]-psu_size[1]-case_exhaust_fan_size/2-wall, case_size[2]-case_exhaust_fan_size/2-wall]; - + power_switch_location = [case_origin[0]+case_size[0], case_origin[1]+power_switch_r+wall*2.5, case_origin[2]+power_switch_r+wall*2.5]; dual_usb_location = [case_origin[0]+case_size[0]-wall, case_origin[1]+case_size[1]-wall-dual_usb_size[2]-0.5, case_origin[2]+case_size[2]/2]; - + // Calculate the case size in liters case_volume = case_size[0]*case_size[1]*case_size[2]/1000000.0; echo("Case dimensions X:", case_size[0], " Y:", case_size[1], " Z:", case_size[2], " L:", case_volume); - + corsair_h60_location = [case_size[0]-wall-corsair_h60_size[0], case_size[1]-wall*2-corsair_h60_size[1], case_size[2]-wall*2-corsair_h60_size[2]]; - + // Using the bottom corner of the motherboard near the GPU as the origin if (show_internals == true) { motherboard_miniitx(true, am4_holes, am4_socket); - + translate([am4_holes[0], am4_holes[1], am4_socket[2]+miniitx[2]]) { heatsink_type(heatsink_type); } @@ -194,9 +197,15 @@ module traditional(show_body, show_lid, show_internals, heatsink_type, psu_type) } translate(gpu_location) { - zotac_1080_mini(); + if ( gpu_type == "zotac_1080_mini" ) { + zotac_1080_mini(); + } else if ( gpu_type == "accelero_970" ) { + accelero_970(); + } else if (gpu_type == "gt730_1g" ) { + gt730_1G(); + } } - + translate(case_origin) { // Put into place a radiator for AIO cooling if (heatsink_type == "aio") { @@ -210,30 +219,30 @@ module traditional(show_body, show_lid, show_internals, heatsink_type, psu_type) } } } - + translate(power_switch_location) { rotate([0, 90, 0]) power_switch(); } - + translate(dual_usb_location) { rotate([-90, 0, 0]) rotate([0, 0, 90]) dual_usb(); } } - + // Make the lid separately so it can be printed on its own if (show_lid == true) color("WhiteSmoke", 0.5) { translate(case_origin) { translate([0, wall, case_size[2]-wall]) top_lid([case_size[0]-wall, case_size[1]-wall*2]); } } - + // The actual case if (show_body == true) color("WhiteSmoke", 0.5) { // Motherboard standoffs taking threaded inserts translate([0, 0, -miniitx_bottom_keepout]) { - motherboard_standoffs_miniitx(); + motherboard_standoffs_miniitx(); } - + // Part that the GPU screws into translate(gpu_location) { difference() { @@ -241,13 +250,13 @@ module traditional(show_body, show_lid, show_internals, heatsink_type, psu_type) pci_bracket_holder_cutout(); } } - + // Attach ledges to the walls to help hold up the PSU translate(psu_location) { translate([psu_size[0], psu_size[1], 0]) psu_ledge(); translate([0, psu_size[1], 0]) rotate([0, 0, -90]) psu_corner_ledge(); } - + // Put some cable wrap holders on the wall near the PSU translate(cable_wrap_location) { rotate([0, 0, -90]) { @@ -255,7 +264,7 @@ module traditional(show_body, show_lid, show_internals, heatsink_type, psu_type) translate([0, 0, psu_size[2]-wall*4]) cable_wrap_holder(); } } - + difference() { // Body of the case translate(case_origin) { @@ -268,7 +277,7 @@ module traditional(show_body, show_lid, show_internals, heatsink_type, psu_type) } } } - + translate(case_origin) { translate([8, 0.2, 8]) { rotate([90, 0, 0]) linear_extrude(wall) { @@ -276,12 +285,12 @@ module traditional(show_body, show_lid, show_internals, heatsink_type, psu_type) } } } - + motherboard_back_panel_cutout(); - + // Put a vent in the bottom for a typical M.2 SSD location. translate([m2_location[0], m2_location[1], case_origin[2]]) vent_rectangular(m2_size, 10, 2.0); - + // Put in a vent for the radiator for AIO cooling if (heatsink_type == "aio") { translate(case_origin) translate(corsair_h60_location) translate([corsair_h60_size[0]+wall, corsair_h60_size[1]/2-corsair_h60_fan_offset, corsair_h60_fan[0]/2]) { @@ -297,48 +306,56 @@ module traditional(show_body, show_lid, show_internals, heatsink_type, psu_type) } } } - + if (psu_type == "sfx" || psu_type == "sfx_l") { translate(psu_location) { sfx_cutout(); } - + // Put in vents on the back wall to improve airflow - back_panel_vent_v = [sfx_size[2], case_size[1]-zotac_1080_thickness-sfx_size[1]-wall*3]; + back_panel_vent_v = [sfx_size[2], case_size[1]-gpu_size[2]-sfx_size[1]-wall*3]; translate(psu_location) translate([0, -back_panel_vent_v[1]/2+wall, back_panel_vent_v[0]/2-wall]) { rotate([0, 90, 0]) vent_rectangular(back_panel_vent_v, 10, 2.0); } - - back_panel_vent_h = [case_size[2]-sfx_size[2]-wall*3-motherboard_back_panel_size[1]-miniitx_bottom_keepout, case_size[1]-zotac_1080_thickness-wall*2]; + + back_panel_vent_h = [case_size[2]-sfx_size[2]-wall*3-motherboard_back_panel_size[1]-miniitx_bottom_keepout, case_size[1]-gpu_size[2]-wall*2]; translate(psu_location) translate([0, sfx_size[1]-back_panel_vent_h[1]/2+wall, -back_panel_vent_h[0]/2]) { rotate([0, 90, 0]) vent_rectangular(back_panel_vent_h, 10, 2.0); } - + + } else { translate(psu_location) { flexatx_cutout(true); } - + translate(case_origin) translate([case_exhaust_fan_location[0]-wall, case_exhaust_fan_location[1], case_exhaust_fan_location[2]]) { rotate([0, -90, 0]) { fan_cutout(case_exhaust_fan_size); } } } - + translate(gpu_location) { - zotac_1080_mini_cutout(); + if ( gpu_type == "zotac_1080_mini" ) { + zotac_1080_mini_cutout(); + } else if ( gpu_type == "accelero_970" ) { + accelero_970_cutout(); + } else if (gpu_type == "gt730_1g" ) { + gt730_1G_cutout(); + } pci_bracket_holder_cutout(); } - + + // @todo: this could use some positioning love, too translate(power_switch_location) { rotate([0, 90, 0]) power_switch_cutout(); } - + translate(dual_usb_location) { rotate([-90, 0, 0]) rotate([0, 0, 90]) dual_usb_cutout(); } - + // Prevent corner lift by angling the bottom corners translate(case_origin) { rotate([0, 0, -45]) rotate([45, 0, 0]) cube([wall*3, wall*2, wall*2], center = true); @@ -352,17 +369,17 @@ module traditional(show_body, show_lid, show_internals, heatsink_type, psu_type) module traditional_tower_cooler() { motherboard_miniitx(false, am4_holes, am4_socket); - + translate([am4_holes[0], am4_holes[1], am4_socket[2]+miniitx[2]]) noctua_nh_u9s(); translate([0, miniitx[1]-flexatx_size[2], flexatx_size[1]+miniitx[2]+45]) rotate([-90, 0, 0]) { flexatx(); } - translate([pci_e_offset[0], pci_e_offset[1], pci_e_offset[2]+miniitx[2]]) { + translate([miniitx_pci_e_offset[0], miniitx_pci_e_offset[1], miniitx_pci_e_offset[2]+miniitx[2]]) { zotac_1080_mini(); } } -traditional(show_body = true, show_lid = false, show_internals = false, heatsink_type = "noctua_nh_l12s", psu_type = "sfx"); -//traditional(show_body = true, show_lid = false, show_internals = true, heatsink_type = "aio", psu_type = "sfx"); +traditional(show_body = true, show_lid = false, show_internals = true, heatsink_type = "noctua_nh_l12s", psu_type = "sfx", gpu_type = "zotac_1080_mini"); +//traditional(show_body = true, show_lid = false, show_internals = true, heatsink_type = "aio", psu_type = "sfx_l", gpu_type = "gt730_1g"); diff --git a/motherboard.scad b/motherboard.scad index 04885f6..b5d473c 100644 --- a/motherboard.scad +++ b/motherboard.scad @@ -12,7 +12,7 @@ include ; miniitx = [170, 170, pcb_thickness]; // Motherboard mounting hold diameter and offsets (relative to hole c) -miniitx_hole = 3.96; +mounting_hole = 3.96; miniitx_hole_c = [10.16, 6.35]; miniitx_hole_f = [22.86, 157.48]; miniitx_hole_h = [154.94, 0]; @@ -26,7 +26,7 @@ am4_holes = [80, 95, 54, 90]; // Center not measured am4_socket = [40, 40, 7.35]; // Not measured // Offset from origin corner of motherboard to the base of the PCI-e card -pci_e_offset = [46.94+10.16, 47.29-45.72+6.35, 114.55-111.15]; +miniitx_pci_e_offset = [46.94+10.16, 47.29-45.72+6.35, 114.55-111.15]; module motherboard_miniitx(show_keepouts, socket_holes, socket) { area_a_keepout = [27, 15, 170-27-30, 170-15, 57]; @@ -34,7 +34,7 @@ module motherboard_miniitx(show_keepouts, socket_holes, socket) { area_c_keepout = [170-30, 15, 30, 170-15, 38]; area_d_keepout = [0, 15, 27, 170-15, 39]; $fn = 20; - + difference() { union() { // The PCB @@ -47,57 +47,183 @@ module motherboard_miniitx(show_keepouts, socket_holes, socket) { } } } - + // Mounting holes for the motherboard translate([miniitx_hole_c[0], miniitx_hole_c[1], -extra/2]) { - cylinder(r = miniitx_hole/2, h = miniitx[2]+extra); + cylinder(r = mounting_hole/2, h = miniitx[2]+extra); for (hole = [miniitx_hole_f, miniitx_hole_h, miniitx_hole_j]) { - translate([hole[0], hole[1], 0]) cylinder(r = miniitx_hole/2, h = miniitx[2]+extra); + translate([hole[0], hole[1], 0]) cylinder(r = mounting_hole/2, h = miniitx[2]+extra); } } - + // Mounting holes for the CPU cooler translate([socket_holes[0], socket_holes[1], -extra/2]) { for (i = [-socket_holes[2]/2, socket_holes[2]/2]) { for (j = [-socket_holes[3]/2, socket_holes[3]/2]) { - translate([i, j, 0]) cylinder(r = miniitx_hole/2, h = miniitx[2]+extra); + translate([i, j, 0]) cylinder(r = mounting_hole/2, h = miniitx[2]+extra); } } } } - + // PCI-e slot color("DarkSlateGray", 1.0) { - translate([pci_e_offset[0]-14.5, pci_e_offset[1]-7.5/2, miniitx[2]]) cube([89.0, 7.5, 11.25]); + translate([miniitx_pci_e_offset[0]-14.5, miniitx_pci_e_offset[1]-7.5/2, miniitx[2]]) cube([89.0, 7.5, 11.25]); } - + // Keepouts for visualization purposes - color("GreenYellow", 0.25) { - if (show_keepouts == true) { - translate([0, 0, -miniitx_bottom_keepout]) cube([miniitx[0], miniitx[1], miniitx_bottom_keepout]); - - for (keepout = [area_a_keepout, area_b_keepout, area_c_keepout, area_d_keepout]) { - translate([keepout[0], keepout[1], miniitx[2]]) { - cube([keepout[2], keepout[3], keepout[4]]); + /* color("GreenYellow", 0.25) { */ + /* if (show_keepouts == true) { */ + /* translate([0, 0, -miniitx_bottom_keepout]) cube([miniitx[0], miniitx[1], miniitx_bottom_keepout]); */ + + /* for (keepout = [area_a_keepout, area_b_keepout, area_c_keepout, area_d_keepout]) { */ + /* translate([keepout[0], keepout[1], miniitx[2]]) { */ + /* cube([keepout[2], keepout[3], keepout[4]]); */ + /* } */ + /* } */ + /* } */ + /* } */ + +} + +miniitx_motherboard_back_edge = miniitx_hole_c[0]-12.27; +// value for the conncetor I/O, sticking over the edge of the board +miniitx_motherboard_back_panel_overhang = 158.75+7.52+6.35-miniitx[1]; +motherboard_back_panel_lip = 2.54; +motherboard_back_panel_size = [158.75, 44.45]; + +module motherboard_back_panel_cutout() { + // Cut-out for the back panel i/o + translate([-extra/2+miniitx_motherboard_back_edge-wall, miniitx_hole_c[1]+7.52, -2.24]) { + cube([extra/2+wall+miniitx_motherboard_back_edge+39, motherboard_back_panel_size[0], motherboard_back_panel_size[1]]); + // Thin a 2.54mm area around the i/o down to a typical sheet metal thickness + translate([0, -motherboard_back_panel_lip, -motherboard_back_panel_lip]) cube([extra/2+wall-1.2, 158.75+motherboard_back_panel_lip*2, 44.45+motherboard_back_panel_lip*2]); + } +} + +// --------------- +// micro ATX stuff +// --------------- +microatx = [243.84, 243.84, pcb_thickness]; + +// microATX Motherboard mounting hole offsets (relative to hole b) +microatx_hole_b = [10.16, 34.29]; +microatx_hole_c = [0, 45.72]; +microatx_hole_d = [22.86, 203.3]; +microatx_hole_e = [154.94, -20.32]; +microatx_hole_f = [154.94, 0]; +microatx_hole_g = [154.94, 45.72]; +microatx_hole_h = [154.94, 203.3]; +microatx_hole_i = [227.33, 45.72 ]; +microatx_hole_j = [227.33, 203.3]; + +microatx_pci_e_baseoffset = [46.94+10.16, 80.01-18.75+20.23-(7.5/2), pcb_thickness]; + +microatx_pci_e_offset_0 = [microatx_pci_e_baseoffset[0]-14.5, microatx_pci_e_baseoffset[1], microatx_pci_e_baseoffset[2]]; +microatx_pci_e_offset_1 = [microatx_pci_e_baseoffset[0]-14.5, microatx_pci_e_baseoffset[1]-20.32, microatx_pci_e_offset_0[2]]; +microatx_pci_e_offset_2 = [microatx_pci_e_baseoffset[0]-14.5, microatx_pci_e_baseoffset[1]-(2*20.32), microatx_pci_e_offset_1[2]]; +microatx_pci_e_offset_3 = [microatx_pci_e_baseoffset[0]-14.5, microatx_pci_e_baseoffset[1]-(3*20.32), microatx_pci_e_offset_2[2]]; + +// positions to use for PCI_express card placement +microatx_pci_e_position_0 = [microatx_pci_e_offset_0[0]+14.5, microatx_pci_e_offset_0[1]+(7.5/2), microatx[2]+pcb_thickness*2]; +microatx_pci_e_position_1 = [microatx_pci_e_offset_1[0]+14.5, microatx_pci_e_offset_1[1]+(7.5/2), microatx[2]+pcb_thickness*2]; +microatx_pci_e_position_2 = [microatx_pci_e_offset_2[0]+14.5, microatx_pci_e_offset_2[1]+(7.5/2), microatx[2]+pcb_thickness*2]; +microatx_pci_e_position_3 = [microatx_pci_e_offset_3[0]+14.5, microatx_pci_e_offset_3[1]+(7.5/2), microatx[2]+pcb_thickness*2]; + +// AM4 Socket specs +microatx_am4_holes = [80+20, 95+70, 54, 90]; // Center not measured +microatx_am4_socket = [40, 40, 7.35]; // Not measured + +// Keepouts on top and bottom of board +microatx_bottom_keepout = 0.25 * 25.4; + +module motherboard_microatx(show_keepouts, socket_holes, socket) { + // @todo: rework these --psy + area_a_keepout = [33, 84, 170-33, 244-84, 80]; + area_b_keepout = [0, 0, 244, 84, 16]; + area_c_keepout = [170, 84, 237.49-165.10,237.49 -80.49, 38.1]; + area_d_keepout = [0, 84, 45, 244-84, 39]; + $fn = 20; + + difference() { + union() { + // The PCB + color("Green", 1.0) { + cube(microatx); + } + // @todo: verify socket positon --psy + // @todo: needs to be more positiv x + translate([socket_holes[0]-socket[0]/2, socket_holes[1]-socket[1]/2, microatx[2]]) { + color("OldLace", 1.0) { + cube(socket); } } } + + // Mounting holes for the motherboard + translate([microatx_hole_b[0], microatx_hole_b[1], -extra/2]) { + cylinder(r = mounting_hole/2, h = microatx[2]+extra); + for (hole = [microatx_hole_c, microatx_hole_d, microatx_hole_e, microatx_hole_f, microatx_hole_g, microatx_hole_h, microatx_hole_i, microatx_hole_j]) { + translate([hole[0], hole[1], 0]) cylinder(r = mounting_hole/2, h = miniitx[2]+extra); + } + } + + //Mounting holes for the CPU cooler + translate([socket_holes[0], socket_holes[1]+70, -extra/2]) { + for (i = [-socket_holes[2]/2, socket_holes[2]/2]) { + for (j = [-socket_holes[3]/2, socket_holes[3]/2]) { + translate([i, j, 0]) cylinder(r = mounting_hole/2, h = microatx[2]+extra); + } + } + } } + + // PCI-e slot + union() { + color("DarkSlateGray", 1.0) { + translate(microatx_pci_e_offset_0) cube([89.0, 7.5, 11.25]); + translate(microatx_pci_e_offset_1) cube([39.0, 7.5, 11.25]); + translate(microatx_pci_e_offset_2) cube([39.0, 7.5, 11.25]); + translate(microatx_pci_e_offset_3) cube([89.0, 7.5, 11.25]); + } + } + + // Keepouts for visualization purposes + /* color("GreenYellow", 0.25) { */ + /* if (show_keepouts == true) { */ + /* translate([0, 0, -microatx_bottom_keepout]) cube([microatx[0], microatx[1], microatx_bottom_keepout]); */ + + /* for (keepout = [area_a_keepout, area_b_keepout, area_c_keepout, area_d_keepout]) { */ + /* translate([keepout[0], keepout[1], miniitx[2]]) { */ + /* cube([keepout[2], keepout[3], keepout[4]]); */ + /* } */ + /* } */ + /* } */ + /* } */ } -motherboard_back_edge = miniitx_hole_c[0]-12.27; -motherboard_back_panel_overhang = 158.75+7.52+6.35-miniitx[1]; -motherboard_back_panel_lip = 2.54; -motherboard_back_panel_size = [158.75, 44.45]; +microatx_motherboard_back_edge = microatx_hole_b[0]-12.27; +microatx_motherboard_back_panel_overhang = 34.29+53.24+158.75-microatx[1]; // 172.62-170 -module motherboard_back_panel_cutout() { +module motherboard_microatx_back_panel_cutout() { // Cut-out for the back panel i/o - translate([-extra/2+motherboard_back_edge-wall, miniitx_hole_c[1]+7.52, -2.24]) { - cube([extra/2+wall+motherboard_back_edge+39, motherboard_back_panel_size[0], motherboard_back_panel_size[1]]); + translate([-extra/2+microatx_motherboard_back_edge-wall, microatx_hole_b[1] + 53.5, -2.24]) { + cube([extra/2+wall+microatx_motherboard_back_edge+39, motherboard_back_panel_size[0], motherboard_back_panel_size[1]]); // Thin a 2.54mm area around the i/o down to a typical sheet metal thickness translate([0, -motherboard_back_panel_lip, -motherboard_back_panel_lip]) cube([extra/2+wall-1.2, 158.75+motherboard_back_panel_lip*2, 44.45+motherboard_back_panel_lip*2]); } } -//motherboard_miniitx(false, am4_holes, am4_socket); -//% motherboard_back_panel_cutout(); +//--------------- + +/* union() { */ +/* motherboard_miniitx(true, am4_holes, am4_socket); */ +/* //motherboard_back_panel_cutout(); */ +/* } */ + +/* union() { */ +/* translate([0, -250, 0]) { */ +/* motherboard_microatx(true, microatx_am4_holes, am4_socket); */ +/* //motherboard_microatx_back_panel_cutout(); */ +/* } */ +/* } */