// All dimensions are assumed to be given in millimeters width = 148; height = 68; depth = 2; function inches_to_mm(inches) = inches * 25.4; encoder_diameter = 7; keyboard_offset = 12.5; encoder_vertical_offset = 12; vertical_sep = 61; inner_diameter = inches_to_mm(0.12); display_width = inches_to_mm(3.8); display_height = inches_to_mm(2.6); display_inner_width = 86; display_inner_height = 2.2 * 25.4; display_offset = 21; switch_spacing = 12; key_offset = encoder_vertical_offset + 14; button_width = 5.5; difference() { cube([width, height, depth]); // Display window translate(v=[display_offset, (height - display_inner_height) / 2, -.1]){ cube([display_inner_width, display_inner_height, depth + .2]); } // Encoder translate(v=[width - keyboard_offset, height - encoder_vertical_offset, depth / 2]){ cylinder(h=depth + .2, d=encoder_diameter, center=true); } // Buttons for (i=[0:3]) { translate(v=[width - keyboard_offset, height - key_offset - i * switch_spacing, depth / 2]){ cube([button_width, button_width, depth + .2], center=true); } } }