1
0

first_order.scad 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //
  2. // First Order (B-format) Ambisonics Microphone, or Bambi for short
  3. //
  4. // Copyright 2015 Fernando Lopez-Lezcano
  5. //
  6. // Code released under the GNU GPL License
  7. // http://www.gnu.org/licenses/gpl-3.0.en.html
  8. //
  9. // 3d models under Creative Commons Non-Commercial Share-alike, CC-NC-SA 3.0
  10. // http://creativecommons.org/licenses/by-nc-sa/3.0/
  11. // microphone capsule holder
  12. module capsule (azimuth, elevation, separation, radius, height, wall, twist) {
  13. rotate([0, 0, azimuth]) {
  14. rotate([0, (90 - elevation), 0]) {
  15. translate([0, 0, separation]) {
  16. // the capsule holder
  17. difference () {
  18. union () {
  19. // main capsule holder
  20. cylinder(r = radius + wall, h = height, $fn = 128);
  21. // ridge to stop capsule when inserted
  22. translate(v = [0, 0, - (wall / 2)]) {
  23. difference() {
  24. cylinder(r = radius + wall, h = wall / 2, $fn = 128);
  25. cylinder(r = radius - 0.4, h = wall / 2, $fn = 128);
  26. }
  27. }
  28. // the attachment point to the other capsules
  29. for (rot = [0 : 120 : 360]) {
  30. rotate(a = rot + twist, v = [0, 0, 1]) {
  31. translate(v = [radius + wall, 0, wall * 2]) {
  32. rotate(a = 145, v = [0, 1, 0]) {
  33. cube([wall * 2.5, wall * 2, separation], center=true);
  34. // cylinder(d=wall * 3, h = seaparation, center=true);
  35. }
  36. }
  37. }
  38. }
  39. }
  40. // the inside of the capsule holder
  41. cylinder(r=radius, h=height, $fn = 128);
  42. // remove the upper part of the attachment points
  43. translate(v = [0, 0, height]) {
  44. cylinder(r = radius + wall, h = wall);
  45. }
  46. };
  47. }
  48. }
  49. }
  50. }
  51. // vectors pointing in the directions of the four capsules
  52. direction1 = [1, 1, 1];
  53. direction2 = [-1, 1, -1];
  54. direction3 = [-1, -1, 1];
  55. direction4 = [1, -1, -1];
  56. dist = sqrt(3);
  57. // azimuths
  58. az1 = atan2(1, 1);
  59. az2 = atan2(1, -1);
  60. az3 = atan2(-1, -1);
  61. az4 = atan2(-1, 1);
  62. // elevations
  63. el1 = asin(1/dist);
  64. el2 = -asin(1/dist);
  65. el3 = asin(1/dist);
  66. el4 = -asin(1/dist);
  67. // dimensions for the EM182 electret microphone
  68. mic_radius = 5;
  69. mic_height = 4.5;
  70. // seaparation between capsules
  71. cap_sep = 6;
  72. // connect the four instances together
  73. capsule(az1, el1, cap_sep, mic_radius, mic_height, 1, 60);
  74. capsule(az2, el2, cap_sep, mic_radius, mic_height, 1, 0);
  75. capsule(az3, el3, cap_sep, mic_radius, mic_height, 1, 60);
  76. capsule(az4, el4, cap_sep, mic_radius, mic_height, 1, 0);
  77. // just one to test
  78. //capsule(0, -90, cap_sep, mic_radius, mic_height, 1, 0);