1
0

TinySpHEAR_H2N_common.scad 35 KB

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