1
0

TinySpHEAR_H2N_common.scad 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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, wall, col_rad, col_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. for (m = [0, 1]) mirror([m, 0, 0]) {
  55. translate([width / 2 + col_rad - col_wall, 0, 0]) {
  56. cylinder(r = col_rad, h = height + thin_mint, $fn = facets);
  57. }
  58. }
  59. }
  60. // inner band
  61. difference() {
  62. difference() {
  63. rounded_block(height, width / 2 + wall - h2n_side_band, depth / 2 + band_wall, radius - thin_mint);
  64. rounded_block_relative(height, width / 2 + wall - h2n_side_band, depth / 2 + band_wall, radius - wall - thin_mint, - wall);
  65. }
  66. for (m = [0, 1]) mirror([m, 0, 0]) {
  67. // cut slots on the sides
  68. translate([-width / 2, -h2n_side_band_w / 2, 0]) {
  69. cube([width / 2, h2n_side_band_w, height]);
  70. }
  71. }
  72. }
  73. }
  74. // side columns
  75. module h2n_columns(width, height, ring_height, tilt, band, transition, radius, wall) {
  76. // side tubes for cables
  77. for (m = [0, 1]) mirror([m, 0, 0]) {
  78. translate([-(width / 2 + mount_radius - wall), 0, 0]) {
  79. difference() {
  80. // angled column (4 degrees inward tilt)
  81. hull() {
  82. cylinder(r = radius, h = thin_mint, $fn = facets);
  83. translate([height * tan(tilt) - wall/2, 0, height]) {
  84. cylinder(r = radius, h = thin_mint, $fn = facets);
  85. }
  86. }
  87. hull() {
  88. cylinder(r = radius - wall, h = thin_mint, $fn = facets);
  89. translate([height * tan(tilt) - wall/2, 0, height]) {
  90. cylinder(r = radius - wall, h = thin_mint, $fn = facets);
  91. }
  92. }
  93. // slots in the columns for cables
  94. translate([mount_radius - wall - ring_height * tan(tilt), - mount_radius * 2, -ring_height]) {
  95. slot_height = 25.0;
  96. rotate([0, tilt, 0]) {
  97. cube([5.0, mount_radius * 4, slot_height]);
  98. translate([mount_radius + wall, mount_radius - wall, slot_height]) {
  99. rotate([0, 90, 90]) {
  100. cylinder(r = mount_radius + wall, h = 15.0, $fn = facets);
  101. }
  102. }
  103. }
  104. }
  105. }
  106. }
  107. // connector to bridge
  108. translate([-(width / 2 + mount_radius - wall / 2 - height * tan(tilt)), 0, height]) {
  109. tube(mount_radius + wall / 2, mount_radius, 5.0);
  110. }
  111. }
  112. }
  113. // bridge that connects to capsule array
  114. module semi_cylinder(r, h) {
  115. difference() {
  116. cylinder(h, r, r, $fn = facets);
  117. translate ([-r*2, -r, 0])
  118. cube([2*r, 2*r, h]);
  119. }
  120. }
  121. module quarter_sphere(r) {
  122. difference() {
  123. sphere(r, $fn = facets);
  124. translate([-r, -r, -r])
  125. cube([2*r, 2*r, r]);
  126. translate([-r, -r, 0])
  127. cube([r, 2*r, r]);
  128. }
  129. }
  130. module cylcube(width, depth, height, wall) {
  131. difference() {
  132. semi_cylinder(r = depth, h = height);
  133. semi_cylinder(r = depth - wall, h = height);
  134. }
  135. translate([-(width + depth / 2), -depth, 0]) {
  136. difference() {
  137. cube([(width + depth / 2), depth * 2, height]);
  138. translate([0, wall, 0]) {
  139. cube([(width + depth), (depth - wall) * 2, height]);
  140. }
  141. }
  142. }
  143. }
  144. module h2n_bridge(width, height, ring_height, ring_wall, tilt, band, transition, radius, col_wall, wall) {
  145. // capsule array mount
  146. translate([0, 0, band + 20.0]) {
  147. tetra_capsule_array_mount([-45, 135]);
  148. }
  149. // stalk
  150. translate([0, 0, band]) {
  151. difference() {
  152. tube(mount_radius + wall, mount_radius, 20.0 + 1.0);
  153. // remove stalk segment that is inside the bridge
  154. translate([width / 2, 0, -1.0]) {
  155. rotate([0, -90, 0]) {
  156. semi_cylinder(r = radius + col_wall, h = width);
  157. }
  158. }
  159. }
  160. }
  161. // top of bridge
  162. translate([width / 2 + wall, 0, band]) {
  163. rotate([0, -90, 0]) {
  164. difference() {
  165. // curvy ceiling
  166. semi_cylinder(r = radius + col_wall, h = width + 2 * wall);
  167. semi_cylinder(r = radius + col_wall - wall, h = width + 2 * wall);
  168. // make a hole for the cables
  169. translate([0, 0, width / 2]) {
  170. rotate([0, 90, 0]) {
  171. cylinder(r = mount_radius, h = 10, $fn = facets);
  172. }
  173. }
  174. }
  175. }
  176. }
  177. // caps at ends
  178. for (m = [0, 1]) mirror([m, 0, 0]) {
  179. translate([width / 2 + wall, 0, band]) {
  180. difference() {
  181. quarter_sphere(r = radius + col_wall);
  182. quarter_sphere(r = radius + col_wall - wall);
  183. }
  184. }
  185. }
  186. // base of bridge
  187. translate([0, 0, 0]) {
  188. for (m = [0, 1]) mirror([m, 0, 0]) {
  189. translate([width / 2 + wall, 0, 0]) {
  190. cylcube(width / 2 + wall, radius + col_wall, band, wall);
  191. }
  192. }
  193. }
  194. // reinforcement beams at the base
  195. translate([-col_wall / 2, -(radius + wall), 0]) {
  196. cube([col_wall, (radius + wall) * 2, col_wall]);
  197. }
  198. for (m = [0, 1]) mirror([m, 0, 0]) {
  199. translate([-width / 2 + radius, -(radius + wall), 0]) {
  200. cube([col_wall, (radius + wall) * 2, col_wall]);
  201. }
  202. }
  203. }
  204. connector_height = 40;
  205. transition_height = 30;
  206. // measured = 11.50, should be 13.1 -> ratio =
  207. // h2n_side_radius = 18.2;
  208. h2n_side_radius = 18.4;
  209. h2n_side_band = 1.5;
  210. h2n_side_band_w = 13.1;
  211. h2n_width_m = 63.0;
  212. h2n_depth_m = 36.4;
  213. h2n_band_height = 6.0;
  214. // base band width
  215. h2n_band_wall = 1.6;
  216. // walls for the columns
  217. h2n_col_wall = 2 * wall;
  218. // tilt for the columnds
  219. h2n_col_tilt = 4.0;
  220. // render the whole thing
  221. difference() {
  222. union() {
  223. 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, wall, mount_radius, h2n_col_wall);
  224. h2n_columns(h2n_width_m, connector_height, h2n_band_height, h2n_col_tilt, 10.0, transition_height, mount_radius + h2n_col_wall, h2n_col_wall);
  225. *translate([0, 0, connector_height]) {
  226. h2n_bridge(h2n_width_m - connector_height * tan(h2n_col_tilt), connector_height,
  227. h2n_band_height, h2n_band_wall, h2n_col_tilt, 10.0, transition_height, mount_radius, h2n_col_wall, wall);
  228. }
  229. }
  230. *translate([-40, -50, 0]) {
  231. cube([80, 50, 80]);
  232. }
  233. }
  234. // capsule holders and connector to main body
  235. *rotate([0, 0, 0]) {
  236. render_tetra_capsule_array(connector_height + transition_height + 30);
  237. }
  238. // make sure dimensions are fine
  239. *translate([-(h2n_width_m - 0.1) / 2, - 0.5, 0]) {
  240. cube([h2n_width_m - 0.1, 1, 1]);
  241. }
  242. *translate([-0.5, -(h2n_depth_m - 0.1) / 2, 0]) {
  243. cube([1, h2n_depth_m - 0.1, 1]);
  244. }
  245. // some tests with traced profiles
  246. *difference() {
  247. translate([0, -2.5, 0]) {
  248. scale([2.15, 2.15, 1.0]) {
  249. H2N_top_up_outline(5.0);
  250. }
  251. }
  252. // scale([1.75, 1.75, 1.0]) {
  253. translate([0, -2.4, 0]) {
  254. scale([2.02, 2.02, 1.0]) {
  255. H2N_top_up_outline(5.0);
  256. }
  257. }
  258. }
  259. *scale(1.665) {
  260. translate([0, 10, -0]) {
  261. rotate([0, 0, 0]) {
  262. H2N_front_outline(1.0);
  263. }
  264. }
  265. }
  266. *rotate([0, 0, 4]) translate([35, 0, 0])
  267. cube([2, 80, 4]);