Commit 5c8f7b5a authored by Julian Stirling's avatar Julian Stirling 🐧
Browse files

Merge branch 'electronics-drawer-cable-access' into 'master'

Give space for large hdmi and usb cable bodies

Closes #457 and #476

See merge request !548
parents f2298b68 6e9a071d
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
use <./libs/lib_microscope_stand.scad>

// PI_VERSION: 3 or 4
PI_VERSION = 4;
// SANGA_VERSION: "stack_11mm", "stack_8.5mm", "v0.3"
SANGA_VERSION = "stack_11mm";

electronics_drawer_stl(PI_VERSION, SANGA_VERSION);
+122 −35
Original line number Diff line number Diff line
@@ -673,10 +673,12 @@ module electronics_drawer_walls(stand_params){

    }
    if (pi_version==4 && block_usb){
        usb_c_blocker();
        oversize = usb_c_cut_oversize(h=1) - usb_c_cut_size(h=1);
        usb_c_blocker(oversize=oversize);
    }
    if (pi_version==3 && block_usb){
        micro_usb_blocker();
        oversize = micro_usb_cut_oversize(h=1) - micro_usb_cut_size(h=1);
        micro_usb_blocker(oversize=oversize);
    }
}

@@ -713,8 +715,8 @@ module sanga_connector_holes(sanga_version){
    sanga_connector_pos = [connector_x, 0, connector_z];
    translate(sanga_connector_pos){
        translate_y((wall_t-10)/2){
            cube([12, 10, 8], center=true);
            cube([10, 200, 4.5], center=true);
            cube(usb_c_cut_oversize(h=10), center=true);
            cube(usb_c_cut_size(h=200), center=true);
        }
    }
    if (sanga_version=="v0.3"){
@@ -818,11 +820,6 @@ module pi_connector_holes(pi_version){
        translate_y(-board_inset.y-tiny()){
            pi_side_connectors(pi_version);
        }
        hull(){
            translate_y(-(board_inset.y-1.5)){
                pi_side_connectors(pi_version);
            }
        }
    }
}

@@ -852,26 +849,102 @@ module pi_front_connectors(pi_version){
    }
}


/* return the size of a cut-out for a USB C connector

:param h: height of the box in the y-direction

:return: vector [10, h, 4.5]
*/
function usb_c_cut_size(h) = [10, h, 4.5];


/* return the size of a relief cut-out for the moulding of a USB C cable connector

USB-C does not specify the plug over mould except on right-angled plugs: 12.8 x 7 max
Set 13 x 8. Previously we used 12 x 8 for the Sangaboard USB connector relief.

:param h: height of the box in the y-direction

:return: vector [13, h, 8]
*/
function usb_c_cut_oversize(h) = [13, h, 8];


/* return the size of a cut-out for a micro USB connector

:param h: height of the box in the y-direction

:return: vector [9, h, 4.5]
*/
function micro_usb_cut_size(h) = [9, h, 4.5];


/* return the size of a relief cut-out for the moulding of a micro USB cable connector

:param h: height of the box in the y-direction

:return: vector [13, h, 8]
*/
function micro_usb_cut_oversize(h) = [13, h, 8];


module pi_side_connectors(pi_version){
    relief_depth = 1.5;
    h = 200;

    usb_c_size = usb_c_cut_size(h);
    usb_c_oversize = usb_c_cut_oversize(h);
    e_usb_c = usb_c_oversize - usb_c_size;

    micro_hdmi_size = [8, h, 4.5];
    // HDMI specifies type-D plug overmould as 2.9mm top and bottom, 2.6mm left and right
    // connector is 5.83 x 2.2mm, so maximum body is 11.03 x 8mm. In the wild connectors can be bigger.
    // Set 12.5 x 9.5
    micro_hdmi_oversize =  [12.5, h, 9.5];
    e_hdmi = micro_hdmi_oversize - micro_hdmi_size;

    micro_usb_size = micro_usb_cut_size(h);
    micro_usb_oversize = micro_usb_cut_oversize(h);
    e_m_usb = micro_usb_oversize - micro_usb_size;

    hdmi_size = [17, h, 7];
    hdmi_oversize = hdmi_size + [e_hdmi.x, 0, e_hdmi.z];

    if (pi_version==4){
        translate_x(11.2-10/2){
            cube([10, 200, 4.5]);
        translate_x(11.2-usb_c_size.x/2){
            cube(usb_c_size);
            translate([-e_usb_c.x/2,-h+relief_depth,-e_usb_c.z/2]){
                cube(usb_c_oversize);
            }
        }
        translate_x(26-8/2){
            cube([8, 200, 4.5]);
        translate_x(26-micro_hdmi_size.x/2){
            cube(micro_hdmi_size);
            translate([-e_hdmi.x/2, -h+relief_depth, -e_hdmi.z/2]){
                cube(micro_hdmi_oversize);
            }
        }
        translate_x(39.5-micro_hdmi_size.x/2){
            cube(micro_hdmi_size);
            translate([-e_hdmi.x/2, -h+relief_depth, -e_hdmi.z/2]){
                cube(micro_hdmi_oversize);
            }
        translate_x(39.5-8/2){
            cube([8, 200, 4.5]);
        }
    }
    else{
        // Micro USB power
        translate_x(10.6-9/2){
            cube([9, 200, 4.5]);
        translate_x(10.6-micro_usb_size.x/2){
            cube(micro_usb_size);
            translate([-e_m_usb.x/2, -h+relief_depth, -e_m_usb.z/2]){
                cube(micro_usb_oversize);
            }
        }
        // Full size HDMI
        translate_x(32-17/2){
            cube([17, 200, 7]);
        translate_x(32-hdmi_size.x/2){
            cube(hdmi_size);
            translate([-e_hdmi.x/2, -h+relief_depth, -e_hdmi.z/2]){
                cube(hdmi_oversize);
            }
        }

    }
@@ -884,40 +957,54 @@ module pi_side_connectors(pi_version){
                cylinder(d1=7, d2=8, h=5);
            }
        }
        // headphone relief
        translate([3.5, relief_depth, 3.5]){
                printable_horizontal_hole(h=5, r=10.5/2, extra_height=0);
        }
    }

}

module usb_c_blocker(){
    standoff_h = electronics_drawer_standoff_h();
module usb_c_blocker(oversize=[0,0,0]){
    oversize_x = oversize.x;
    oversize_z = oversize.z * 2/3;
    standoff_h = electronics_drawer_standoff_h() - oversize_z/2;
    usb_c_x_pos = 11.2 + electronics_drawer_board_inset().x;
    block_size = [8, 1, 3] + [oversize_x, 0 , oversize_z];
    // gap of 1 each side, and 0.5 overlap with body each side
    tie_width = block_size.x + 3;
    //Translate to bottom centre of hole
    translate([usb_c_x_pos, 0, standoff_h+1]){
        translate([-8/2, 0, .75]){
            cube([8, 1, 3]);
        translate([-block_size.x/2, 0, .75]){
            cube(block_size);
        }
        translate([-12/2, 0, .75]){
            cube([12, 1, 1]);
        translate([-tie_width/2, 0, .75]){
            cube([tie_width, 1, 1]);
        }
        translate([-12/2, 0, 2.75]){
            cube([12, 1, 1]);
        translate([-tie_width/2, 0, 2.75+oversize_z]){
            cube([tie_width, 1, 1]);
        }
    }
}

module micro_usb_blocker(){
    standoff_h = electronics_drawer_standoff_h();
module micro_usb_blocker(oversize=[0,0,0]){
    oversize_x = oversize.x;
    oversize_z = oversize.z * 2/3;
    standoff_h = electronics_drawer_standoff_h() - oversize_z/2;
    micro_usb_x_pos = 10.6 + electronics_drawer_board_inset().x;
    block_size = [7, 1, 3] + [oversize_x, 0 , oversize_z];
    // gap of 1 each side, and 0.5 overlap with body each side
    tie_width = block_size.x + 3;
    //Translate to bottom centre of hole
    translate([micro_usb_x_pos, 0, standoff_h+1]){
        translate([-7/2, 0, .75]){
            cube([7, 1, 3]);
        translate([-block_size.x/2, 0, .75]){
            cube(block_size);
        }
        translate([-12/2, 0, .75]){
            cube([12, 1, 1]);
        translate([-tie_width/2, 0, .75]){
            cube([tie_width, 1, 1]);
        }
        translate([-12/2, 0, 2.75]){
            cube([12, 1, 1]);
        translate([-tie_width/2, 0, 2.75+oversize_z]){
            cube([tie_width, 1, 1]);
        }
    }
}