TinySphEAR.scad 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. //
  2. // TinySpHEAR, Tiny Spherical Harmonics Ear,
  3. // First Order (B-format) Ambisonics Microphone
  4. //
  5. // Copyright 2015-2016, Fernando Lopez-Lezcano, All Rights Reserved
  6. // nando@ccrma.stanford.edu
  7. //
  8. //
  9. // This program is free software: you can redistribute it and/or modify
  10. // it under the terms of the GNU General Public License as published by
  11. // the Free Software Foundation, either version 3 of the License, or
  12. // (at your option) any later version.
  13. //
  14. // This program is distributed in the hope that it will be useful,
  15. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. // GNU General Public License for more details.
  18. //
  19. // You should have received a copy of the GNU General Public License
  20. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. //
  22. //
  23. // 3d Models released under the Creative Commons license as follows:
  24. // Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
  25. // http://creativecommons.org/licenses/by-nc-sa/4.0/
  26. include <TinySpHEAR_common.scad>;
  27. ////
  28. //// model parameters
  29. // dimensions of the electret microphone capsule
  30. capsule_radius = 5;
  31. capsule_height = 4.5;
  32. // distance between the face of a capsule and the center of array
  33. //
  34. // for a 10mm capsule: with vertical legs -> 10.5mm min radius
  35. // with horizontal legs -> 10mm min radius
  36. mic_radius = 9.6;
  37. // dimensions of the capsule holder connection legs
  38. // a width of 4mm is too thin, 5mm prints better
  39. leg_width = 5;
  40. leg_thick = 1.75;
  41. // wall thickness of the capsule holder
  42. wall = 1;
  43. // width of the ridge that connects to the mount
  44. // measured: ridge = 2.20mm, slot = 2.0 .. 2.35mm
  45. ridge_width = 2.0;
  46. ridge_slot_width = 2.0;
  47. // add to the thickness of ridges
  48. ridge_wfit = 0.1;
  49. ridge_hfit = 3;
  50. // dimensions of microphone mount
  51. mount_radius = 3.5;
  52. mount_wall = 0.75;
  53. // height and eccentricity of top connector
  54. mount_top_height = 15.0;
  55. mount_top_eccentricity = 1.3;
  56. // height of mount
  57. mount_height = 40;
  58. // microphone stand mount
  59. //
  60. // diameter of existing shielded wires (x 4)
  61. mic_wire_diam = 1.5;
  62. mic_wire_hole_radius = 3.0;
  63. mic_wire_hole_offset = 5;
  64. // standard microphone stand
  65. // measured diameter = 13.5, inside diameter of sleeve = 13.79 (
  66. mic_mount_radius = 13.50 / 2;
  67. // add this to inside diameter
  68. mic_mount_fit = 0.1;
  69. mic_mount_slot_height = 11.5;
  70. mic_mount_slot_width = 4.25;
  71. mic_mount_slot_radius = 6.25 / 2;
  72. mic_mount_wall = 1.5;
  73. mic_mount_height = 35.0 + mic_wire_hole_offset + mic_wire_hole_radius + 2 * mic_mount_wall;
  74. //// end of model parameters
  75. ////
  76. //// rendering control
  77. // what to render:
  78. // 0 -> ready to print
  79. // set = 0 -> one capsule, set = 1 -> four capsules
  80. // 1 -> the whole microhone with four capsules
  81. rendermic = 1;
  82. renderset = 0;
  83. // what type of connection to use between capsule holders:
  84. // 0 -> original cylindrical angled legs
  85. // 1 -> interlocking horizontal legs
  86. // 2 -> interlocking vertical legs
  87. connect = 1;
  88. // how many mount ridges to create
  89. // 0 -> no ridges
  90. // 1 -> 1 ridge
  91. // 2 -> 2 ridges
  92. ridges = 1;
  93. //// end of rendering control
  94. ////
  95. // adjustment for the inner radius of the capsule holder
  96. // measured inside diameter of a trial print was around 7.5 to 8.2
  97. // instead of 10, capsule diameter was 9.99)
  98. fudge = 0.08;
  99. // adjustment for fit of slots in connection legs and mount
  100. // 0.1: initial setting
  101. // 0.1 ->0.2: Ultimaker 2 + Extended plus APL (2016.06.10)
  102. fit = 0.15;
  103. // number of facets for rendering cylinders
  104. facets = 64;
  105. // render capsule holders with better resolution
  106. cfacets = 128;
  107. // render a complete microphone
  108. if (rendermic == 1) {
  109. // all four capsules
  110. capsule(45, elev_angle, leg_angles_top, 60, 0, 0.0, 0.0, 0);
  111. capsule(-135, elev_angle, leg_angles_top, 60, 0, 0.0, 0.0, 0);
  112. capsule(-45, -elev_angle, leg_angles_bot, 0, 1, 0.0, 0.0, 0);
  113. capsule(135, -elev_angle, leg_angles_bot, 0, 1, 0.0, 0.0, 0);
  114. // the mount
  115. mount([-45, 135], mount_wall, mic_mount_wall, mic_mount_height + mount_top_height + mount_height + capsule_bottom);
  116. }
  117. // print all the parts separately
  118. if (rendermic == 0) {
  119. if (connect == 1) {
  120. part_rot = 90;
  121. part_height = 0;
  122. part_sep = capsule_radius * 2.5;
  123. // #3
  124. *translate([part_sep, -part_sep, part_height]) { capsule(0, part_rot, leg_angles_top, 60, 0); }
  125. if (renderset != 0) {
  126. // #4
  127. translate([part_sep, part_sep, part_height]) { capsule(0, part_rot, leg_angles_top, 60, 0); }
  128. // #2
  129. *translate([-part_sep, part_sep, part_height]) { capsule(0, part_rot, leg_angles_bot, -90, 1); }
  130. // #1
  131. *translate([-part_sep, -part_sep, part_height]) { capsule(0, part_rot, leg_angles_bot, 90, 1); }
  132. // mount body
  133. *translate([0, 0, 0]) { mount([-45, 135], mount_wall, mic_mount_wall, 0); }
  134. // add connecting ridges to make it all one part
  135. *difference() {
  136. for (rot_a = [-45, 45]) {
  137. rotate([0, 0, rot_a]) {
  138. translate([-wall / 2, -part_sep, 0]) {
  139. cube([wall, part_sep * 2, wall / 2]);
  140. }
  141. }
  142. }
  143. // remove them in the inside of the mount
  144. *cylinder(r = mount_radius + wall / 2, h = wall / 2);
  145. }
  146. }
  147. } else {
  148. // connect == 2
  149. part_rot = -90;
  150. part_height = capsule_height;
  151. part_sep = capsule_radius * 2;
  152. // #3
  153. translate([part_sep, -part_sep, part_height]) { capsule(0, part_rot, leg_angles_top, 0, 0); }
  154. if (renderset != 0) {
  155. // #4
  156. translate([part_sep, part_sep, part_height]) { capsule(0, part_rot, leg_angles_top, 0, 0); }
  157. // #2
  158. translate([-part_sep, part_sep, part_height]) { capsule(0, part_rot, leg_angles_bot, -90, 1); }
  159. // #1
  160. translate([-part_sep, -part_sep, part_height]) { capsule(0, part_rot, leg_angles_bot, 90, 1); }
  161. // stand mount
  162. *translate([0, 0, 0]) {
  163. mount_to_stand([-45, 135], mount_wall, mic_mount_wall, 0);
  164. }
  165. // add connecting ridges to make it all one part
  166. difference() {
  167. for (rot_a = [-45, 45]) {
  168. rotate([0, 0, rot_a]) {
  169. translate([-wall / 2, -part_sep * 0.85, 0]) {
  170. cube([wall, part_sep * 1.75, wall / 2]);
  171. }
  172. }
  173. }
  174. // remove them in the inside of the mount
  175. *cylinder(r = mic_mount_radius + mount_wall / 2, h = wall / 2);
  176. }
  177. }
  178. }
  179. }