暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

cherry_mx.scad 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. $fn=60;
  2. /**
  3. a cherry mx switch.
  4. most of the measurements done with a caliper. some taken from
  5. http://geekhack.org/index.php?topic=47744.0
  6. This is just to illustrate and to drop in a a gross reference. It is mostly artistic apart from the steam and mounting plate dimensions
  7. */
  8. // slightly adapted from https://www.thingiverse.com/thing:421524
  9. module mx_switch(t = 0) {
  10. translate([0, 0, 9.25])
  11. //translate([0,0,-3])
  12. {
  13. //1. steam
  14. color("#503000")
  15. translate([0, 0, -3.9 * t]) {
  16. //1.1. l-r tab is 1.35mm
  17. translate([0,0,-3.62/2])
  18. cube([1.35,4.5,3.62], center=true);
  19. //1.2. f-b tab is 1.15mm. it has a smal notch that i will ignore.
  20. translate([0,0,-3.62/2])
  21. cube([4.5,1.15,3.62], center=true);
  22. //1.3. base. it has a chamfered top that i will ignore.
  23. translate([0,0,-5.62])
  24. cube([7.2,5.56,4], center=true);
  25. }
  26. // 2. top
  27. color("grey"){
  28. difference(){
  29. // make a trapezoid with the general shape (volume?) of the top
  30. hull(){
  31. translate([0,0,-4]) //distance from top of switch... some i measured 3.9 others 4.2... so leaving at 4
  32. cube([9.87,10.62,0.1], center=true);
  33. translate([0,0,-4 -5.2]) // bottom has a measured 5.3... so move 5.2 and use the 0.1 bellow
  34. cube([14.58,14.58,0.1], center=true);
  35. }
  36. translate([0, 0, -5.8])
  37. cube([7.2,5.56,4], center=true);
  38. // and subtract:
  39. // the front led. NOTE: totally off... measured by eye. just for astetics
  40. // adding just so there is a visual cue of the direction
  41. translate([0,-4.7,-6])
  42. cylinder(r=3/2, h=6, center=true);
  43. translate([0,-5.5,-6])
  44. cube([8,4,5], center=true);
  45. // the four corners
  46. // TODO waste of time? this is all for looks, you shouldn't invade any of that space anyway...
  47. }
  48. }
  49. // 3. bottom
  50. color("green")
  51. // 3.1 main body volume
  52. hull(){
  53. translate([0,0,-4 -5.3]) //steam + top
  54. cube([13.98,13.98,0.1], center=true);
  55. translate([0,0,-4 -5.3 -2.2]) //steam + top + straigth part
  56. cube([13.98,13.98,0.1], center=true);
  57. translate([0,0,-4 -5.3 -5.5]) //steam + top + bottom (measured 5.5)
  58. cube([12.74,13.6,0.1], center=true);
  59. }
  60. // 3.2 tabs
  61. // note: only measured the lenght, if they are slightly off-center, this will be all wrong :)
  62. color("black")
  63. difference(){
  64. translate([0,0,-4 -5.3 -0.82/2]) //steam + top
  65. cube([15.64,15.64,0.82], center=true);
  66. translate([0,0,-4 -5.3 -0.82/2 ]) // front-back cut
  67. cube([5.64,20,0.82 +2], center=true);
  68. translate([0,0,-4 -5.3 -0.82/2 ]) //side cut
  69. cube([20,11.64,0.82 +2], center=true);
  70. }
  71. // 3.3 tab (plate snap on). to use this mechanically, you have to take into account the bending (as it will move the bottom part slightly up...) just for gross reference here for now
  72. color("white"){
  73. // 3.3.1 top
  74. translate([0,0,-4 -5.3 -0.82/2 ]) // front-back cut
  75. cube([1.82,16.33,0.82], center=true);
  76. // 3.3.2 bottom
  77. difference(){
  78. hull(){
  79. translate([0,0,-4 -5.3 -0.82/2 -1.76 ]) // front-back cut
  80. cube([3.65,14,0.1], center=true);
  81. translate([0,0,-4 -5.3 -0.82/2 -2.2 ]) // front-back cut
  82. cube([3.65,14.74,0.1], center=true);
  83. translate([0,0,-4 -5.3 -0.82/2 -2.89 ]) // front-back cut
  84. cube([3.65,14,0.1], center=true);
  85. }
  86. translate([0,0,-4 -5.3 -0.82/2 -1.76 ]) // front-back cut
  87. cube([2.2,20,4], center=true);
  88. }
  89. }
  90. // 4. bottom guides
  91. // again, i'm assuming everything is centered...
  92. color("darkGreen"){
  93. // 4.1 cylinder
  94. translate([0,0,-4 -5.3 -5.5 -2/2]) //steam + top + bottom (measured 5.5)
  95. cylinder(r=3.85/2, h=2, center=true);
  96. translate([0,0,-4 -5.3 -5.5 -2 -1/2]) //steam + top + bottom (measured 5.5)
  97. cylinder(r2=3.85/2, r1=2.8/2, h=1, center=true);
  98. // 4.2 PCB pins
  99. translate([4.95,0,-4 -5.3 -5.5 -2/2]) //steam + top + bottom (measured 5.5)
  100. cylinder(r=1.6/2, h=2, center=true);
  101. translate([4.95,0,-4 -5.3 -5.5 -2 -1/2]) //steam + top + bottom (measured 5.5)
  102. cylinder(r2=1.6/2, r1=1/2, h=1, center=true);
  103. translate([-4.95,0,-4 -5.3 -5.5 -2/2]) //steam + top + bottom (measured 5.5)
  104. cylinder(r=1.6/2, h=2, center=true);
  105. translate([-4.95,0,-4 -5.3 -5.5 -2 -1/2]) //steam + top + bottom (measured 5.5)
  106. cylinder(r2=1.6/2, r1=1/2, h=1, center=true);
  107. }
  108. // 5. pins
  109. color("orange"){
  110. translate([-3.77,2.7,-4 -5.3 -5.5 -3.1/2]) //steam + top + bottom (measured 5.5)
  111. cube([.86, 0.2,3.1], center=true);
  112. translate([2.7,5.2,-4 -5.3 -5.5 -3.1/2]) //steam + top + bottom (measured 5.5)
  113. cube([.86, 0.2,3.1], center=true);
  114. }
  115. }
  116. }
  117. mx_switch();