TinySpHEAR_H2N_common.scad 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. //
  2. // Spherical Harmonics Ear Project (*SpHEAR)
  3. //
  4. // TinySpHEAR, First Order (B-format) Ambisonics Microphone
  5. // Common files for H2N add-on array
  6. //
  7. // Copyright 2016, Fernando Lopez-Lezcano, All Rights Reserved
  8. // nando@ccrma.stanford.edu
  9. //
  10. // This program is free software: you can redistribute it and/or modify
  11. // it under the terms of the GNU General Public License as published by
  12. // the Free Software Foundation, either version 3 of the License, or
  13. // (at your option) any later version.
  14. //
  15. // This program is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. // GNU General Public License for more details.
  19. //
  20. // You should have received a copy of the GNU General Public License
  21. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  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 <SpHEAR_common.scad>;
  27. include <TinySpHEAR_common.scad>;
  28. include <TinySpHEAR_mount_pcb.scad>;
  29. // outline of H2N front
  30. // include<h2n/H2N_front_outline.scad>;
  31. // outline of H2N top
  32. // include<h2n/H2N_top_up_outline.scad>;
  33. // dimensions of the EM200 electret microphone capsule (measured 14.59 max)
  34. capsule_radius = 14.6 / 2;
  35. capsule_height = 4.75;
  36. mic_radius = 11;
  37. // dimensions of H2R recorder
  38. // width and depth at middle of ring
  39. h2n_width = 62.00;
  40. h2n_depth = 42.66;
  41. h2n_width_up = 57.0;
  42. module tube(or, ir, h) {
  43. difference() {
  44. cylinder(r = or, h = h, $fn = facets);
  45. cylinder(r = ir, h = h, $fn = facets);
  46. }
  47. }
  48. // main support ring
  49. module h2n_ring(width, depth, radius, height, slot_w, slot_d, band_wall, tube_wall, wall) {
  50. // main support ring
  51. difference() {
  52. rounded_block(height, width / 2 + band_wall, depth / 2 + band_wall, radius - thin_mint);
  53. rounded_block_relative(height, width / 2 + band_wall, depth / 2 + band_wall, radius - band_wall - thin_mint, - band_wall);
  54. }
  55. // inner band
  56. difference() {
  57. difference() {
  58. rounded_block(height, width / 2 + wall - h2n_side_band, depth / 2 + band_wall, radius - thin_mint);
  59. rounded_block_relative(height, width / 2 + wall - h2n_side_band, depth / 2 + band_wall, radius - wall - thin_mint, - wall);
  60. }
  61. for (m = [0, 1]) mirror([m, 0, 0]) {
  62. // cut slots on the sides
  63. translate([-width / 2, -h2n_side_band_w / 2, 0]) {
  64. cube([width / 2, h2n_side_band_w, height]);
  65. }
  66. }
  67. }
  68. }
  69. module h2n_columns(width, height, ring_height, tilt, band, transition, radius, wall) {
  70. // side tubes for cables
  71. for (m = [0, 1]) mirror([m, 0, 0]) {
  72. translate([-(width / 2 + mount_radius - wall), 0, 0]) {
  73. // angled tube (4 degrees inward tilt)
  74. difference() {
  75. hull() {
  76. rounded_block(thin_mint, radius, radius, radius / 1 - thin_mint);
  77. translate([height * tan(tilt) - wall/2, 0, height]) {
  78. rounded_block(thin_mint, radius, radius, radius / 1 - thin_mint);
  79. }
  80. }
  81. hull() {
  82. rounded_block_relative(thin_mint, radius, radius, radius / 1 - thin_mint, - wall);
  83. translate([height * tan(tilt) - wall/2, 0, height]) {
  84. rounded_block_relative(thin_mint, radius, radius, radius / 1 - thin_mint, - wall);
  85. }
  86. }
  87. // slots for cables
  88. translate([mount_radius - wall - ring_height * tan(tilt), - mount_radius * 2, -ring_height]) {
  89. rotate([0, tilt, 0]) {
  90. cube([5.0, mount_radius * 4, 22.0]);
  91. translate([0, 2 * mount_radius, 22.0]) {
  92. rotate([0, 90, 0]) {
  93. cylinder(r = mount_radius, h = 5.0, $fn = facets);
  94. }
  95. }
  96. }
  97. }
  98. }
  99. }
  100. }
  101. }
  102. module h2n_bridge(width, height, ring_height, ring_wall, tilt, band, transition, radius, wall) {
  103. // triangular transition
  104. translate([0, 0, height + band]) {
  105. difference() {
  106. hull() {
  107. rounded_block(thin_mint, width / 2 + radius * 2 - ring_wall - height * tan(tilt), radius, radius / 1 - thin_mint);
  108. translate([0, 0, transition - band]) {
  109. cylinder(r = radius, h = thin_mint, $fn = facets);
  110. }
  111. }
  112. hull() {
  113. rounded_block_relative(thin_mint, width / 2 + radius * 2 - ring_wall - height * tan(tilt), radius, radius / 1 - thin_mint, - wall);
  114. translate([0, 0, transition - band]) {
  115. cylinder(r = radius - wall, h = thin_mint, $fn = facets);
  116. }
  117. }
  118. }
  119. }
  120. // triangular base
  121. translate([0, 0, height]) {
  122. difference() {
  123. rounded_block(band, width / 2 + radius * 2 - ring_wall - height * tan(tilt), radius, radius * 0.99 - thin_mint);
  124. rounded_block_relative(band, width / 2 + radius * 2 - ring_wall - height * tan(tilt), radius, radius * 0.8 - thin_mint, - wall);
  125. }
  126. }
  127. }
  128. connector_height = 40;
  129. transition_height = 30;
  130. // measured = 11.50, should be 13.1 -> ratio =
  131. // h2n_side_radius = 18.2;
  132. h2n_side_radius = 18.4;
  133. h2n_side_band = 1.5;
  134. h2n_side_band_w = 13.1;
  135. h2n_width_m = 63.0;
  136. h2n_depth_m = 36.4;
  137. h2n_band_height = 6.0;
  138. // base band width
  139. h2n_band_wall = 1.6;
  140. // render the whole thing
  141. h2n_ring(h2n_width_m, h2n_depth_m, h2n_depth * 0.425, h2n_band_height, h2n_side_band_w, h2n_side_band, h2n_band_wall, 0.0, wall);
  142. h2n_columns(h2n_width_m, connector_height, h2n_band_height, 4.0, 10.0, transition_height, mount_radius + wall, wall);
  143. h2n_bridge(h2n_width_m, connector_height, h2n_band_height, h2n_band_wall, 4.0, 10.0, transition_height, mount_radius + wall, wall);
  144. // capsule holders and connector to main body
  145. *rotate([0, 0, -45]) {
  146. render_tetra_capsule_array(connector_height + transition_height + 30);
  147. translate([0, 0, connector_height + transition_height]) {
  148. tetra_capsule_array_mount([-45, 135]);
  149. }
  150. }
  151. // make sure dimensions are fine
  152. *translate([-(h2n_width_m - 0.1) / 2, - 0.5, 0]) {
  153. cube([h2n_width_m - 0.1, 1, 1]);
  154. }
  155. *translate([-0.5, -(h2n_depth_m - 0.1) / 2, 0]) {
  156. cube([1, h2n_depth_m - 0.1, 1]);
  157. }
  158. // some tests with traced profiles
  159. *difference() {
  160. translate([0, -2.5, 0]) {
  161. scale([2.15, 2.15, 1.0]) {
  162. H2N_top_up_outline(5.0);
  163. }
  164. }
  165. // scale([1.75, 1.75, 1.0]) {
  166. translate([0, -2.4, 0]) {
  167. scale([2.02, 2.02, 1.0]) {
  168. H2N_top_up_outline(5.0);
  169. }
  170. }
  171. }
  172. *scale(1.665) {
  173. translate([0, 10, -0]) {
  174. rotate([0, 0, 0]) {
  175. H2N_front_outline(1.0);
  176. }
  177. }
  178. }
  179. *rotate([0, 0, 4]) translate([35, 0, 0])
  180. cube([2, 80, 4]);