Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- base_well_handwirehotswap_diode_lead_well_dims = [5.23875, 3.96875, 2.01]; // Dimensions of the well/hole to make room for the diode lead fastening.
- base_well_handwirehotswap_floor_thickness = 2; // Thick to make the "floor" beneath the socket.
- base_well_handwirehotswap_horizontal_connector_access_dims = [8, 6.5]; // Size of the hole to leave for horizontal connector access.
- base_well_handwirehotswap_socket_thickness = 3.5; // How much vertical space to allow for the socket.
- base_well_handwirehotswap_switch_dims = [14, 14, 5.4]; // Switch width, height, and depth.
- base_well_handwirehotswap_switch_latch_depth = 1.8; // How deep a notch to leave for the latch.
- base_well_handwirehotswap_switch_latch_overhang_angle = 45; // The angle of the overhang of the latch
- base_well_handwirehotswap_switch_latch_thickness = 1.4; // How thick the "plate" should be.
- base_well_handwirehotswap_switch_latch_width = 5; // How wide a notch to leave for the latch.
- stabilizer_base_through_front_gap = 4; // Gap between the front supports.
- stabilizer_base_through_grasp_gap_factor = 0.1; // Larger numbers increase the size of the groove into which you'll need to press the wire.
- stabilizer_base_through_grasp_offset = 4; // Distance from top of base to offset the wire.
- stabilizer_base_through_grasp_width = 1.5; // Width of the "arms" that hold the wire.
- stabilizer_base_through_mount_offset = 0.5; // How far inward to move the mounts to account for the 90 degree bend in the wire.
- stabilizer_base_through_mount_width = 4.75; // Width of the mount at the bottom.
- stabilizer_base_through_support_distance = 8.5; // Distance from center of keycap to offset supports left and right of switch.
- stabilizer_base_through_support_length = 14; // Length of support to left and right of key switch.
- stabilizer_base_through_support_width = 2; // Width of the struts that support the stabilizer anchor.
- stabilizer_base_through_wire_allowance = 0.4; // How much room to leave around the wire in places where we don't want any friction on the wire.
- stabilizer_keycap_through_arm_horizontal_offset = 1; // Horizontal distance from outside edge to start arm.
- stabilizer_keycap_through_arm_width = 4; // Width of the arms extending downward from the keycap through which the stabilizer bar extends.
- stabilizer_through_wire_diameter = 1.32; // Diameter of wire for stabilizer bar.
- x_unit_mm = 19; // Millimeters from the center of one "standard" key to the next horizontally.
- y_unit_mm = 19; // Millimeters from the center of one row to the next vertically.
- keyboard_dims = [16.5, 5]; // Width and height of keyboard in units.
- keyboard_width_per_hand = [8.25, 9]; // Width and height of keyboard by hand in units.
- function keyloc(x, y, right) = [(x - keyboard_dims[0] / 2 + 0.5) * x_unit_mm, (keyboard_dims[1] / 2 - y - 0.5) * y_unit_mm];
- module well_handwirehotswap() {
- translate([0, 0, base_well_handwirehotswap_floor_thickness + base_well_handwirehotswap_socket_thickness + base_well_handwirehotswap_switch_dims.z]) {
- translate([0, 0, -(base_well_handwirehotswap_switch_dims.z+base_well_handwirehotswap_socket_thickness)/2+0.125]) { // The 0.125 here and 0.25 below are just so that OpenSCAD will render nicely even without a long render.
- cube([base_well_handwirehotswap_switch_dims.x, base_well_handwirehotswap_switch_dims.y, base_well_handwirehotswap_switch_dims.z+base_well_handwirehotswap_socket_thickness+0.25], center=true);
- }
- for (i = [0, 180]) {
- rotate([0, 0, i]) {
- translate([0, base_well_handwirehotswap_switch_dims.y/2+base_well_handwirehotswap_switch_latch_depth/2-0.125, -(base_well_handwirehotswap_switch_latch_thickness+base_well_handwirehotswap_switch_latch_depth*tan(base_well_handwirehotswap_switch_latch_overhang_angle)+((base_well_handwirehotswap_socket_thickness+base_well_handwirehotswap_switch_dims.z)-(base_well_handwirehotswap_switch_latch_thickness+base_well_handwirehotswap_switch_latch_depth*tan(base_well_handwirehotswap_switch_latch_overhang_angle)))/2)]) {
- //cube([base_well_handwirehotswap_switch_latch_width, base_well_handwirehotswap_switch_latch_depth+0.25, (base_well_handwirehotswap_socket_thickness+base_well_handwirehotswap_switch_dims.z)-(base_well_handwirehotswap_switch_latch_thickness+base_well_handwirehotswap_switch_latch_depth*tan(base_well_handwirehotswap_switch_latch_overhang_angle))], center=true);
- }
- translate([0, base_well_handwirehotswap_switch_dims.y/2, -base_well_handwirehotswap_switch_latch_thickness]) {
- rotate([-base_well_handwirehotswap_switch_latch_overhang_angle, 0, 0]) {
- translate([0, base_well_handwirehotswap_switch_latch_depth/(2*cos(base_well_handwirehotswap_switch_latch_overhang_angle)), -base_well_handwirehotswap_switch_latch_depth/(2*cos(base_well_handwirehotswap_switch_latch_overhang_angle))]) {
- //cube([base_well_handwirehotswap_switch_latch_width, base_well_handwirehotswap_switch_latch_depth/cos(base_well_handwirehotswap_switch_latch_overhang_angle), base_well_handwirehotswap_switch_latch_depth/cos(base_well_handwirehotswap_switch_latch_overhang_angle)], center=true);
- }
- }
- }
- }
- }
- }
- let(
- vhole1y = -2*1.27,
- vhole2y = -(base_well_handwirehotswap_switch_dims.y/2-1.7/2)
- ) {
- //translate([3*1.27, (vhole1y+vhole2y)/2, 0]) cube([1.7, abs(vhole1y-vhole2y)+1.7, base_well_handwirehotswap_floor_thickness*2.05], center=true);
- }
- // Well for diode lead fastening
- translate([base_well_handwirehotswap_diode_lead_well_dims[0]/2-base_well_handwirehotswap_switch_dims.x/2, base_well_handwirehotswap_diode_lead_well_dims[1]/2-base_well_handwirehotswap_switch_dims.y/2, base_well_handwirehotswap_floor_thickness-base_well_handwirehotswap_diode_lead_well_dims[2]/2+0.01]) {
- //cube([base_well_handwirehotswap_diode_lead_well_dims[0], base_well_handwirehotswap_diode_lead_well_dims[1], base_well_handwirehotswap_diode_lead_well_dims[2]+0.02], center=true);
- }
- // Horizontal connector access
- translate([0, base_well_handwirehotswap_switch_dims.y/2+base_well_handwirehotswap_switch_latch_depth-base_well_handwirehotswap_horizontal_connector_access_dims[1]/2, base_well_handwirehotswap_floor_thickness/2]) {
- //cube([min(base_well_handwirehotswap_horizontal_connector_access_dims[0], base_well_handwirehotswap_switch_latch_width), base_well_handwirehotswap_horizontal_connector_access_dims[1], base_well_handwirehotswap_floor_thickness+0.01], center=true);
- }
- translate([0, base_well_handwirehotswap_switch_dims.y/2-(base_well_handwirehotswap_horizontal_connector_access_dims[1]-base_well_handwirehotswap_switch_latch_depth)/2, base_well_handwirehotswap_floor_thickness/2]) {
- cube([base_well_handwirehotswap_horizontal_connector_access_dims[0], base_well_handwirehotswap_horizontal_connector_access_dims[1]-base_well_handwirehotswap_switch_latch_depth, base_well_handwirehotswap_floor_thickness+0.01], center=true);
- }
- }
- module stabilizer_base_through(width) {
- mount_height = stabilizer_base_through_grasp_offset + stabilizer_through_wire_diameter - stabilizer_base_through_grasp_gap_factor;
- spread = ((width*x_unit_mm-stabilizer_keycap_through_arm_width)/2 - stabilizer_keycap_through_arm_horizontal_offset - stabilizer_base_through_mount_width/2 - stabilizer_through_wire_diameter - stabilizer_base_through_mount_offset)*2;
- translate([0, -y_unit_mm/2, 0]) {
- for (i = [-1, 1]) {
- translate([i*(stabilizer_base_through_support_distance+stabilizer_base_through_support_width/2), stabilizer_base_through_support_length/2, mount_height/2]) {
- cube([stabilizer_base_through_support_width, stabilizer_base_through_support_length, mount_height], center=true);
- }
- translate([i*spread/2, 0, 0]) {
- translate([0, 0, mount_height/2]) {
- cube([stabilizer_base_through_mount_width, stabilizer_through_wire_diameter + stabilizer_base_through_grasp_width*2, mount_height], center=true);
- }
- }
- support_height = stabilizer_base_through_grasp_offset-stabilizer_base_through_wire_allowance;
- translate([i*((spread-stabilizer_base_through_mount_width)/2-(spread-stabilizer_base_through_mount_width-stabilizer_base_through_front_gap)/4), 0, support_height/2]) {
- support_width = (spread-stabilizer_base_through_mount_width-stabilizer_base_through_front_gap)/2;
- difference() {
- cube([support_width, stabilizer_base_through_support_width, support_height], center=true);
- translate([-i*support_width/2, 0, -support_height/2]) {
- rotate([0, -i*atan(support_height/((min(stabilizer_base_through_support_distance*2, spread-stabilizer_base_through_mount_width)-stabilizer_base_through_front_gap)/2)), 0]) {
- translate([i*support_width/2, 0, support_height/2]) {
- cube([support_width*2, stabilizer_base_through_support_width*1.1, support_height], center=true);
- }
- }
- }
- }
- }
- }
- }
- }
- difference() {
- union() {
- let(base_thickness = base_well_handwirehotswap_floor_thickness + base_well_handwirehotswap_socket_thickness + base_well_handwirehotswap_switch_dims.z) {
- translate(keyloc(1.375, 2, false)) {
- translate([0, 0, base_thickness]) {
- stabilizer_base_through(1.75);
- }
- }
- difference() {
- union() {
- translate([(3.625 - keyboard_dims[0] / 2 + 0.5) * x_unit_mm, 0, base_thickness / 2]) {
- cube([
- keyboard_width_per_hand[0] * x_unit_mm,
- 5 * y_unit_mm,
- base_thickness
- ], center=true);
- }
- }
- translate(keyloc(7.75, 3, false)) {
- well_handwirehotswap();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement