use use tol = 2; module panel_front(pcb_dim, margins, t) { dim = dim_pcb_to_case(pcb_dim, margins, t); x_off = dim[0]-2*t; difference() { pcb_case_panel_front(pcb_dim, margins, t); mini_hdmi_hole(pcb_dim, margins, t); for(v=[ [usb_max_y-usb_max_delta_y-tol/2, 0.75*t], [usb_max_y-usb_delta_y-tol/2, t] ]) { translate([0, v[0], 0]) { micro_usb_hole(pcb_dim, margins, t, v[1]); } } for(y = [cinch_min_y+0.5*cinch_d, cinch_min_y+1.5*cinch_d+cinch_delta_y]) { translate([0, y, 0]) { cinch_hole(pcb_dim, margins, t); } } } } hdmi_delta_y = 11.8; hdmi_delta_z = 3.9; hdmi_max_y = 31.7; hdmi_max_z = 13.7; module mini_hdmi_hole(pcb_dim, margins, t) { case_dim = dim_pcb_to_case(pcb_dim, margins, t); translate([ case_dim[0]-2*t, hdmi_max_y-hdmi_delta_y-tol/2, hdmi_max_z-hdmi_delta_z-tol/2]) { cube([t, hdmi_delta_y+tol, hdmi_delta_z+tol]); } } usb_delta_y = 8; usb_max_delta_y = 20.6; usb_delta_z = 3; usb_max_y = 71.55; usb_max_z = 12.7; module micro_usb_hole(pcb_dim, margins, t, dx) { echo(dx); case_dim = dim_pcb_to_case(pcb_dim, margins, t); translate([ case_dim[0]-2*t, 0, usb_max_z-usb_delta_z-tol/2]) { cube([dx, usb_delta_y+tol, usb_delta_z+tol]); } } cinch_d = 8.3; cinch_min_y = 45; cinch_delta_y = 8.2; cinch_max_z = 34.25; module cinch_hole(pcb_dim, margins, t) { case_dim = dim_pcb_to_case(pcb_dim, margins, t); translate([case_dim[0]-2*t, 0, cinch_max_z-cinch_d/2]) { rotate([0, 90, 0]) { cylinder(d=cinch_d+tol, h=t, $fn=30); } } }