TinySpHEAR_H2N_common.scad 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953
  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-2017, 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. // http://dkprojects.net/openscad-threads/
  30. // used for the threads of the mini-xlm connectors
  31. include <threads.scad>;
  32. // outline of H2N front
  33. // include<h2n/H2N_front_outline.scad>;
  34. // outline of H2N top
  35. // include<h2n/H2N_top_up_outline.scad>;
  36. facets = 128;
  37. // dimensions of the EM200 electret microphone capsule (measured 14.59 max)
  38. capsule_radius = 14.6 / 2;
  39. capsule_height = 4.75;
  40. mic_radius = 11;
  41. // adjust the depth of slots in mount
  42. mic_to_mount_fit = -0.4;
  43. // make triangular legs have the height of the capsule
  44. connect = 1;
  45. leg_thick = capsule_height;
  46. // dimensions of H2R recorder
  47. // width and depth at middle of ring
  48. h2n_width = 62.00;
  49. h2n_depth = 42.66;
  50. h2n_width_up = 57.0;
  51. // h2n_column_height = 40;
  52. // h2n_column_height = 25.3;
  53. h2n_column_height = 23.2;
  54. transition_height = 30;
  55. // measured = 11.50, should be 13.1 -> ratio =
  56. h2n_side_band = 1.5;
  57. h2n_side_band_w = 13.4;
  58. // h2n_width_m: tried taking out 0.5mm from the original measurement of 63.0, but
  59. // it is too much and the "Menu" button stops working, 0.25mm seems fine
  60. h2n_width_m = 63.0 - 0.25;
  61. h2n_depth_m = 36.4;
  62. h2n_band_height = 6.0;
  63. // base band width
  64. h2n_band_wall = 1.6;
  65. // wall for the stalk
  66. h2n_stalk_wall = 1.0;
  67. // walls for the columns
  68. h2n_col_wall = 2 * wall;
  69. // tilt for the columnds
  70. h2n_col_tilt = 4.0;
  71. // radius of mount stalk
  72. h2n_mount_radius = mount_radius;
  73. // fit for connector from column to bridge
  74. h2n_mount_fit = 0.04;
  75. // bridge dimensions
  76. h2n_bridge_base_height = 7.0;
  77. h2n_bridge_stalk_height = 45.0;
  78. // bridge base dimensions
  79. h2n_bridge_circle = 24.00;
  80. h2n_bridge_band_w = 13.25;
  81. h2n_bridge_band_h = 3.30; // 26.5 - h2n_column_height;
  82. // we need to make the dial cover slightly elliptical
  83. h2n_bridge_circle_max = 26.5;
  84. h2n_bridge_circle_ratio = h2n_bridge_circle_max / h2n_bridge_circle;
  85. module tube(or, ir, h) {
  86. difference() {
  87. cylinder(r = or, h = h, $fn = facets);
  88. cylinder(r = ir, h = h, $fn = facets);
  89. }
  90. }
  91. // main support ring
  92. module h2n_ring(width, depth, radius, height, tilt, slot_w, slot_d, band_wall, wall, col_rad, col_wall) {
  93. // main support ring
  94. difference() {
  95. conical_rounded_box(height, width / 2 + band_wall, depth / 2 + band_wall, radius - thin_mint, band_wall, height * tan(tilt));
  96. for (m = [0, 1]) mirror([m, 0, 0]) {
  97. translate([-(width / 2 + col_rad - col_wall), 0, 0]) {
  98. tilted_cylinder(col_rad, height, height * tan(tilt));
  99. }
  100. }
  101. }
  102. // inner band
  103. difference() {
  104. conical_rounded_box(height, width / 2 + wall - h2n_side_band, depth / 2 + wall, radius - thin_mint, wall, height * tan(tilt));
  105. for (m = [0, 1]) mirror([m, 0, 0]) {
  106. // cut slots on the sides
  107. translate([-width / 2 - wall / 2, -h2n_side_band_w / 2, 0]) {
  108. cube([width / 2, h2n_side_band_w, height + thin_mint]);
  109. }
  110. }
  111. }
  112. // add TinySpHEAR "branding"
  113. translate([0, -(h2n_depth_m / 2 + band_wall), h2n_band_height / 2]) scale(0.5) {
  114. rotate([90 - h2n_col_tilt, 0, 0]) {
  115. linear_extrude(height = 0.2, center = "true") {
  116. text("TinySpHEAR", size = 8.0, spacing = 1.1, halign = "center", valign = "center", font = "Liberation Sans");
  117. }
  118. }
  119. }
  120. }
  121. // side columns
  122. module tilted_cylinder(radius, height, offset) {
  123. hull() {
  124. cylinder(r = radius, h = thin_mint, $fn = facets);
  125. translate([offset, 0, height]) {
  126. cylinder(r = radius, h = thin_mint, $fn = facets);
  127. }
  128. }
  129. }
  130. module tilted_rounded_box(height, width, depth, radius, wall, offset) {
  131. difference() {
  132. hull() {
  133. rounded_block(thin_mint, width, depth, radius);
  134. translate([offset, 0, height]) {
  135. rounded_block(thin_mint, width, depth, radius);
  136. }
  137. }
  138. hull() {
  139. rounded_block_relative(thin_mint, width, depth, radius, -wall);
  140. translate([offset, 0, height]) {
  141. rounded_block_relative(thin_mint, width, depth, radius, -wall);
  142. }
  143. }
  144. }
  145. }
  146. module conical_rounded_box(height, width, depth, radius, wall, inset) {
  147. difference() {
  148. hull() {
  149. rounded_block(thin_mint, width, depth, radius);
  150. translate([0, 0, height]) {
  151. rounded_block_relative(thin_mint, width, depth, radius, -inset);
  152. }
  153. }
  154. hull() {
  155. rounded_block_relative(thin_mint, width, depth, radius, -wall);
  156. translate([0, 0, height]) {
  157. rounded_block_relative(thin_mint, width, depth, radius, -(wall + inset));
  158. }
  159. }
  160. }
  161. }
  162. module tilted_cube(width, depth, height, offset) {
  163. hull() {
  164. cube([width, depth, thin_mint]);
  165. translate([offset, 0, height]) {
  166. cube([width, depth, thin_mint]);
  167. }
  168. }
  169. }
  170. module tilted_half_rounded_box(height, width, depth, radius, wall, offset, e = 0.1) {
  171. difference() {
  172. tilted_rounded_box(height, width, depth, radius, wall, offset);
  173. translate([0, -(depth + e), 0]) {
  174. tilted_cube(width + e, (depth + e) * 2, height, offset);
  175. }
  176. }
  177. }
  178. module half_rounded_box(height, width, depth, radius, wall, e = 0.1) {
  179. difference() {
  180. rounded_box(height, width , depth, radius, wall);
  181. translate([0, -(depth + e), 0]) {
  182. cube([width + e, 2 * (depth + e), height]);
  183. }
  184. }
  185. }
  186. module h2n_column_core(height, ring_height, tilt, transition, radius, col_wall, wall, offset) {
  187. hull() {
  188. // angled column
  189. difference() {
  190. tilted_cylinder(radius + col_wall + offset, height, height * tan(tilt));
  191. translate([0, -(radius + col_wall + offset), 0]) {
  192. tilted_cube((radius + col_wall) * 2, (radius + col_wall) * 2, height, height * tan(tilt));
  193. }
  194. }
  195. // side sleeves
  196. // we should derive the geometry for the aligment magic below...
  197. side_fit = 0.5;
  198. translate([(radius + col_wall) / 2 + 2 * wall - side_fit, 0, 0]) {
  199. difference() {
  200. tilted_half_rounded_box(height, 3.8 + offset, h2n_side_band_w / 2 + wall + offset * 1.1,
  201. 2.0, wall, height * tan(tilt));
  202. translate([col_wall / 2 + wall - radius * 3 / 2 - side_fit, 0, 0]) {
  203. tilted_cylinder(radius, height, height * tan(tilt));
  204. }
  205. }
  206. }
  207. }
  208. }
  209. module h2n_column(height, ring_height, tilt, transition, radius, col_wall, wall) {
  210. // side tubes for cables
  211. difference() {
  212. h2n_column_core(height, ring_height, tilt, transition, radius, col_wall, wall, 0);
  213. // hollow out the cylinder
  214. tilted_cylinder(radius, height, height * tan(tilt));
  215. // this fine adjustment determines how much the side walls "hug" the H2N
  216. width_fit = 0.2;
  217. translate([radius + 2 * wall - width_fit, 0, 0]) {
  218. tilted_half_rounded_box(height + thin_mint, 3.8, h2n_side_band_w / 2, 1.5, 4 * wall, height * tan(tilt));
  219. }
  220. // trim side of tubes with a vertical plane
  221. translate([-(radius * 2 + col_wall) + col_wall / 2, -(radius + col_wall), 0]) {
  222. cube([col_wall * 2, (radius + col_wall) * 2, 30]);
  223. }
  224. }
  225. // add a thicker wall at the bottom of the side trim
  226. difference() {
  227. translate([-(radius), -(radius + col_wall), 0]) {
  228. cube([wall, (radius + col_wall) * 2, height]);
  229. }
  230. difference() {
  231. tilted_cylinder(radius * 4, height, height * tan(tilt));
  232. tilted_cylinder(radius + col_wall, height, height * tan(tilt));
  233. }
  234. }
  235. // connector to bridge
  236. translate([height * tan(tilt), 0, height]) {
  237. connector_height = 5.0;
  238. difference() {
  239. union() {
  240. difference() {
  241. union() {
  242. cylinder(r = radius + wall - h2n_mount_fit, h = connector_height, $fn = facets);
  243. h2n_column_core(h2n_bridge_band_h, ring_height, 0, transition, radius, col_wall, wall, -(wall + h2n_mount_fit));
  244. }
  245. cylinder(r = radius, h = connector_height, $fn = facets);
  246. translate([1.5, -(radius + wall) * 2, 0]) {
  247. cube([radius + wall, (radius + wall) * 4, connector_height]);
  248. }
  249. }
  250. // add anchor for retaining screw
  251. difference() {
  252. translate([-radius, 0, radius]) {
  253. sphere(r = radius * 2/3, $fn = facets);
  254. }
  255. // and clip out the rest of the sphere
  256. difference() {
  257. cylinder(r = 2 * radius + wall, h = height);
  258. cylinder(r = radius + wall - h2n_mount_fit, h = height);
  259. }
  260. translate([0, 0, connector_height]) {
  261. cylinder(r = radius + wall, h = connector_height);
  262. }
  263. }
  264. }
  265. // make hole for screw
  266. translate([-(radius + 2 * wall), 0, radius]) {
  267. rotate([0, 90, 0]) {
  268. cylinder(r = 0.5, h = radius + wall, $fn = facets);
  269. }
  270. }
  271. }
  272. }
  273. }
  274. module h2n_columns(width, height, ring_height, tilt, transition, radius, col_wall, wall) {
  275. for (m = [0, 1]) mirror([m, 0, 0]) {
  276. translate([-(width / 2 + col_wall - wall / 2), 0, 0]) {
  277. h2n_column(height, ring_height, tilt, transition, radius, col_wall, wall);
  278. }
  279. }
  280. }
  281. // old version of columns
  282. module h2n_columns_old(width, height, ring_height, tilt, transition, radius, col_wall, wall) {
  283. // side tubes for cables
  284. slot_height = 25.0;
  285. for (m = [0, 1]) mirror([m, 0, 0]) {
  286. translate([-(width / 2 + radius - col_wall), 0, 0]) {
  287. difference() {
  288. // angled column
  289. tilted_cylinder(radius + col_wall, height, height * tan(tilt));
  290. tilted_cylinder(radius, height, height * tan(tilt));
  291. // slots in the columns for cables
  292. translate([radius - col_wall - ring_height * tan(tilt), - radius * 2, -ring_height]) {
  293. rotate([0, tilt, 0]) {
  294. cube([5.0, radius * 4, slot_height]);
  295. translate([radius + col_wall, radius - col_wall, slot_height]) {
  296. rotate([0, 90, 90]) {
  297. cylinder(r = radius + col_wall, h = 15.0, $fn = facets);
  298. }
  299. }
  300. }
  301. }
  302. // trim side of tubes with a vertical plane
  303. translate([-(radius * 2 + col_wall) + col_wall / 2, -(radius + col_wall), 0]) {
  304. cube([col_wall * 2, (radius + col_wall) * 2, 30]);
  305. }
  306. }
  307. // add a thicker wall at the bottom of the side trim
  308. difference() {
  309. translate([-(radius), -(radius + col_wall), 0]) {
  310. cube([wall, (radius + col_wall) * 2, height]);
  311. }
  312. difference() {
  313. tilted_cylinder(radius * 4, height, height * tan(tilt));
  314. tilted_cylinder(radius + col_wall, height, height * tan(tilt));
  315. }
  316. }
  317. }
  318. // connector to bridge
  319. translate([-(width / 2 + radius - col_wall - height * tan(tilt)), 0, height]) {
  320. connector_height = 5.0;
  321. difference() {
  322. tube(radius + wall - h2n_mount_fit, radius, connector_height);
  323. translate([0, -(radius + wall), connector_height / 2]) {
  324. cube([radius + wall, (radius + wall) * 2, connector_height / 2]);
  325. }
  326. }
  327. }
  328. // side sleeves
  329. sleeve_height = slot_height;
  330. // XXX sleeve_height = slot_height - mount_radius - col_wall;
  331. for (m = [0, 1]) mirror([m, 0, 0]) {
  332. // we should derive the geometry for the aligment magic below...
  333. side_fit = 1.05;
  334. translate([-(width / 2 - (radius + col_wall) / 2 + wall - side_fit), 0, 0]) {
  335. difference() {
  336. tilted_half_rounded_box(sleeve_height, 3.8, h2n_side_band_w / 2 + wall, 2.0, wall, sleeve_height * tan(tilt));
  337. translate([col_wall / 2 + wall - radius * 3 / 2 - side_fit, 0, 0]) {
  338. tilted_cylinder(radius, height, height * tan(tilt));
  339. }
  340. }
  341. }
  342. }
  343. }
  344. }
  345. // bridge that connects to capsule array
  346. module semi_cylinder(r, h, e = thin_mint) {
  347. difference() {
  348. cylinder(h, r, r, $fn = facets);
  349. translate ([-r*2, -r, 0])
  350. cube([2*(r+e), 2*(r+e), h]);
  351. }
  352. }
  353. module quarter_sphere(r, e = thin_mint) {
  354. difference() {
  355. sphere(r, $fn = facets);
  356. translate([-(r+e), -(r+e), -(r+e)])
  357. cube([2*(r+e), 2*(r+e), r+e]);
  358. translate([-(r+e), -(r+e), -e])
  359. cube([r, 2*(r+e), (r+e)]);
  360. }
  361. }
  362. module cylcube(width, depth, height, wall) {
  363. difference() {
  364. semi_cylinder(r = depth, h = height);
  365. semi_cylinder(r = depth - wall, h = height);
  366. }
  367. translate([-(width + depth / 2), -depth, 0]) {
  368. difference() {
  369. cube([(width + depth / 2), depth * 2, height]);
  370. translate([0, wall, 0]) {
  371. cube([(width + depth), (depth - wall) * 2, height]);
  372. }
  373. }
  374. }
  375. }
  376. // old version of the bridge
  377. module h2n_bridge_old(width, base_height, stalk_height, radius, col_wall, wall) {
  378. // capsule array mount with the right orientation (left front top = #1)
  379. rotate([0, 0, -90]) translate([0, 0, base_height + stalk_height]) {
  380. tetra_capsule_array_mount([-45, 135]);
  381. }
  382. // stalk
  383. translate([0, 0, base_height]) {
  384. difference() {
  385. tube(radius + wall, radius, stalk_height);
  386. // remove stalk segment that is inside the bridge
  387. translate([width / 2, 0, -1.0]) {
  388. rotate([0, -90, 0]) {
  389. semi_cylinder(r = radius + col_wall, h = width);
  390. }
  391. }
  392. }
  393. // add marker for "back of microphone" orientation
  394. rotate([0, 0, 0]) {
  395. translate([0, radius + wall - wall * 2 / 3, stalk_height - radius]) {
  396. difference() {
  397. sphere(r = radius / 3, $fn = 32);
  398. translate([0, -radius + radius / 2, 0]) {
  399. cube([radius, radius, radius], center = true);
  400. }
  401. }
  402. }
  403. }
  404. }
  405. // top of bridge
  406. translate([width / 2, 0, base_height]) {
  407. rotate([0, -90, 0]) {
  408. difference() {
  409. // curvy ceiling
  410. semi_cylinder(r = radius + col_wall, h = width);
  411. semi_cylinder(r = radius + col_wall - wall, h = width);
  412. // make a hole for the cables
  413. translate([0, 0, width / 2]) {
  414. rotate([0, 90, 0]) {
  415. cylinder(r = radius, h = 10, $fn = facets);
  416. }
  417. }
  418. }
  419. }
  420. }
  421. // caps at ends
  422. for (m = [0, 1]) mirror([m, 0, 0]) {
  423. translate([width / 2, 0, base_height]) {
  424. difference() {
  425. quarter_sphere(r = radius + col_wall);
  426. quarter_sphere(r = radius + col_wall - wall);
  427. }
  428. }
  429. }
  430. // base of bridge
  431. translate([0, 0, 0]) {
  432. for (m = [0, 1]) mirror([m, 0, 0]) {
  433. translate([width / 2, 0, 0]) {
  434. cylcube(width / 2, radius + col_wall, base_height, wall);
  435. }
  436. }
  437. }
  438. // reinforcement beams at the base
  439. translate([-col_wall / 2, -(radius + wall), 0]) {
  440. cube([col_wall, (radius + wall) * 2, col_wall]);
  441. }
  442. for (m = [0, 1]) mirror([m, 0, 0]) {
  443. translate([-width / 2 + radius + wall, -(radius + wall), 0]) {
  444. cube([col_wall, (radius + wall) * 2, col_wall]);
  445. }
  446. }
  447. }
  448. // base plate for upper band cover
  449. module h2n_center_cover(width, base_height, stalk_height, radius, col_wall, wall, offset) {
  450. bot_step = h2n_bridge_band_h;
  451. difference() {
  452. union() {
  453. for (m = [0, 1]) mirror([m, 0, 0]) {
  454. // core of bridge
  455. translate([width/2, -thin_mint / 2, 0]) {
  456. cylcube(width / 2 + offset, radius + offset + 2 * wall, bot_step, wall);
  457. }
  458. // we should derive the geometry for the aligment magic below...
  459. side_fit = 1.05;
  460. corner_radius = 2.0;
  461. tilted_half_rounded_box(bot_step, width / 2 + offset - wall / 2, h2n_side_band_w / 2 + offset + wall,
  462. corner_radius, wall, 0);
  463. }
  464. }
  465. // clear the inside
  466. // outer frame
  467. rounded_block(bot_step + thin_mint, width / 2 + offset - 1.5 * wall, h2n_side_band_w / 2 + offset, 2);
  468. // inner frame
  469. translate([-(width + offset) / 2, -(radius + wall + offset), 0]) {
  470. cube([width + offset, (radius + wall + offset) * 2, bot_step + thin_mint]);
  471. }
  472. }
  473. }
  474. // base plate for upper center dial cover
  475. module h2n_center_dial_cover(radius, wall, offset) {
  476. scale([h2n_bridge_circle_ratio, 1, 1]) {
  477. tube(radius + wall + offset, radius + offset, h2n_bridge_band_h);
  478. }
  479. }
  480. // the core of the bridge, a solid offset-able version
  481. module h2n_bridge_core(width, base_height, stalk_height, radius, col_wall, wall, offset) {
  482. hull() {
  483. // top of bridge
  484. translate([width / 2, 0, base_height]) {
  485. rotate([0, -90, 0]) {
  486. // curvy ceiling
  487. semi_cylinder(r = radius + offset + col_wall, h = width + offset);
  488. }
  489. }
  490. // spherical caps at ends
  491. for (m = [0, 1]) mirror([m, 0, 0]) {
  492. translate([width / 2, 0, base_height]) {
  493. quarter_sphere(r = radius + offset + col_wall);
  494. }
  495. }
  496. // bottom plate
  497. h2n_center_cover(width, base_height, stalk_height, radius, col_wall, wall, offset);
  498. }
  499. // add cover for center dial
  500. hull() {
  501. cylinder(r = mount_radius + offset, h = base_height + radius, $fn = facets);
  502. h2n_center_dial_cover(h2n_bridge_circle / 2, wall, offset);
  503. }
  504. }
  505. // the bridge that holds the capsule array
  506. module h2n_bridge(width, base_height, stalk_height, radius, col_wall, stalk_wall, wall) {
  507. // capsule array mount with the right orientation (left front top = #1)0
  508. rotate([0, 0, -90]) translate([0, 0, base_height + stalk_height]) {
  509. tetra_capsule_array_mount([-45, 135], mount_radius, stalk_wall);
  510. }
  511. difference() {
  512. union() {
  513. h2n_bridge_core(width, base_height, stalk_height, radius, col_wall, wall, 0);
  514. // stalk
  515. translate([0, 0, base_height]) {
  516. difference() {
  517. tube(radius + stalk_wall, radius, stalk_height);
  518. // remove stalk segment that is inside the bridge
  519. translate([width / 2, 0, -1.0]) {
  520. rotate([0, -90, 0]) {
  521. semi_cylinder(r = radius + stalk_wall, h = width);
  522. }
  523. }
  524. }
  525. // add marker for "back of microphone" orientation
  526. rotate([0, 0, 0]) {
  527. translate([0, radius + stalk_wall - stalk_wall * 2 / 3, stalk_height - (radius + stalk_wall)]) {
  528. difference() {
  529. sphere(r = (radius + stalk_wall) / 3, $fn = 64);
  530. translate([0, -(radius + stalk_wall) + (radius + stalk_wall) / 2, 0]) {
  531. cube([radius + stalk_wall, radius + stalk_wall, radius + stalk_wall], center = true);
  532. }
  533. }
  534. }
  535. }
  536. }
  537. // small supports for the screws that attach to the columns
  538. for (m = [0, 1]) mirror([m, 0, 0]) {
  539. translate([-(width / 2 + radius + 2 * wall), 0, radius]) {
  540. rotate([0, 90, 0]) {
  541. cylinder(r = 1.5, h = 2 * wall, $fn = facets);
  542. }
  543. }
  544. }
  545. }
  546. h2n_bridge_core(width, base_height, stalk_height, radius, col_wall, wall, -wall);
  547. // make a hole in the bridge for the cables
  548. cylinder(r = radius, h = base_height + radius + 2 * wall, $fn = facets);
  549. // cut a window for the XY and MS leds
  550. translate([0, h2n_bridge_circle_max, 0]) {
  551. rotate([90, 0, 0]) cylinder(r = 2.0, h = h2n_bridge_circle_max * 2, $fn = facets);
  552. }
  553. // holes for screws that attach to the columns
  554. translate([-(width + 3 * radius + 2 * wall) / 2, 0, radius]) {
  555. rotate([0, 90, 0]) {
  556. cylinder(r = 0.5, h = width + 4 * radius, $fn = facets);
  557. }
  558. }
  559. }
  560. }
  561. // a bridge that includes an 8 pin mini-xlr connector
  562. thread_diam = 10.0;
  563. thread_pitch = 0.75;
  564. thread_height = 6.0;
  565. thread_depth = 0.614 * thread_pitch;
  566. conn_height = 25;
  567. conn_shoulder = 1.25;
  568. module h2n_mini_xlr_thread(diam, pitch, height) {
  569. metric_thread (diameter=diam, pitch=pitch, length=height, internal=true);
  570. }
  571. module h2n_bridge_connector(width, base_height, stalk_height, radius, col_wall, stalk_wall, wall) {
  572. difference() {
  573. union() {
  574. h2n_bridge_core(width, base_height, stalk_height, radius, col_wall, wall, 0);
  575. // connector
  576. translate([0, 0, base_height]) {
  577. difference() {
  578. cylinder(r = thread_diam/2 + stalk_wall, h = conn_height, $fn = facets);
  579. // remove the thread
  580. translate([0, 0, conn_height - thread_height - conn_shoulder]) {
  581. rotate([0, 0, 90]) {
  582. h2n_mini_xlr_thread(thread_diam, thread_pitch, thread_height);
  583. }
  584. }
  585. // remove excess above the thread
  586. translate([0, 0, conn_height - conn_shoulder]) {
  587. cylinder(r = thread_diam/2 + thread_depth, h = conn_shoulder, $fn = facets);
  588. }
  589. // make hole below the thread
  590. cylinder(r = thread_diam/2, h = conn_height - thread_height - conn_shoulder, $fn = facets);
  591. // remove stalk segment that is inside the bridge
  592. translate([width / 2, 0, -1.0]) {
  593. rotate([0, -90, 0]) {
  594. semi_cylinder(r = thread_diam/2 + stalk_wall, h = width);
  595. }
  596. }
  597. }
  598. }
  599. // small supports for the screws that attach to the columns
  600. for (m = [0, 1]) mirror([m, 0, 0]) {
  601. translate([-(width / 2 + radius + 2 * wall), 0, radius]) {
  602. rotate([0, 90, 0]) {
  603. cylinder(r = 1.5, h = 2 * wall, $fn = facets);
  604. }
  605. }
  606. }
  607. }
  608. h2n_bridge_core(width, base_height, stalk_height, radius, col_wall, wall, -wall);
  609. // make a hole in the bridge for the cables
  610. cylinder(r = thread_diam/2, h = base_height + radius + 2 * wall, $fn = facets);
  611. // cut a window for the XY and MS leds
  612. translate([0, h2n_bridge_circle_max, 0]) {
  613. rotate([90, 0, 0]) cylinder(r = 2.0, h = h2n_bridge_circle_max * 2, $fn = facets);
  614. }
  615. // holes for screws that attach to the columns
  616. translate([-(width + 3 * radius + 2 * wall) / 2, 0, radius]) {
  617. rotate([0, 90, 0]) {
  618. cylinder(r = 0.5, h = width + 4 * radius, $fn = facets);
  619. }
  620. }
  621. }
  622. }
  623. module h2n_connector_to_array_mount(width, stalk_wall) {
  624. stalk_height = 40;
  625. // the threaded bottom
  626. difference() {
  627. cylinder(r = thread_diam/2 + stalk_wall, h = conn_height, $fn = facets);
  628. // remove the thread
  629. translate([0, 0, conn_shoulder]) {
  630. rotate([0, 0, 90]) {
  631. h2n_mini_xlr_thread(thread_diam, thread_pitch, thread_height);
  632. }
  633. }
  634. // remove excess above the thread
  635. translate([0, 0, conn_shoulder + thread_height]) {
  636. cylinder(r = thread_diam/2, h = conn_height, $fn = facets);
  637. }
  638. // make hole below the thread
  639. cylinder(r = thread_diam/2, h = conn_shoulder, $fn = facets);
  640. }
  641. // conical stalk to the capsule array mount
  642. translate([0, 0, conn_height]) {
  643. difference() {
  644. cylinder(r1 = thread_diam/2 + stalk_wall, r2 = mount_radius + stalk_wall, h = stalk_height, $fn = facets);
  645. cylinder(r1 = thread_diam/2, r2 = mount_radius, h = stalk_height, $fn = facets);
  646. }
  647. }
  648. // capsule array mount with the right orientation (left front top = #1)0
  649. rotate([0, 0, -90]) translate([0, 0, conn_height + stalk_height]) {
  650. tetra_capsule_array_mount([-45, 135], mount_radius, stalk_wall);
  651. }
  652. }
  653. // components for a wind screen cage
  654. module h2n_wind_screen_old(width) {
  655. *for (m = [0, 1]) mirror([m, 0, 0]) {
  656. translate([width/2, 0, 0]) {
  657. cube([2, 2, 90]);
  658. }
  659. }
  660. for (m = [0, 1]) mirror([0, m, 0]) {
  661. translate([0, 10, 0]) {
  662. rotate([0, 90, 90]) {
  663. half_rounded_box(2, 130, h2n_width_m/2 + mount_radius + h2n_col_wall, 25, 2);
  664. }
  665. }
  666. }
  667. translate([0, 0, 100]) {
  668. rounded_box(2, h2n_width_m/2 + mount_radius + h2n_col_wall, 30, 25, 2);
  669. }
  670. }
  671. // wind screen support modules
  672. module h2n_wind_screen_vertical_ring(diameter, thickness, collar_height) {
  673. radius = diameter / 2;
  674. w = thickness;
  675. // vertical main ring with four slots and half collar
  676. difference() {
  677. union() {
  678. translate([-w, 0, w/2]) {
  679. rotate([0, 90, 0]) {
  680. tube(radius, radius - w, w);
  681. // side locks
  682. for (r = [0, 1]) rotate([0, 0, 90 * r]) {
  683. for (m = [0, 1]) mirror([0, m, 0]) {
  684. translate([-w*1.5, radius - 2*w, 0]) {
  685. cube([w*3, w*1.5, w]);
  686. }
  687. }
  688. }
  689. }
  690. }
  691. }
  692. // cut slots for vertical rings
  693. tube(radius + w, radius - w, w);
  694. translate([0, -w/2, w/2]) {
  695. rotate([0, 90, 90]) {
  696. tube(radius + w, radius - w, w);
  697. }
  698. }
  699. // remove lower cylinder
  700. translate([0, 0, -radius]) {
  701. cylinder(r = h2n_mount_radius + h2n_col_wall, h = 3 * w, $fn = facets);
  702. }
  703. }
  704. // cylindrical attachment to mount
  705. difference() {
  706. union() {
  707. translate([0, 0, -(radius + 5)]) {
  708. tube(h2n_mount_radius + h2n_col_wall, h2n_mount_radius + wall, collar_height);
  709. }
  710. // mount for bottom screws
  711. for (m = [0, 1]) mirror([0, m, 0]) translate([-w, h2n_mount_radius + 2 * wall + 2.0, -(radius)]) {
  712. minkowski() {
  713. rotate([0, 90, 0]) {
  714. cylinder(r = 2.0, h = w, $fn = facets);
  715. }
  716. translate([0, -2, -2]) {
  717. cube([w, 1.5 * w, 4]);
  718. }
  719. }
  720. }
  721. }
  722. // remove half the tube
  723. translate([0, -2 * (h2n_mount_radius + h2n_col_wall), -(radius + collar_height / 2)]) {
  724. cube([h2n_mount_radius + h2n_col_wall, 4 * (h2n_mount_radius + h2n_col_wall), collar_height]);
  725. }
  726. // make holes for screws
  727. for (m = [0, 1]) mirror([0, m, 0]) translate([-w, h2n_mount_radius + 2 * wall + 2.0, -(radius)]) {
  728. rotate([0, 90, 0]) {
  729. cylinder(r = 1.0, h = w, $fn = facets);
  730. }
  731. }
  732. // remove inside mounts
  733. translate([0, 0, -(radius + 5)]) {
  734. cylinder(r = h2n_mount_radius + wall, h = collar_height, $fn = facets);
  735. }
  736. }
  737. }
  738. module h2n_wind_screen_horizontal_ring(diameter, thickness) {
  739. radius = diameter / 2;
  740. w = thickness;
  741. // horizontal ring with two slots
  742. difference() {
  743. union() {
  744. tube(radius, radius - w, w);
  745. // side lock supports
  746. rotate([0, 0, 90]) {
  747. for (m = [0, 1]) mirror([0, m, 0]) {
  748. translate([-w*1.5, radius - 2*w, 0]) {
  749. cube([w*3, w*1.5, w]);
  750. }
  751. }
  752. }
  753. // stops to assemble into vertical ring
  754. for (m = [0, 1]) mirror([0, m, 0]) translate([-2*w, radius - w, w]) {
  755. cube([w, w, w]);
  756. }
  757. }
  758. // cut slot for vertical secondary ring
  759. translate([0, -w/2, w/2]) {
  760. rotate([0, 90, 90]) {
  761. tube(radius + w, radius - w, w);
  762. }
  763. }
  764. // make into an arc (1/2 of the ring)
  765. translate([0, -diameter/2, 0]) {
  766. cube([diameter, diameter, w]);
  767. }
  768. }
  769. }
  770. module h2n_wind_screen_vertical_aux_ring(diameter, thickness) {
  771. radius = diameter / 2;
  772. w = thickness;
  773. difference() {
  774. union() {
  775. translate([0, -w/2, w/2]) {
  776. rotate([0, 90, 90]) {
  777. tube(radius, radius - w, w);
  778. }
  779. }
  780. // stop to assemble into vertical ring
  781. rotate([90, 0, 0]) translate([-2*w, radius - w/2, w/2]) {
  782. cube([w, w, w]);
  783. }
  784. }
  785. // remove lower cylinder
  786. translate([0, 0, -radius]) {
  787. cylinder(r = h2n_mount_radius + h2n_col_wall, h = 3 * w, $fn = facets);
  788. }
  789. // make into an arc (1/2 of the ring)
  790. rotate([0, 90, 90]) translate([-(diameter/2 + w/2), -diameter, -w]) {
  791. cube([diameter, diameter, 2*w]);
  792. }
  793. }
  794. }
  795. // render the whole thing
  796. difference() {
  797. union() {
  798. *h2n_ring(h2n_width_m, h2n_depth_m, h2n_depth * 0.425, h2n_band_height, h2n_col_tilt,
  799. h2n_side_band_w, h2n_side_band, h2n_band_wall, h2n_band_wall, mount_radius, h2n_col_wall);
  800. *h2n_columns(h2n_width_m, h2n_column_height, h2n_band_height, h2n_col_tilt,
  801. transition_height, h2n_mount_radius, h2n_col_wall, wall);
  802. *translate([0, 0, h2n_column_height]) {
  803. h2n_bridge((h2n_width_m / 2 + mount_radius - h2n_col_wall - h2n_column_height * tan(h2n_col_tilt)) * 2,
  804. h2n_bridge_base_height, h2n_bridge_stalk_height, mount_radius, h2n_col_wall, h2n_stalk_wall, wall);
  805. }
  806. *translate([0, 0, h2n_column_height]) {
  807. h2n_bridge_connector((h2n_width_m / 2 + mount_radius - h2n_col_wall - h2n_column_height * tan(h2n_col_tilt)) * 2,
  808. h2n_bridge_base_height, h2n_bridge_stalk_height, mount_radius, h2n_col_wall, h2n_stalk_wall, wall);
  809. }
  810. translate([0, 0, h2n_column_height + 40]) {
  811. h2n_connector_to_array_mount((h2n_width_m / 2 + mount_radius - h2n_col_wall - h2n_column_height * tan(h2n_col_tilt)) * 2,
  812. h2n_stalk_wall);
  813. }
  814. *rotate([0, 0, 90]) {
  815. render_tetra_capsule_array(h2n_column_height + h2n_bridge_base_height + h2n_bridge_stalk_height + 26);
  816. }
  817. translate([0, 0, 100]) {
  818. *h2n_wind_screen_vertical_ring(h2n_width_m, 1.6, 10.0);
  819. *rotate([0, 0, 180]) h2n_wind_screen_vertical_ring(h2n_width_m, 1.6, 10.0);
  820. *h2n_wind_screen_horizontal_ring(h2n_width_m, 1.6);
  821. *h2n_wind_screen_vertical_aux_ring(h2n_width_m, 1.6);
  822. }
  823. *rotate([0, 90, 0])
  824. h2n_wind_screen_vertical_ring(h2n_width_m, 1.6, 10.0);
  825. *h2n_wind_screen_horizontal_ring(h2n_width_m, 1.6);
  826. *rotate([90, 180, 0])
  827. h2n_wind_screen_vertical_aux_ring(h2n_width_m, 1.6);
  828. }
  829. translate([-40, -50, 0]) {
  830. cube([80, 50, 150]);
  831. }
  832. }
  833. // individual capsule holders
  834. *render_tetra_capsule_top(0);
  835. *render_tetra_capsule_bot(0);
  836. // make sure dimensions are fine
  837. *translate([-(h2n_width_m - 0.1) / 2, - 0.5, 0]) {
  838. cube([h2n_width_m - 0.1, 1, 1]);
  839. }
  840. *translate([-0.5, -(h2n_depth_m - 0.1) / 2, 0]) {
  841. cube([1, h2n_depth_m - 0.1, 1]);
  842. }
  843. // some tests with traced profiles
  844. *difference() {
  845. translate([0, -2.5, 0]) {
  846. scale([2.15, 2.15, 1.0]) {
  847. H2N_top_up_outline(5.0);
  848. }
  849. }
  850. // scale([1.75, 1.75, 1.0]) {
  851. translate([0, -2.4, 0]) {
  852. scale([2.02, 2.02, 1.0]) {
  853. H2N_top_up_outline(5.0);
  854. }
  855. }
  856. }
  857. *scale(1.665) {
  858. translate([0, 10, -0]) {
  859. rotate([0, 0, 0]) {
  860. H2N_front_outline(1.0);
  861. }
  862. }
  863. }
  864. *rotate([0, 0, 4]) translate([35, 0, 0])
  865. cube([2, 80, 4]);