include BASE_MODEL_SCALE = [1.1, 1, 1.1]; BASE_MODEL_TRANSLATE = [-0.4, 0, 16.978]; EPS = 0.01; $fn = 50; module main_display() { // Outer dimensions, height currently unknown cube([55.04, 89.3, 10]); } module pad() { // A button has 4.2 x 6 mm -> At least ~20x20 are required for the PCB cube([20, 20, 10]); } module secondary_display(pin_header = false) { // https://de.aliexpress.com/item/1005003753680706.html length = 45.8; width = 20; height = 3.7; pins_height = 11.3; pins_width = 2.5; // width of socket, not pin hole_diameter = 2; hole_inset = 1.5; difference() { cube([length, width, height]) if (pin_header) position(LEFT + FRONT) cube([pins_width, width, pins_height]); move([length - hole_inset, width / 2, height / 2]) ycopies(width - (2 * hole_inset) - hole_diameter) { cyl(d=hole_diameter, h=height + EPS, orient=UP, anchor=RIGHT); } } } module tertiary_display() { // https://de.aliexpress.com/item/1005006034531826.html cube([80, 36, 10]); } module battery(anchor = BOTTOM) { // 18650 rotate([0, 90, 0]) cylinder(d=18, h=65, anchor=anchor); } /// USB-C port and switch not 100% dimensionally accurate, take care! module micro_controller(battery_holder = false, battery = false) { pcb_length = 91.5; pcb_height = 6.5; // including components, highest point: jst connector, followed by uC pcb_height_no_components = 1.1; pcb_width = 28.8; hole_diameter = 2.5; hole_inset = 1; usb_protrusion = 1.7; usb_width = 9; usb_inset_from_pcb_end = 5; power_switch_protrusion = 2.1; power_switch_inset_from_pcb_end = 8.1; power_switch_width = 4; battery_holder_height = 15; battery_holder_width = 21; battery_holder_length = 77.3; battery_length = 65; battery_protrusion = 4.5; difference() { cuboid([pcb_length, pcb_width, pcb_height], rounding=2, edges="Z") { if (battery_holder) position(TOP) cube([battery_holder_length, battery_holder_width, battery_holder_height], anchor=BOTTOM + CENTER) { if (battery) position(TOP) up(battery_protrusion) battery(anchor=CENTER + LEFT); } position(RIGHT + BOTTOM) { position(FRONT) left(usb_inset_from_pcb_end) cube([usb_width, usb_protrusion, pcb_height - pcb_height_no_components], orient=FRONT, anchor=RIGHT + BOTTOM + FRONT); position(BACK) left(power_switch_inset_from_pcb_end) cube([power_switch_width, power_switch_protrusion, pcb_height - pcb_height_no_components], orient=FRONT, anchor=RIGHT + TOP + FRONT); } } xcopies(pcb_length - (2 * hole_inset) - hole_diameter) { ycopies(pcb_width - (2 * hole_inset) - hole_diameter) { cyl(d=hole_diameter, h=pcb_height + EPS, orient=UP); } } } }