From 28404f556a6f3cad5defa9bb79c989258fd2d29b Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 25 Mar 2022 13:59:04 +0000 Subject: maybe decent top layer --- enclosure/enclosure.scad | 53 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/enclosure/enclosure.scad b/enclosure/enclosure.scad index a1b7025..992b591 100644 --- a/enclosure/enclosure.scad +++ b/enclosure/enclosure.scad @@ -31,6 +31,9 @@ CO_Y=24.1; CO_Z=8; CO_CONN_Y=10; +CO_HOLE_DIAM=2; +CO_HOLE_DIST=CO_HOLE_DIAM + 2; // distance between hole centres + BOT_CABLE_WELL_X=15; // just some space for the battery & pm cables MID_CABLE_WELL_X=5; // just some space between co2 & board CABLE_HOLE_DIAM=12.5; @@ -40,13 +43,14 @@ MIDDLE_Z=WALL_THICKNESS + CO_Z; DISPLAY_WIN_X=51; DISPLAY_WIN_Y=26; -DISPLAY_OFF_X=16; -DISPLAY_OFF_Y=7; +DISPLAY_X_OFF=2.5; +DISPLAY_Y_OFF=6.1; //PITCH=0.254; don't really care BOARD_X=66.5; BOARD_Y=36.8; BOARD_SINK=2.2; +BOARD_PAD=2; BOARD_PIN_OFF_X=2.35; BOARD_PIN_DIST_X=61.43; BOARD_PIN_OFF_Y=2.15; BOARD_PIN_DIST_Y=32.5; @@ -81,7 +85,7 @@ BUTTON_Z=3; BUTTON_SINK=1; BUTTON_OFF_X=58; -TOP_LAYER_Z=10; +TOP_Z=2; TOTAL_X=2*WALL_THICKNESS + max( PM_X + BOT_CABLE_WELL_X + BATT_X, @@ -142,6 +146,19 @@ module co_sensor() { box([CO_X,CO_Y,CO_Z]); } +module co_hole() { + cylinder(h=200,d=CO_HOLE_DIAM,center=true,$fs=0.2); +} + +module co_holes() { + translate([-CO_X/2,-CO_Y/2,0]) + for( + x=[CO_HOLE_DIAM:CO_HOLE_DIST:CO_X], + y=[CO_HOLE_DIAM:CO_HOLE_DIST:CO_Y] + ) + translate([x,y,0]) co_hole(); +} + module middle_cable_well() { box([ 20, // doesn't matter, wells at both sides are much wider @@ -151,7 +168,7 @@ module middle_cable_well() { } module board_well() { - box([ BOARD_X, BOARD_Y, CO_Z]); + box([ BOARD_X+BOARD_PAD, BOARD_Y+BOARD_PAD, CO_Z]); } module board_support() { @@ -223,6 +240,10 @@ module outside_wells() { } } +module display_hole() { + cube([DISPLAY_WIN_X, DISPLAY_WIN_Y, 30], center=true); +} + module bottom() { PM_X_OFF=(TOTAL_X - PM_X)/2; @@ -242,17 +263,19 @@ module bottom() { } } +// used by middle and top +BOARD_X_OFF= (TOTAL_X-BOARD_X)/2 - CO_X - MID_CABLE_WELL_X - WALL_THICKNESS; +BOARD_Y_OFF= (TOTAL_Y-BOARD_Y)/2 - SD_Y - WALL_THICKNESS; +CO_X_OFF=(TOTAL_X - CO_X)/2 - WALL_THICKNESS; + module middle() { CABLE_HOLE_X_OFF= TOTAL_X/2 - PM_X - BOT_CABLE_WELL_X/2; CABLE_HOLE_Y_OFF= -PM_Y/2 + PM_CONN_Y/2; - CO_X_OFF=(TOTAL_X - CO_X)/2 - WALL_THICKNESS; CO_Z_OFF=MIDDLE_Z - CO_Z; CABLE_X_OFF= CO_X_OFF - CO_X/2 - MID_CABLE_WELL_X/2; - BOARD_X_OFF= (TOTAL_X-BOARD_X)/2 - CO_X - MID_CABLE_WELL_X - WALL_THICKNESS; - BOARD_Y_OFF= (TOTAL_Y-BOARD_Y)/2 - SD_Y - WALL_THICKNESS; BOARD_Z_OFF=MIDDLE_Z - BOARD_SINK; union() { @@ -271,6 +294,22 @@ module middle() { } } +module top() { + DISP_X_OFF=BOARD_X_OFF - (BOARD_X-DISPLAY_WIN_X)/2 + DISPLAY_X_OFF; + DISP_Y_OFF=BOARD_Y_OFF - (BOARD_Y-DISPLAY_WIN_Y)/2 + DISPLAY_Y_OFF; + + difference() { + box([TOTAL_X, TOTAL_Y, TOP_Z]); + screw_holes(); + translate([CO_X_OFF, 0, 0]) co_holes(); + translate([DISP_X_OFF, DISP_Y_OFF, 0]) display_hole(); + } +} + translate([0, TOTAL_Y * 1.2, 0]) bottom(); //translate([0, 0, -BOTTOM_Z-2]) bottom(); + middle(); + +translate([0, -TOTAL_Y * 1.2, 0]) top(); +//translate([0, 0, +MIDDLE_Z+2]) top(); -- cgit v1.2.3