| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- //
- // 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/
- // what to render
- // 0 -> a single capsule holder
- // 1 -> the whole microhone with four capsules
- rendermic = 0;
- // what type of connection between holders
- // 0 -> original cylinder beams
- // 1 -> interlocking beams (out)
- // 2 -> interlocking beams (in)
- connect = 1;
- // number of facets for cylinders
- facets = 64;
- // adjustment for the size of the capsule
- // (measured inside diameter was around 7.5 to 8.2 instead of 10, capsule diameter was 9.99)
- fudge = 0.1;
- // microphone capsule holder
- // azimuth: orientation of the capsule
- // elevation: orientation of the capsure
- // separation: how far from the center to displace the capsule
- // radius: radius of the microphone
- // height: height of the microphone
- // wall: thickness of the microphone housing walls
- // twist: adjust the angle of the mounts so they match
- // mounts: number of mounts to create (2 or 3)
- module capsule (azimuth, elevation, ambradius, radius, height, wall, twist, mounts) {
- rotate([0, 0, azimuth]) {
- rotate([0, (90 - elevation), 0]) {
- translate([0, 0, ambradius - height]) {
- // the capsule holder
- difference () {
- union () {
- // main capsule holder
- cylinder(r = radius + wall, h = height, $fn = facets);
- // ridge to stop capsule when inserted
- // translate(v = [0, 0, - (wall / 2)]) {
- // difference() {
- // cylinder(r = radius + wall, h = wall / 2, $fn = facets);
- // cylinder(r = radius - 0.4, h = wall / 2, $fn = facets);
- // }
- // }
- // the attachment point to the other capsules
- for (rot = [-120 : 120 : mounts == 2 ? 0 : 120]) {
- rotate(a = rot + twist, v = [0, 0, 1]) {
- if (connect == 0) {
- translate([radius - wall, 0, height - wall]) {
- rotate(a = 145, v = [0, 1, 0]) {
- cylinder(d = wall * 4, h = 6, center = false, $fn = facets);
- }
- }
- }
- if (connect == 1) {
- translate([radius - wall, 3 * wall / 4, wall]) {
- rotate(a = 90, v = [0, 1, 0]) {
- difference() {
- cube([wall * 2, wall * 4, height * 4], center = true);
- translate([0, 0, wall * 8]) {
- cube([wall * 2, wall * 1.5, height], center = true);
- }
- }
- }
- }
- }
- }
- }
- }
- // make the hole for the capsule
- translate ([0, 0, -2]) {
- cylinder(r = radius + fudge, h = height + 2, $fn = facets);
- }
- // remove any extra connecting beam material from the face of the holder
- translate ([0, 0, height]) {
- cylinder(r = radius + wall * 2, h = 2, $fn = facets);
- }
- }
- }
- }
- }
- }
- // mounting stalk
- module stalk (radius_top, radius_bot, length, wall, separation) {
- // top cone
- translate([0, 0, -separation]) {
- difference() {
- cylinder(h = length, r1 = radius_bot, r2 = radius_top, center = true, $fn = 128);
- cylinder(h = length, r1 = radius_bot - wall, r2 = radius_top - wall, center = true, $fn=128);
- // carve out the two microphones, this is a hack
- translate([-(wall * 3), wall * 3, cap_sep * 1.5]) {
- rotate([0, 145 + 90, -45]) {
- cylinder(h = length * 1.4, r = mic_radius + wall, center = true, $fn=128);
- }
- }
- translate([wall * 3, -(wall * 3), cap_sep * 1.5]) {
- rotate([0, 145 + 90, 135]) {
- cylinder(h = length * 1.4, r = mic_radius + wall, center = true, $fn=128);
- }
- }
- }
- // mounting stalk
- translate([0, 0, -(1.5 * length)]) {
- difference() {
- cylinder(h = length * 2, r = radius_bot, center = true, $fn=128);
- cylinder(h = length * 2, r = radius_bot - wall, center = true, $fn=128);
- }
- }
- }
- }
- // 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;
- // separation between capsules
- cap_sep = 7;
- // distance between face of capsule and center of array
- amb_radius = 11.5;
- // connect the four instances together
- if (rendermic == 1) {
- capsule(az1, el1, amb_radius, mic_radius, mic_height, 1, 60, 3);
- capsule(az2, el2, amb_radius, mic_radius, mic_height, 1, 240, 2);
- capsule(az3, el3, amb_radius, mic_radius, mic_height, 1, 60, 3);
- capsule(az4, el4, amb_radius, mic_radius, mic_height, 1, 240, 2);
- // the mount
- //stalk(mic_radius * 1.25, mic_radius * 2/3, 8, 1, 12);
- }
- // just one to test
- if (rendermic == 0) {
- capsule(0, 90, height, mic_radius, mic_height, 1, 0);
- }
|