1
0

TinySpHEAR_H2N_common.scad 23 KB

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