// // First Order (B-format) Ambisonics Microphone, or Bambi for short // // Copyright 2015 Fernando Lopez-Lezcano // // Code released under the GNU GPL License // http://www.gnu.org/licenses/gpl-3.0.en.html // // 3d models under Creative Commons Non-Commercial Share-alike, CC-NC-SA 3.0 // http://creativecommons.org/licenses/by-nc-sa/3.0/ // microphone capsule holder module capsule (azimuth, elevation, separation, radius, height, wall, twist) { rotate([0, 0, azimuth]) { rotate([0, (90 - elevation), 0]) { translate([0, 0, separation]) { // the capsule holder difference () { union () { // main capsule holder cylinder(r = radius + wall, h = height, $fn = 128); // ridge to stop capsule when inserted translate(v = [0, 0, - (wall / 2)]) { difference() { cylinder(r = radius + wall, h = wall / 2, $fn = 128); cylinder(r = radius - 0.4, h = wall / 2, $fn = 128); } } // the attachment point to the other capsules for (rot = [0 : 120 : 360]) { rotate(a = rot + twist, v = [0, 0, 1]) { translate(v = [radius + wall, 0, wall * 2]) { rotate(a = 145, v = [0, 1, 0]) { cube([wall * 2.5, wall * 2, separation], center=true); // cylinder(d=wall * 3, h = seaparation, center=true); } } } } } // the inside of the capsule holder cylinder(r=radius, h=height, $fn = 128); // remove the upper part of the attachment points translate(v = [0, 0, height]) { cylinder(r = radius + wall, h = wall); } }; } } } } // vectors pointing in the directions of the four capsules direction1 = [1, 1, 1]; direction2 = [-1, 1, -1]; direction3 = [-1, -1, 1]; direction4 = [1, -1, -1]; dist = sqrt(3); // azimuths az1 = atan2(1, 1); az2 = atan2(1, -1); az3 = atan2(-1, -1); az4 = atan2(-1, 1); // elevations el1 = asin(1/dist); el2 = -asin(1/dist); el3 = asin(1/dist); el4 = -asin(1/dist); // dimensions for the EM182 electret microphone mic_radius = 5; mic_height = 4.5; // seaparation between capsules cap_sep = 6; // connect the four instances together capsule(az1, el1, cap_sep, mic_radius, mic_height, 1, 60); capsule(az2, el2, cap_sep, mic_radius, mic_height, 1, 0); capsule(az3, el3, cap_sep, mic_radius, mic_height, 1, 60); capsule(az4, el4, cap_sep, mic_radius, mic_height, 1, 0); // just one to test //capsule(0, -90, cap_sep, mic_radius, mic_height, 1, 0);