Advertisement
Guest User

Untitled

a guest
Mar 17th, 2024
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.34 KB | None | 0 0
  1. 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.
  2. base_well_handwirehotswap_floor_thickness = 2; // Thick to make the "floor" beneath the socket.
  3. base_well_handwirehotswap_horizontal_connector_access_dims = [8, 6.5]; // Size of the hole to leave for horizontal connector access.
  4. base_well_handwirehotswap_socket_thickness = 3.5; // How much vertical space to allow for the socket.
  5. base_well_handwirehotswap_switch_dims = [14, 14, 5.4]; // Switch width, height, and depth.
  6. base_well_handwirehotswap_switch_latch_depth = 1.8; // How deep a notch to leave for the latch.
  7. base_well_handwirehotswap_switch_latch_overhang_angle = 45; // The angle of the overhang of the latch
  8. base_well_handwirehotswap_switch_latch_thickness = 1.4; // How thick the "plate" should be.
  9. base_well_handwirehotswap_switch_latch_width = 5; // How wide a notch to leave for the latch.
  10. stabilizer_base_through_front_gap = 4; // Gap between the front supports.
  11. 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.
  12. stabilizer_base_through_grasp_offset = 4; // Distance from top of base to offset the wire.
  13. stabilizer_base_through_grasp_width = 1.5; // Width of the "arms" that hold the wire.
  14. stabilizer_base_through_mount_offset = 0.5; // How far inward to move the mounts to account for the 90 degree bend in the wire.
  15. stabilizer_base_through_mount_width = 4.75; // Width of the mount at the bottom.
  16. stabilizer_base_through_support_distance = 8.5; // Distance from center of keycap to offset supports left and right of switch.
  17. stabilizer_base_through_support_length = 14; // Length of support to left and right of key switch.
  18. stabilizer_base_through_support_width = 2; // Width of the struts that support the stabilizer anchor.
  19. 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.
  20. stabilizer_keycap_through_arm_horizontal_offset = 1; // Horizontal distance from outside edge to start arm.
  21. stabilizer_keycap_through_arm_width = 4; // Width of the arms extending downward from the keycap through which the stabilizer bar extends.
  22. stabilizer_through_wire_diameter = 1.32; // Diameter of wire for stabilizer bar.
  23. x_unit_mm = 19; // Millimeters from the center of one "standard" key to the next horizontally.
  24. y_unit_mm = 19; // Millimeters from the center of one row to the next vertically.
  25.  
  26. keyboard_dims = [16.5, 5]; // Width and height of keyboard in units.
  27. keyboard_width_per_hand = [8.25, 9]; // Width and height of keyboard by hand in units.
  28.  
  29. 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];
  30.  
  31. module well_handwirehotswap() {
  32. translate([0, 0, base_well_handwirehotswap_floor_thickness + base_well_handwirehotswap_socket_thickness + base_well_handwirehotswap_switch_dims.z]) {
  33. 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.
  34. 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);
  35. }
  36.  
  37. for (i = [0, 180]) {
  38. rotate([0, 0, i]) {
  39. 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)]) {
  40. //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);
  41. }
  42. translate([0, base_well_handwirehotswap_switch_dims.y/2, -base_well_handwirehotswap_switch_latch_thickness]) {
  43. rotate([-base_well_handwirehotswap_switch_latch_overhang_angle, 0, 0]) {
  44. 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))]) {
  45. //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);
  46. }
  47. }
  48. }
  49. }
  50. }
  51. }
  52.  
  53. let(
  54. vhole1y = -2*1.27,
  55. vhole2y = -(base_well_handwirehotswap_switch_dims.y/2-1.7/2)
  56. ) {
  57. //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);
  58. }
  59.  
  60. // Well for diode lead fastening
  61. 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]) {
  62. //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);
  63. }
  64.  
  65. // Horizontal connector access
  66. 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]) {
  67. //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);
  68. }
  69. 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]) {
  70. 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);
  71. }
  72. }
  73.  
  74. module stabilizer_base_through(width) {
  75. mount_height = stabilizer_base_through_grasp_offset + stabilizer_through_wire_diameter - stabilizer_base_through_grasp_gap_factor;
  76. 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;
  77. translate([0, -y_unit_mm/2, 0]) {
  78. for (i = [-1, 1]) {
  79. translate([i*(stabilizer_base_through_support_distance+stabilizer_base_through_support_width/2), stabilizer_base_through_support_length/2, mount_height/2]) {
  80. cube([stabilizer_base_through_support_width, stabilizer_base_through_support_length, mount_height], center=true);
  81. }
  82. translate([i*spread/2, 0, 0]) {
  83. translate([0, 0, mount_height/2]) {
  84. cube([stabilizer_base_through_mount_width, stabilizer_through_wire_diameter + stabilizer_base_through_grasp_width*2, mount_height], center=true);
  85. }
  86. }
  87. support_height = stabilizer_base_through_grasp_offset-stabilizer_base_through_wire_allowance;
  88. 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]) {
  89. support_width = (spread-stabilizer_base_through_mount_width-stabilizer_base_through_front_gap)/2;
  90. difference() {
  91. cube([support_width, stabilizer_base_through_support_width, support_height], center=true);
  92. translate([-i*support_width/2, 0, -support_height/2]) {
  93. 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]) {
  94. translate([i*support_width/2, 0, support_height/2]) {
  95. cube([support_width*2, stabilizer_base_through_support_width*1.1, support_height], center=true);
  96. }
  97. }
  98. }
  99. }
  100. }
  101. }
  102. }
  103. }
  104.  
  105. difference() {
  106. union() {
  107. let(base_thickness = base_well_handwirehotswap_floor_thickness + base_well_handwirehotswap_socket_thickness + base_well_handwirehotswap_switch_dims.z) {
  108. translate(keyloc(1.375, 2, false)) {
  109. translate([0, 0, base_thickness]) {
  110. stabilizer_base_through(1.75);
  111. }
  112. }
  113.  
  114. difference() {
  115. union() {
  116. translate([(3.625 - keyboard_dims[0] / 2 + 0.5) * x_unit_mm, 0, base_thickness / 2]) {
  117. cube([
  118. keyboard_width_per_hand[0] * x_unit_mm,
  119. 5 * y_unit_mm,
  120. base_thickness
  121. ], center=true);
  122. }
  123. }
  124.  
  125. translate(keyloc(7.75, 3, false)) {
  126. well_handwirehotswap();
  127. }
  128. }
  129. }
  130. }
  131. }
  132.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement