TinySpHEAR_H2N_common.scad 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  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. // 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. facets = 128;
  34. // dimensions of the EM200 electret microphone capsule (measured 14.59 max)
  35. capsule_radius = 14.6 / 2;
  36. capsule_height = 4.75;
  37. mic_radius = 11;
  38. // adjust the depth of slots in mount
  39. mic_to_mount_fit = -0.4;
  40. // make triangular legs have the height of the capsule
  41. connect = 1;
  42. leg_thick = capsule_height;
  43. // dimensions of H2R recorder
  44. // width and depth at middle of ring
  45. h2n_width = 62.00;
  46. h2n_depth = 42.66;
  47. h2n_width_up = 57.0;
  48. // h2n_column_height = 40;
  49. // h2n_column_height = 25.3;
  50. h2n_column_height = 23.2;
  51. transition_height = 30;
  52. // measured = 11.50, should be 13.1 -> ratio =
  53. h2n_side_band = 1.5;
  54. h2n_side_band_w = 13.4;
  55. // h2n_width_m: tried taking out 0.5mm from the original measurement of 63.0, but
  56. // it is too much and the "Menu" button stops working, 0.25mm seems fine
  57. h2n_width_m = 63.0 - 0.25;
  58. h2n_depth_m = 36.4;
  59. h2n_band_height = 6.0;
  60. // base band width
  61. h2n_band_wall = 1.6;
  62. // wall for the stalk
  63. h2n_stalk_wall = 1.0;
  64. // walls for the columns
  65. h2n_col_wall = 2 * wall;
  66. // tilt for the columnds
  67. h2n_col_tilt = 4.0;
  68. // radius of mount stalk
  69. h2n_mount_radius = mount_radius;
  70. // fit for connector from column to bridge
  71. h2n_mount_fit = 0.04;
  72. // bridge dimensions
  73. h2n_bridge_base_height = 7.0;
  74. h2n_bridge_stalk_height = 45.0;
  75. // bridge base dimensions
  76. h2n_bridge_circle = 24.00;
  77. h2n_bridge_band_w = 13.25;
  78. h2n_bridge_band_h = 3.30; // 26.5 - h2n_column_height;
  79. // we need to make the dial cover slightly elliptical
  80. h2n_bridge_circle_max = 26.5;
  81. h2n_bridge_circle_ratio = h2n_bridge_circle_max / h2n_bridge_circle;
  82. module tube(or, ir, h) {
  83. difference() {
  84. cylinder(r = or, h = h, $fn = facets);
  85. cylinder(r = ir, h = h, $fn = facets);
  86. }
  87. }
  88. // main support ring
  89. module h2n_ring(width, depth, radius, height, tilt, slot_w, slot_d, band_wall, wall, col_rad, col_wall) {
  90. // main support ring
  91. difference() {
  92. conical_rounded_box(height, width / 2 + band_wall, depth / 2 + band_wall, radius - thin_mint, band_wall, height * tan(tilt));
  93. for (m = [0, 1]) mirror([m, 0, 0]) {
  94. translate([-(width / 2 + col_rad - col_wall), 0, 0]) {
  95. tilted_cylinder(col_rad, height, height * tan(tilt));
  96. }
  97. }
  98. }
  99. // inner band
  100. difference() {
  101. conical_rounded_box(height, width / 2 + wall - h2n_side_band, depth / 2 + wall, radius - thin_mint, wall, height * tan(tilt));
  102. for (m = [0, 1]) mirror([m, 0, 0]) {
  103. // cut slots on the sides
  104. translate([-width / 2 - wall / 2, -h2n_side_band_w / 2, 0]) {
  105. cube([width / 2, h2n_side_band_w, height + thin_mint]);
  106. }
  107. }
  108. }
  109. // add TinySpHEAR "branding"
  110. translate([0, -(h2n_depth_m / 2 + band_wall), h2n_band_height / 2]) scale(0.5) {
  111. rotate([90 - h2n_col_tilt, 0, 0]) {
  112. linear_extrude(height = 0.2, center = "true") {
  113. text("TinySpHEAR", size = 8.0, spacing = 1.1, halign = "center", valign = "center", font = "Liberation Sans");
  114. }
  115. }
  116. }
  117. }
  118. // side columns
  119. module tilted_cylinder(radius, height, offset) {
  120. hull() {
  121. cylinder(r = radius, h = thin_mint, $fn = facets);
  122. translate([offset, 0, height]) {
  123. cylinder(r = radius, h = thin_mint, $fn = facets);
  124. }
  125. }
  126. }
  127. module tilted_rounded_box(height, width, depth, radius, wall, offset) {
  128. difference() {
  129. hull() {
  130. rounded_block(thin_mint, width, depth, radius);
  131. translate([offset, 0, height]) {
  132. rounded_block(thin_mint, width, depth, radius);
  133. }
  134. }
  135. hull() {
  136. rounded_block_relative(thin_mint, width, depth, radius, -wall);
  137. translate([offset, 0, height]) {
  138. rounded_block_relative(thin_mint, width, depth, radius, -wall);
  139. }
  140. }
  141. }
  142. }
  143. module conical_rounded_box(height, width, depth, radius, wall, inset) {
  144. difference() {
  145. hull() {
  146. rounded_block(thin_mint, width, depth, radius);
  147. translate([0, 0, height]) {
  148. rounded_block_relative(thin_mint, width, depth, radius, -inset);
  149. }
  150. }
  151. hull() {
  152. rounded_block_relative(thin_mint, width, depth, radius, -wall);
  153. translate([0, 0, height]) {
  154. rounded_block_relative(thin_mint, width, depth, radius, -(wall + inset));
  155. }
  156. }
  157. }
  158. }
  159. module tilted_cube(width, depth, height, offset) {
  160. hull() {
  161. cube([width, depth, thin_mint]);
  162. translate([offset, 0, height]) {
  163. cube([width, depth, thin_mint]);
  164. }
  165. }
  166. }
  167. module tilted_half_rounded_box(height, width, depth, radius, wall, offset, e = 0.1) {
  168. difference() {
  169. tilted_rounded_box(height, width, depth, radius, wall, offset);
  170. translate([0, -(depth + e), 0]) {
  171. tilted_cube(width + e, (depth + e) * 2, height, offset);
  172. }
  173. }
  174. }
  175. module half_rounded_box(height, width, depth, radius, wall, e = 0.1) {
  176. difference() {
  177. rounded_box(height, width , depth, radius, wall);
  178. translate([0, -(depth + e), 0]) {
  179. cube([width + e, 2 * (depth + e), height]);
  180. }
  181. }
  182. }
  183. module h2n_column_core(height, ring_height, tilt, transition, radius, col_wall, wall, offset) {
  184. hull() {
  185. // angled column
  186. difference() {
  187. tilted_cylinder(radius + col_wall + offset, height, height * tan(tilt));
  188. translate([0, -(radius + col_wall + offset), 0]) {
  189. tilted_cube((radius + col_wall) * 2, (radius + col_wall) * 2, height, height * tan(tilt));
  190. }
  191. }
  192. // side sleeves
  193. // we should derive the geometry for the aligment magic below...
  194. side_fit = 0.5;
  195. translate([(radius + col_wall) / 2 + 2 * wall - side_fit, 0, 0]) {
  196. difference() {
  197. tilted_half_rounded_box(height, 3.8 + offset, h2n_side_band_w / 2 + wall + offset * 1.1,
  198. 2.0, wall, height * tan(tilt));
  199. translate([col_wall / 2 + wall - radius * 3 / 2 - side_fit, 0, 0]) {
  200. tilted_cylinder(radius, height, height * tan(tilt));
  201. }
  202. }
  203. }
  204. }
  205. }
  206. module h2n_column(height, ring_height, tilt, transition, radius, col_wall, wall) {
  207. // side tubes for cables
  208. difference() {
  209. h2n_column_core(height, ring_height, tilt, transition, radius, col_wall, wall, 0);
  210. // hollow out the cylinder
  211. tilted_cylinder(radius, height, height * tan(tilt));
  212. // this fine adjustment determines how much the side walls "hug" the H2N
  213. width_fit = 0.2;
  214. translate([radius + 2 * wall - width_fit, 0, 0]) {
  215. tilted_half_rounded_box(height + thin_mint, 3.8, h2n_side_band_w / 2, 1.5, 4 * wall, height * tan(tilt));
  216. }
  217. // trim side of tubes with a vertical plane
  218. translate([-(radius * 2 + col_wall) + col_wall / 2, -(radius + col_wall), 0]) {
  219. cube([col_wall * 2, (radius + col_wall) * 2, 30]);
  220. }
  221. }
  222. // add a thicker wall at the bottom of the side trim
  223. difference() {
  224. translate([-(radius), -(radius + col_wall), 0]) {
  225. cube([wall, (radius + col_wall) * 2, height]);
  226. }
  227. difference() {
  228. tilted_cylinder(radius * 4, height, height * tan(tilt));
  229. tilted_cylinder(radius + col_wall, height, height * tan(tilt));
  230. }
  231. }
  232. // connector to bridge
  233. translate([height * tan(tilt), 0, height]) {
  234. connector_height = 5.0;
  235. difference() {
  236. union() {
  237. difference() {
  238. union() {
  239. cylinder(r = radius + wall - h2n_mount_fit, h = connector_height, $fn = facets);
  240. h2n_column_core(h2n_bridge_band_h, ring_height, 0, transition, radius, col_wall, wall, -(wall + h2n_mount_fit));
  241. }
  242. cylinder(r = radius, h = connector_height, $fn = facets);
  243. translate([1.5, -(radius + wall) * 2, 0]) {
  244. cube([radius + wall, (radius + wall) * 4, connector_height]);
  245. }
  246. }
  247. // add anchor for retaining screw
  248. difference() {
  249. translate([-radius, 0, radius]) {
  250. sphere(r = radius * 2/3, $fn = facets);
  251. }
  252. // and clip out the rest of the sphere
  253. difference() {
  254. cylinder(r = 2 * radius + wall, h = height);
  255. cylinder(r = radius + wall - h2n_mount_fit, h = height);
  256. }
  257. translate([0, 0, connector_height]) {
  258. cylinder(r = radius + wall, h = connector_height);
  259. }
  260. }
  261. }
  262. // make hole for screw
  263. translate([-(radius + 2 * wall), 0, radius]) {
  264. rotate([0, 90, 0]) {
  265. cylinder(r = 0.5, h = radius + wall, $fn = facets);
  266. }
  267. }
  268. }
  269. }
  270. }
  271. module h2n_columns(width, height, ring_height, tilt, transition, radius, col_wall, wall) {
  272. for (m = [0, 1]) mirror([m, 0, 0]) {
  273. translate([-(width / 2 + col_wall - wall / 2), 0, 0]) {
  274. h2n_column(height, ring_height, tilt, transition, radius, col_wall, wall);
  275. }
  276. }
  277. }
  278. // old version of columns
  279. module h2n_columns_old(width, height, ring_height, tilt, transition, radius, col_wall, wall) {
  280. // side tubes for cables
  281. slot_height = 25.0;
  282. for (m = [0, 1]) mirror([m, 0, 0]) {
  283. translate([-(width / 2 + radius - col_wall), 0, 0]) {
  284. difference() {
  285. // angled column
  286. tilted_cylinder(radius + col_wall, height, height * tan(tilt));
  287. tilted_cylinder(radius, height, height * tan(tilt));
  288. // slots in the columns for cables
  289. translate([radius - col_wall - ring_height * tan(tilt), - radius * 2, -ring_height]) {
  290. rotate([0, tilt, 0]) {
  291. cube([5.0, radius * 4, slot_height]);
  292. translate([radius + col_wall, radius - col_wall, slot_height]) {
  293. rotate([0, 90, 90]) {
  294. cylinder(r = radius + col_wall, h = 15.0, $fn = facets);
  295. }
  296. }
  297. }
  298. }
  299. // trim side of tubes with a vertical plane
  300. translate([-(radius * 2 + col_wall) + col_wall / 2, -(radius + col_wall), 0]) {
  301. cube([col_wall * 2, (radius + col_wall) * 2, 30]);
  302. }
  303. }
  304. // add a thicker wall at the bottom of the side trim
  305. difference() {
  306. translate([-(radius), -(radius + col_wall), 0]) {
  307. cube([wall, (radius + col_wall) * 2, height]);
  308. }
  309. difference() {
  310. tilted_cylinder(radius * 4, height, height * tan(tilt));
  311. tilted_cylinder(radius + col_wall, height, height * tan(tilt));
  312. }
  313. }
  314. }
  315. // connector to bridge
  316. translate([-(width / 2 + radius - col_wall - height * tan(tilt)), 0, height]) {
  317. connector_height = 5.0;
  318. difference() {
  319. tube(radius + wall - h2n_mount_fit, radius, connector_height);
  320. translate([0, -(radius + wall), connector_height / 2]) {
  321. cube([radius + wall, (radius + wall) * 2, connector_height / 2]);
  322. }
  323. }
  324. }
  325. // side sleeves
  326. sleeve_height = slot_height;
  327. // XXX sleeve_height = slot_height - mount_radius - col_wall;
  328. for (m = [0, 1]) mirror([m, 0, 0]) {
  329. // we should derive the geometry for the aligment magic below...
  330. side_fit = 1.05;
  331. translate([-(width / 2 - (radius + col_wall) / 2 + wall - side_fit), 0, 0]) {
  332. difference() {
  333. tilted_half_rounded_box(sleeve_height, 3.8, h2n_side_band_w / 2 + wall, 2.0, wall, sleeve_height * tan(tilt));
  334. translate([col_wall / 2 + wall - radius * 3 / 2 - side_fit, 0, 0]) {
  335. tilted_cylinder(radius, height, height * tan(tilt));
  336. }
  337. }
  338. }
  339. }
  340. }
  341. }
  342. // bridge that connects to capsule array
  343. module semi_cylinder(r, h, e = thin_mint) {
  344. difference() {
  345. cylinder(h, r, r, $fn = facets);
  346. translate ([-r*2, -r, 0])
  347. cube([2*(r+e), 2*(r+e), h]);
  348. }
  349. }
  350. module quarter_sphere(r, e = thin_mint) {
  351. difference() {
  352. sphere(r, $fn = facets);
  353. translate([-(r+e), -(r+e), -(r+e)])
  354. cube([2*(r+e), 2*(r+e), r+e]);
  355. translate([-(r+e), -(r+e), -e])
  356. cube([r, 2*(r+e), (r+e)]);
  357. }
  358. }
  359. module cylcube(width, depth, height, wall) {
  360. difference() {
  361. semi_cylinder(r = depth, h = height);
  362. semi_cylinder(r = depth - wall, h = height);
  363. }
  364. translate([-(width + depth / 2), -depth, 0]) {
  365. difference() {
  366. cube([(width + depth / 2), depth * 2, height]);
  367. translate([0, wall, 0]) {
  368. cube([(width + depth), (depth - wall) * 2, height]);
  369. }
  370. }
  371. }
  372. }
  373. // old version of the bridge
  374. module h2n_bridge_old(width, base_height, stalk_height, radius, col_wall, wall) {
  375. // capsule array mount with the right orientation (left front top = #1)
  376. rotate([0, 0, -90]) translate([0, 0, base_height + stalk_height]) {
  377. tetra_capsule_array_mount([-45, 135]);
  378. }
  379. // stalk
  380. translate([0, 0, base_height]) {
  381. difference() {
  382. tube(radius + wall, radius, stalk_height);
  383. // remove stalk segment that is inside the bridge
  384. translate([width / 2, 0, -1.0]) {
  385. rotate([0, -90, 0]) {
  386. semi_cylinder(r = radius + col_wall, h = width);
  387. }
  388. }
  389. }
  390. // add marker for "back of microphone" orientation
  391. rotate([0, 0, 0]) {
  392. translate([0, radius + wall - wall * 2 / 3, stalk_height - radius]) {
  393. difference() {
  394. sphere(r = radius / 3, $fn = 32);
  395. translate([0, -radius + radius / 2, 0]) {
  396. cube([radius, radius, radius], center = true);
  397. }
  398. }
  399. }
  400. }
  401. }
  402. // top of bridge
  403. translate([width / 2, 0, base_height]) {
  404. rotate([0, -90, 0]) {
  405. difference() {
  406. // curvy ceiling
  407. semi_cylinder(r = radius + col_wall, h = width);
  408. semi_cylinder(r = radius + col_wall - wall, h = width);
  409. // make a hole for the cables
  410. translate([0, 0, width / 2]) {
  411. rotate([0, 90, 0]) {
  412. cylinder(r = radius, h = 10, $fn = facets);
  413. }
  414. }
  415. }
  416. }
  417. }
  418. // caps at ends
  419. for (m = [0, 1]) mirror([m, 0, 0]) {
  420. translate([width / 2, 0, base_height]) {
  421. difference() {
  422. quarter_sphere(r = radius + col_wall);
  423. quarter_sphere(r = radius + col_wall - wall);
  424. }
  425. }
  426. }
  427. // base of bridge
  428. translate([0, 0, 0]) {
  429. for (m = [0, 1]) mirror([m, 0, 0]) {
  430. translate([width / 2, 0, 0]) {
  431. cylcube(width / 2, radius + col_wall, base_height, wall);
  432. }
  433. }
  434. }
  435. // reinforcement beams at the base
  436. translate([-col_wall / 2, -(radius + wall), 0]) {
  437. cube([col_wall, (radius + wall) * 2, col_wall]);
  438. }
  439. for (m = [0, 1]) mirror([m, 0, 0]) {
  440. translate([-width / 2 + radius + wall, -(radius + wall), 0]) {
  441. cube([col_wall, (radius + wall) * 2, col_wall]);
  442. }
  443. }
  444. }
  445. // base plate for upper band cover
  446. module h2n_center_cover(width, base_height, stalk_height, radius, col_wall, wall, offset) {
  447. bot_step = h2n_bridge_band_h;
  448. difference() {
  449. union() {
  450. for (m = [0, 1]) mirror([m, 0, 0]) {
  451. // core of bridge
  452. translate([width/2, -thin_mint / 2, 0]) {
  453. cylcube(width / 2 + offset, radius + offset + 2 * wall, bot_step, wall);
  454. }
  455. // we should derive the geometry for the aligment magic below...
  456. side_fit = 1.05;
  457. corner_radius = 2.0;
  458. tilted_half_rounded_box(bot_step, width / 2 + offset - wall / 2, h2n_side_band_w / 2 + offset + wall,
  459. corner_radius, wall, 0);
  460. }
  461. }
  462. // clear the inside
  463. // outer frame
  464. rounded_block(bot_step + thin_mint, width / 2 + offset - 1.5 * wall, h2n_side_band_w / 2 + offset, 2);
  465. // inner frame
  466. translate([-(width + offset) / 2, -(radius + wall + offset), 0]) {
  467. cube([width + offset, (radius + wall + offset) * 2, bot_step + thin_mint]);
  468. }
  469. }
  470. }
  471. // base plate for upper center dial cover
  472. module h2n_center_dial_cover(radius, wall, offset) {
  473. scale([h2n_bridge_circle_ratio, 1, 1]) {
  474. tube(radius + wall + offset, radius + offset, h2n_bridge_band_h);
  475. }
  476. }
  477. // the core of the bridge, a solid offset-able version
  478. module h2n_bridge_core(width, base_height, stalk_height, radius, col_wall, wall, offset) {
  479. hull() {
  480. // top of bridge
  481. translate([width / 2, 0, base_height]) {
  482. rotate([0, -90, 0]) {
  483. // curvy ceiling
  484. semi_cylinder(r = radius + offset + col_wall, h = width + offset);
  485. }
  486. }
  487. // spherical caps at ends
  488. for (m = [0, 1]) mirror([m, 0, 0]) {
  489. translate([width / 2, 0, base_height]) {
  490. quarter_sphere(r = radius + offset + col_wall);
  491. }
  492. }
  493. // bottom plate
  494. h2n_center_cover(width, base_height, stalk_height, radius, col_wall, wall, offset);
  495. }
  496. // add cover for center dial
  497. hull() {
  498. cylinder(r = mount_radius + offset, h = base_height + radius, $fn = facets);
  499. h2n_center_dial_cover(h2n_bridge_circle / 2, wall, offset);
  500. }
  501. }
  502. // the bridge that holds the capsule array
  503. module h2n_bridge(width, base_height, stalk_height, radius, col_wall, stalk_wall, wall) {
  504. // capsule array mount with the right orientation (left front top = #1)0
  505. rotate([0, 0, -90]) translate([0, 0, base_height + stalk_height]) {
  506. tetra_capsule_array_mount([-45, 135], mount_radius, stalk_wall);
  507. }
  508. difference() {
  509. union() {
  510. h2n_bridge_core(width, base_height, stalk_height, radius, col_wall, wall, 0);
  511. // stalk
  512. translate([0, 0, base_height]) {
  513. difference() {
  514. tube(radius + stalk_wall, radius, stalk_height);
  515. // remove stalk segment that is inside the bridge
  516. translate([width / 2, 0, -1.0]) {
  517. rotate([0, -90, 0]) {
  518. semi_cylinder(r = radius + stalk_wall, h = width);
  519. }
  520. }
  521. }
  522. // add marker for "back of microphone" orientation
  523. rotate([0, 0, 0]) {
  524. translate([0, radius + stalk_wall - stalk_wall * 2 / 3, stalk_height - (radius + stalk_wall)]) {
  525. difference() {
  526. sphere(r = (radius + stalk_wall) / 3, $fn = 64);
  527. translate([0, -(radius + stalk_wall) + (radius + stalk_wall) / 2, 0]) {
  528. cube([radius + stalk_wall, radius + stalk_wall, radius + stalk_wall], center = true);
  529. }
  530. }
  531. }
  532. }
  533. }
  534. // small supports for the screws that attach to the columns
  535. for (m = [0, 1]) mirror([m, 0, 0]) {
  536. translate([-(width / 2 + radius + 2 * wall), 0, radius]) {
  537. rotate([0, 90, 0]) {
  538. cylinder(r = 1.5, h = 2 * wall, $fn = facets);
  539. }
  540. }
  541. }
  542. }
  543. h2n_bridge_core(width, base_height, stalk_height, radius, col_wall, wall, -wall);
  544. // make a hole in the bridge for the cables
  545. cylinder(r = radius, h = base_height + radius + 2 * wall, $fn = facets);
  546. // cut a window for the XY and MS leds
  547. translate([0, h2n_bridge_circle_max, 0]) {
  548. rotate([90, 0, 0]) cylinder(r = 2.0, h = h2n_bridge_circle_max * 2, $fn = facets);
  549. }
  550. // holes for screws that attach to the columns
  551. translate([-(width + 3 * radius + 2 * wall) / 2, 0, radius]) {
  552. rotate([0, 90, 0]) {
  553. cylinder(r = 0.5, h = width + 4 * radius, $fn = facets);
  554. }
  555. }
  556. }
  557. }
  558. // render the whole thing
  559. difference() {
  560. union() {
  561. *h2n_ring(h2n_width_m, h2n_depth_m, h2n_depth * 0.425, h2n_band_height, h2n_col_tilt,
  562. h2n_side_band_w, h2n_side_band, h2n_band_wall, h2n_band_wall, mount_radius, h2n_col_wall);
  563. *h2n_columns(h2n_width_m, h2n_column_height, h2n_band_height, h2n_col_tilt,
  564. transition_height, h2n_mount_radius, h2n_col_wall, wall);
  565. *translate([0, 0, h2n_column_height]) {
  566. h2n_bridge((h2n_width_m / 2 + mount_radius - h2n_col_wall - h2n_column_height * tan(h2n_col_tilt)) * 2,
  567. h2n_bridge_base_height, h2n_bridge_stalk_height, mount_radius, h2n_col_wall, h2n_stalk_wall, wall);
  568. }
  569. *rotate([0, 0, 90]) {
  570. render_tetra_capsule_array(h2n_column_height + h2n_bridge_base_height + h2n_bridge_stalk_height + 26);
  571. }
  572. }
  573. *translate([-40, -50, 0]) {
  574. cube([80, 50, 80]);
  575. }
  576. }
  577. // individual capsule holders
  578. *render_tetra_capsule_top(0);
  579. *render_tetra_capsule_bot(0);
  580. // make sure dimensions are fine
  581. *translate([-(h2n_width_m - 0.1) / 2, - 0.5, 0]) {
  582. cube([h2n_width_m - 0.1, 1, 1]);
  583. }
  584. *translate([-0.5, -(h2n_depth_m - 0.1) / 2, 0]) {
  585. cube([1, h2n_depth_m - 0.1, 1]);
  586. }
  587. // some tests with traced profiles
  588. *difference() {
  589. translate([0, -2.5, 0]) {
  590. scale([2.15, 2.15, 1.0]) {
  591. H2N_top_up_outline(5.0);
  592. }
  593. }
  594. // scale([1.75, 1.75, 1.0]) {
  595. translate([0, -2.4, 0]) {
  596. scale([2.02, 2.02, 1.0]) {
  597. H2N_top_up_outline(5.0);
  598. }
  599. }
  600. }
  601. *scale(1.665) {
  602. translate([0, 10, -0]) {
  603. rotate([0, 0, 0]) {
  604. H2N_front_outline(1.0);
  605. }
  606. }
  607. }
  608. *rotate([0, 0, 4]) translate([35, 0, 0])
  609. cube([2, 80, 4]);