1
0

TinySpHEAR_H2N_common.scad 21 KB

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