SpHEAR_common.scad 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. //
  2. // Spherical Harmonics Ear Project (*SpHEAR)
  3. //
  4. // Common Modules and Variables
  5. //
  6. // Copyright 2015-2017, Fernando Lopez-Lezcano, All Rights Reserved
  7. // nando@ccrma.stanford.edu
  8. //
  9. // This program is free software: you can redistribute it and/or modify
  10. // it under the terms of the GNU General Public License as published by
  11. // the Free Software Foundation, either version 3 of the License, or
  12. // (at your option) any later version.
  13. //
  14. // This program is distributed in the hope that it will be useful,
  15. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. // GNU General Public License for more details.
  18. //
  19. // You should have received a copy of the GNU General Public License
  20. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. //
  22. // 3d Models released under the Creative Commons license as follows:
  23. // Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
  24. // http://creativecommons.org/licenses/by-nc-sa/4.0/
  25. ////
  26. //// default model parameters
  27. ////
  28. // microphone capsule array
  29. //
  30. // dimensions of the electret microphone capsule
  31. capsule_radius = 5;
  32. capsule_height = 4.5;
  33. // height and width of capsule stop ring
  34. capsule_ring_h = 0.4;
  35. capsule_ring_w = 0.5;
  36. // wall thickness of the capsule holder
  37. wall = 1;
  38. // distance between the face of a capsule and the center of array
  39. mic_radius = 9.6;
  40. // dimensions of the capsule holder connection legs
  41. // a width of 4mm is too thin, 5mm prints better
  42. leg_width = 5;
  43. leg_thick = 1.75;
  44. // width of the ridge that connects to the mount
  45. ridge_width = 2.0;
  46. ridge_slot_width = 2.0;
  47. // depth of the connector mount ridge
  48. ridge_depth = 3.0;
  49. // add to the thickness of ridges
  50. ridge_wfit = 0.1;
  51. ridge_hfit = 3;
  52. // microphone mount
  53. //
  54. mount_radius = 3.5;
  55. mount_wall = 0.75;
  56. // height and eccentricity of top connector
  57. mount_top_height = 10.0;
  58. mount_top_eccentricity = 1.3;
  59. // height of mount
  60. mount_height = 40;
  61. // microphone stand mount
  62. //
  63. // diameter of existing shielded wires (x 4)
  64. mic_wire_diam = 1.5;
  65. mic_wire_fit = 0.8;
  66. mic_wire_hole_radius = 3.0;
  67. mic_wire_hole_offset = 5;
  68. // standard microphone stand
  69. // measured diameter = 13.5, inside diameter of sleeve = 13.79 (
  70. mic_mount_radius = 13.50 / 2;
  71. // add this to inside diameter
  72. mic_mount_fit = 0.2;
  73. mic_mount_slot_height = 11.5;
  74. mic_mount_slot_width = 4.25;
  75. mic_mount_slot_radius = 6.25 / 2;
  76. mic_mount_wall = 1.5;
  77. mic_mount_height = 20.0 + mic_wire_hole_offset + mic_wire_hole_radius + 2 * mic_mount_wall;
  78. //// end of model parameters
  79. ////
  80. //// rendering control
  81. // what type of connection to use between capsule holders:
  82. // 0 -> original cylindrical angled legs
  83. // 1 -> interlocking horizontal legs with triangular top (only works with small radius)
  84. // 2 -> interlocking horizontal legs
  85. // 3 -> interlocking vertical legs
  86. connect = 1;
  87. // how many mount ridges to create
  88. // 0 -> no ridges
  89. // 1 -> 1 ridge
  90. // 2 -> 2 ridges
  91. ridges = 1;
  92. //// end of rendering control
  93. ////
  94. // adjustment for the inner radius of the capsule holder
  95. // measured inside diameter of a trial print was around 7.5 to 8.2
  96. // instead of 10, capsule diameter was 9.99)
  97. fudge = 0.12;
  98. // adjustment for fit of slots in connection legs and mount
  99. // 0.1: initial setting
  100. // 0.1 ->0.15: Ultimaker 2 + Extended plus APL (2016.06.17)
  101. // 0.15->0.10 (2017.01.21)
  102. fit = 0.08;
  103. // number of facets for rendering cylinders
  104. facets = 64;
  105. // render capsule holders with better resolution
  106. cfacets = 128;
  107. // "a wafer-thin mint..."
  108. // something to use when we need tiny 3d slivers
  109. thin_mint = 0.001;
  110. ////////
  111. // microphone capsule holder
  112. // mounts: vectors containing the angle of the mount and the angle to the adjacent capsule
  113. // twist: rotate the whole capsule to match mounting legs
  114. // ridge: add 0, 1 or 2 ridges for attaching the structure to the mount
  115. // ridge_wfit: tune the fit, used for carving slots in mount
  116. // ridge_hfit: adjust height of ridges when carving out the capsule rests
  117. // solid: make the capsule holder solid, used in the mount code to carve the capsule rests
  118. module capsule (mounts, twist, ridge, ridge_wfit = 0.0, ridge_hfit = 0.0, solid = 0) {
  119. capsule_h = capsule_height + capsule_ring_h;
  120. difference () {
  121. union () {
  122. // main capsule holder
  123. cylinder(r = capsule_radius + wall, h = capsule_h, $fn = cfacets);
  124. // the mounting legs
  125. for (angles = mounts) {
  126. rotate([0, 0, angles[0] + twist]) {
  127. // disable rendering of the connection legs if the array radius is too
  128. // small and components of adyacent capsule holders touch each other
  129. //
  130. leg_height = leg_thick;
  131. // make sure capsule holders do not touch
  132. render_legs = ((mic_radius - capsule_height) / tan(angles[1])) - capsule_radius - wall -
  133. // and make sure connection leg does not touch adyacent capsule holder
  134. (angles[1] > 45 ? leg_height * tan(2 * angles[1] - 90) + 2 * fit : 0.0);
  135. //
  136. // connect with cylindrical beams, very pretty, not printable
  137. if (connect == 0 && render_legs >= 0) {
  138. leg_length = mic_radius * cos(angles[1]) - capsule_radius * sin(angles[1]);
  139. translate([capsule_radius - wall, 0, capsule_height - wall]) {
  140. rotate([0, 180 - angles[1], 0]) {
  141. cylinder(d = leg_width, h = leg_length - 0.3, center = false, $fn = facets);
  142. }
  143. }
  144. }
  145. // connect with horizontal legs with triangular top (the best by far)
  146. if (connect == 1 && render_legs >= 0) {
  147. leg_length = capsule_radius + wall + capsule_height * tan(angles[1]) - fit;
  148. leg_w = (solid != 0)? leg_width + fit : leg_width;
  149. slot_radius = (mic_radius - capsule_height) / tan(angles[1]);
  150. translate([0, 2 * (- leg_w / 3), 0]) {
  151. difference() {
  152. cube([leg_length, leg_w + leg_w / 3, capsule_height]);
  153. // cut slots that lock with adyacent leg
  154. if (solid == 0) {
  155. for (offset = [1, 3]) {
  156. translate([slot_radius - 1 * fit, leg_w / offset - fit / 2, 0]) {
  157. rotate([0, 90 - angles[1] * 2, 0]) translate([0, 0, - capsule_height])
  158. cube([leg_length, leg_w / 3 + fit, capsule_height * 2]);
  159. }
  160. }
  161. }
  162. // shave triangular slice of fingers, starts at edge of capsule holder
  163. translate([capsule_radius + wall, 0, leg_height]) {
  164. rotate([0, 90 - angles[1], 0]) {
  165. cube([leg_length, leg_w + leg_w / 3, capsule_height]);
  166. }
  167. }
  168. // and remove the rest when the leg height is less than the capsule height
  169. translate([0, - 2 * (- leg_w / 3), leg_height]) {
  170. difference() {
  171. cylinder(r = capsule_radius + leg_length, h = capsule_height, $fn = facets);
  172. cylinder(r = capsule_radius + wall, h = capsule_height, $fn = facets);
  173. }
  174. }
  175. }
  176. }
  177. }
  178. // connect with horizontal legs with triangular top (testing for octathingy)
  179. if (connect == 4 && render_legs >= 0) {
  180. leg_h = leg_height * angles[3];
  181. // legs are not long enough for long ones in octathingy... add 1.0
  182. leg_length = capsule_radius + wall + capsule_height * tan(angles[1] + angles[2]) - fit + 1.0;
  183. leg_w = (solid != 0)? leg_width + fit : leg_width;
  184. slot_radius = (mic_radius - capsule_height) / tan(angles[1] + angles[2]);
  185. translate([0, 2 * (- leg_w / 3), 0]) {
  186. difference() {
  187. cube([leg_length, leg_w + leg_w / 3, capsule_height]);
  188. // cut slots that lock with adyacent leg
  189. if (solid == 0) {
  190. for (offset = [1, 3]) {
  191. translate([slot_radius - 1 * fit, leg_w / offset - fit / 2, 0]) {
  192. rotate([0, 90 - (angles[1] + angles[2]) * 2, 0]) translate([0, 0, - capsule_height])
  193. cube([leg_length, leg_w / 3 + fit, capsule_height * 2]);
  194. }
  195. }
  196. }
  197. // shave triangular slice of fingers, starts at edge of capsule holder
  198. translate([capsule_radius + wall, 0, leg_h]) {
  199. rotate([0, 90 - (angles[1] + angles[2]), 0]) {
  200. cube([leg_length, leg_w + leg_w / 3, capsule_height]);
  201. }
  202. }
  203. // and remove the rest when the leg height is less than the capsule height
  204. translate([0, - 2 * (- leg_w / 3), leg_h]) {
  205. difference() {
  206. cylinder(r = capsule_radius + leg_length, h = capsule_height, $fn = facets);
  207. cylinder(r = capsule_radius + wall, h = capsule_height, $fn = facets);
  208. }
  209. }
  210. }
  211. }
  212. }
  213. // connect with horizontal legs
  214. if (connect == 2 && render_legs >= 0) {
  215. leg_length = (mic_radius - capsule_height + leg_thick) * tan(90 - angles[1]);
  216. slot_depth = leg_thick / cos(90 - 2 * angles[1]);
  217. slot_xtra_depth = (angles[1] < 45) ? (leg_thick * tan(90 - 2 * angles[1])) : 0.0;
  218. translate([0, - leg_width / 3, 0]) {
  219. difference() {
  220. cube([leg_length, leg_width, leg_thick]);
  221. // cut slot in connector
  222. translate([leg_length - slot_depth - slot_xtra_depth - fit, leg_width / 3 - (fit / 2), 0]) {
  223. cube([slot_depth + slot_xtra_depth + fit, leg_width / 3 + fit, leg_thick]);
  224. }
  225. }
  226. }
  227. }
  228. // connect with vertical legs
  229. if (connect == 3 && render_legs >= 0) {
  230. // fix this 0.2 == (2 * fudge?)
  231. leg_length = (mic_radius * tan(90 - angles[1]) - capsule_radius) * tan(angles[1]) - 0.2;
  232. slot_depth = leg_thick * cos (90 - (2 * angles[1]));
  233. translate([capsule_radius - leg_thick / 2 + fudge, - leg_width / 3,
  234. - leg_length + capsule_height]) {
  235. difference() {
  236. // the connection
  237. difference() {
  238. cube([leg_thick + leg_thick / 2, leg_width, leg_length]);
  239. translate([-leg_thick + wall - fudge, 0, - capsule_height + fudge]) {
  240. cube([leg_thick, leg_width, leg_length]);
  241. }
  242. }
  243. // cut slot in connector
  244. translate([0, leg_width / 3 - (fit / 2), 0]) {
  245. cube([leg_thick + leg_thick / 2, leg_width / 3 + fit, slot_depth]);
  246. }
  247. }
  248. }
  249. }
  250. }
  251. }
  252. // add ridges for microphone mount
  253. ridge_length = (mic_radius - capsule_height) / tan(elev_angle) - (capsule_radius + wall);
  254. if (ridge == 2) {
  255. rotate([0, 0, twist]) {
  256. translate([capsule_radius + wall - ridge_length / 2, (ridge_width + ridge_wfit) / 2, 0]) {
  257. cube([ridge_length * 3 / 2, ridge_width + ridge_wfit, capsule_h + ridge_hfit], center = false);
  258. }
  259. translate([capsule_radius + wall - ridge_length / 2, - (ridge_width + ridge_wfit) * 3 / 2, 0]) {
  260. cube([ridge_length * 3 / 2, ridge_width + ridge_wfit, capsule_h + ridge_hfit], center = false);
  261. }
  262. }
  263. }
  264. if (ridge == 1) {
  265. rotate([0, 0, twist]) {
  266. difference() {
  267. translate([capsule_radius + wall / 2, - (ridge_width + ridge_wfit) / 2, 0]) {
  268. cube([ridge_depth + wall / 2, ridge_width + ridge_wfit, capsule_h + ridge_hfit], center = false);
  269. }
  270. translate([capsule_radius + wall + ridge_length, - (ridge_width + ridge_wfit) / 2, 0]) {
  271. rotate([0, elev_angle, 0]) {
  272. cube([ridge_depth, ridge_width + ridge_wfit, capsule_h * 2], center = false);
  273. }
  274. }
  275. }
  276. }
  277. }
  278. }
  279. if (solid != 1) {
  280. // make the hole for the capsule
  281. translate ([0, 0, capsule_ring_h]) {
  282. cylinder(r = capsule_radius + fudge, h = capsule_h + thin_mint, $fn = cfacets);
  283. }
  284. if (connect == 3) {
  285. // cut vertical leg overhang below capsule
  286. translate ([0, 0, -capsule_h]) {
  287. cylinder(r = capsule_radius + fudge, h = capsule_h, $fn = cfacets);
  288. }
  289. }
  290. if (connect != 3) {
  291. // leave ridge at bottom for horizontal legs only
  292. cylinder(r = capsule_radius + fudge - capsule_ring_w, h = capsule_h + thin_mint, $fn = cfacets);
  293. }
  294. }
  295. // remove any extra connecting beam material from the face of the holder
  296. if (connect == 0) {
  297. translate ([0, 0, capsule_h]) {
  298. cylinder(r = capsule_radius + wall * 2, h = 2, $fn = cfacets);
  299. }
  300. }
  301. }
  302. }
  303. //// shared modules for zapnspark printed circuit board
  304. // one printed circuit board
  305. module pcb(length, width, thick) {
  306. translate([-width/2, 0, 0]) {
  307. cube([width, thick, length]);
  308. }
  309. }
  310. // one printed circuit board with space in the front and back for components
  311. module pcb_clear(length, width, thick, slot_depth, front, back) {
  312. translate([0, - (thick + front)]) {
  313. pcb(length, width, thick);
  314. // clear space in the front
  315. translate([- (width/2 - slot_depth), thick, 0]) {
  316. cube([width - 2 * slot_depth, front, length]);
  317. }
  318. // clear space in the back
  319. translate([- (width/2 - slot_depth), - back, 0]) {
  320. cube([width - 2 * slot_depth, back, length]);
  321. }
  322. }
  323. }
  324. //// shared modules for mount
  325. // rectangular block with rounded corners
  326. module rounded_block(height, width, depth, radius) {
  327. dw = width - radius;
  328. dd = depth - radius;
  329. minkowski() {
  330. translate([-dw, -dd, 0]) {
  331. cube([dw * 2, dd * 2, height / 2]);
  332. }
  333. cylinder(r = radius, h = height / 2, $fn = facets);
  334. }
  335. }
  336. // rectangular inset block with rounded corners
  337. module rounded_block_relative(height, ref_width, ref_depth, ref_corner, radius_inc) {
  338. corner = ref_corner * ((ref_width + radius_inc) / ref_width);
  339. rounded_block(height, ref_width + radius_inc, ref_depth + radius_inc, corner);
  340. }
  341. // box with rounded corners
  342. module rounded_box(height, width, depth, radius, wall) {
  343. iradius = radius * ((width - wall) / width);
  344. difference() {
  345. rounded_block(height, width, depth, radius);
  346. rounded_block(height, width - wall, depth - wall, iradius);
  347. }
  348. }
  349. //// shared modules for shock mount
  350. // eyelet for connecting the external ring to the stand mount
  351. module shock_mount_ring(outside_radius, inside_radius, thickness) {
  352. difference() {
  353. union() {
  354. cylinder(r = outside_radius, h = thickness, $fn = facets);
  355. translate([0, -outside_radius, 0]) {
  356. cube([outside_radius, outside_radius, thickness]);
  357. }
  358. }
  359. cylinder(r = inside_radius, h = thickness, $fn = facets);
  360. }
  361. }
  362. // one eyelet for connection to shock mount or permanent mount
  363. module mount_stand_eyelet(outside_radius, inside_radius, thickness) {
  364. translate([0, thickness/2, 0]) rotate([90, 0, 0])
  365. difference() {
  366. cylinder(r = outside_radius, h = thickness, $fn = facets);
  367. cylinder(r = inside_radius, h = thickness, $fn = facets);
  368. }
  369. }
  370. // connector to shock mount or permanent mount (upper part)
  371. module mount_connector_top(height, o_radius, i_radius, offset) {
  372. // eyelets
  373. o_rad = 8;
  374. i_rad = 3;
  375. thk = 4;
  376. // screw head and nut dimensions
  377. head_thick = 3.0;
  378. head_diam = 9.2;
  379. nut_radius = 12/2;
  380. // offset
  381. h_offset = offset;
  382. difference() {
  383. hull() {
  384. for (m = [0, 1]) mirror([0, m, 0]) {
  385. translate([0, thk * 3/2, height + o_rad + h_offset]) {
  386. mount_stand_eyelet(o_rad, i_rad, thk);
  387. }
  388. }
  389. translate([0, 0, height]) {
  390. difference() {
  391. cylinder(r = o_radius, h = thin_mint, $fn = facets);
  392. }
  393. }
  394. }
  395. // make hole for screw
  396. translate([0, mic_mount_radius * 2, height + h_offset + o_rad]) {
  397. rotate([90, 0, 0]) cylinder(r = i_rad, h = mic_mount_radius * 4, $fn = facets);
  398. }
  399. // clear the space between eyelets
  400. translate([-o_rad * 2, -thk/2, height + h_offset/2]) {
  401. cube([o_rad * 4, thk, o_rad * 4]);
  402. }
  403. // hollow top
  404. translate([0, 0, height]) {
  405. scale([1.0, 1.0, 1.2]) sphere(r = i_radius, $fn = facets);
  406. }
  407. // recessed hexagonal screw head on one side
  408. translate([0, -3/2*thk, height + h_offset + o_rad]) {
  409. rotate([90, 30, 0]) cylinder(h = head_thick, r = head_diam / 2, $fn = 6);
  410. }
  411. // recessed nut head on the other side
  412. translate([0, 3/2*thk + thk, height + h_offset + o_rad]) {
  413. rotate([90, 30, 0]) cylinder(h = head_thick, r = nut_radius + 0.2, $fn = facets);
  414. }
  415. }
  416. }
  417. // mount to quik release stand
  418. module quik_release_stand_adapter(height, wall, stand_wall) {
  419. difference() {
  420. union() {
  421. // main mount cylinder
  422. difference() {
  423. cylinder(r = mic_mount_radius + mic_mount_fit + stand_wall,
  424. h = height, $fn = facets);
  425. // make the hole for the mount (* 1.5 to cut the ridge as well)
  426. cylinder(r = mic_mount_radius + mic_mount_fit, h = height, $fn = facets);
  427. }
  428. }
  429. // slot for fitting into microphone stand
  430. translate([mic_mount_radius - stand_wall / 2, - mic_mount_slot_width / 2, 0]) {
  431. cube([2 * stand_wall, mic_mount_slot_width, mic_mount_slot_height]);
  432. }
  433. // eyelet for microphone stand
  434. translate([mic_mount_radius - stand_wall / 2, 0, mic_mount_slot_height]) {
  435. rotate([0, 90, 0]) {
  436. cylinder(r = mic_mount_slot_radius, h = 2 * stand_wall, $fn = facets);
  437. }
  438. }
  439. }
  440. }
  441. // connector to quik release microphone stand
  442. module shock_mount_stand(height, wall, stand_wall) {
  443. // connection to microphone
  444. mount_connector_top(height, mic_mount_radius + mount_wall + wall + mic_mount_fit, mic_mount_radius + mic_mount_fit, 20.0);
  445. // connection to stand
  446. quik_release_stand_adapter(height, wall, stand_wall);
  447. }
  448. // thread for stand mount
  449. //
  450. // 5/8-27 for US mic stands
  451. // 3/8-16 for European
  452. module stand_mount_thread(length, band, wall, diameter = 5/8, threads_per_inch = 27, wall = 2.0, fit = 0.) {
  453. diam = diameter * 25.4;
  454. pitch = (1.0/threads_per_inch)*25.4;
  455. difference() {
  456. cylinder(r = (diam / 2) + wall, h = length + band, $fn = facets);
  457. translate([0, 0, length]) {
  458. cylinder(r = (diam / 2), h = band, $fn = facets);
  459. }
  460. metric_thread (diameter = diam + fit, pitch = pitch, length = length + thin_mint, internal = true);
  461. }
  462. }
  463. // connector to threaded microphone stand
  464. module shock_mount_threaded_stand(height, wall, stand_wall) {
  465. // connection to stand
  466. diam = 5/8 * 25.4;
  467. thread_length = 15.0;
  468. stand_mount_thread(thread_length, height - thread_length, wall);
  469. // connection to microphone
  470. mount_connector_top(height, diam/2 + wall, diam/2, 23.0);
  471. }
  472. //
  473. // new version of tetra shock mount
  474. //
  475. module tetra_shock_mount_band(band_height, radius, corner, gap) {
  476. difference() {
  477. rounded_block_relative(band_height, radius + gap, radius + gap, corner, 3 * wall);
  478. rounded_block(band_height, radius + gap, radius + gap, corner);
  479. }
  480. }
  481. // tetra shock mount internal ring
  482. module tetra_shock_mount_internal_ring(height, radius, band_height, corner, gap) {
  483. difference() {
  484. // four sided ring
  485. union() {
  486. tetra_shock_mount_band(band_height, radius, corner, gap);
  487. // ridge so that rubber bands stay in the shock mount
  488. tetra_shock_mount_band(wall, radius, corner, gap + wall);
  489. }
  490. // slots inside body so that the ring clears the lower screws
  491. for (r = [0, 90, 180, 270]) rotate([0, 0, r + 45]) {
  492. translate([radius + gap + 2.5, -2.0, 0]) cube([2.0, 4.0, band_height]);
  493. }
  494. // channels in body for upper rubber band
  495. for (r = [0, 90, 180, 270]) rotate([0, 0, r + 45]) {
  496. rotate([90, 0, 0]) translate([radius + 8.75, 2 * wall + 0.2, 0])
  497. cylinder(r = 1.0, h = height, center = true, $fn = facets);
  498. }
  499. }
  500. // 8 columns for mounting rubber bands
  501. for (r = [0, 90, 180, 270]) rotate([0, 0, r]) {
  502. for (m = [0, 1]) mirror([m, 0, 0]) {
  503. translate([radius + 4.0 + gap, radius*1/3, 0]) {
  504. rotate([0, 0, 0]) {
  505. difference() {
  506. // columns
  507. union() {
  508. translate([3, 0, 0]) rotate([0, 0, 45]) scale([1.2, 0.85, 1.0])
  509. cylinder(r = 3, h = height, $fn = facets);
  510. // connect column to body
  511. translate([-2, -2, 0])
  512. cube([4, 3, band_height]);
  513. // connect columns together so they cannot bend
  514. translate([2, -7, 0])
  515. cube([wall, 6, height]);
  516. }
  517. // lower slots for rubber bands
  518. rotate([0, 0, 45]) translate([2.5, radius/2, 2.0]) scale([1.0, 1.0, 2.2]) rotate([90, 0, 0]) {
  519. cylinder(r = 1.1, h = radius * 2, $fn = facets);
  520. }
  521. // upper slots for rubber bands
  522. rotate([0, 0, 45]) translate([2.5, radius/2, height - 2.0]) scale([1.0, 1.0, 2.2]) rotate([90, 0, 0]) {
  523. cylinder(r = 1.1, h = radius * 2, $fn = facets);
  524. }
  525. }
  526. }
  527. }
  528. }
  529. }
  530. }
  531. // tetra shock mount external ring
  532. module tetra_shock_mount_external_ring(height, radius, corner, gap) {
  533. // main ring
  534. difference() {
  535. rounded_block_relative(height, radius, radius, corner, gap);
  536. rounded_block_relative(height, radius, radius, corner, gap - ring_wall);
  537. }
  538. for (rot = [0, 90, 180, 270]) {
  539. // anchors for rubber bands
  540. rotate([0, 0, rot + 45]) {
  541. translate([radius + gap + 2.25 * ring_wall, -5, 0]) {
  542. minkowski() {
  543. cube([4 - 2, 10, ring_ext_height]);
  544. cylinder(r = 1.5, h = thin_mint, $fn = facets);
  545. }
  546. }
  547. translate([radius + gap + ring_wall - 2, -2, 0]) {
  548. cube([9, 4, ring_ext_height]);
  549. }
  550. }
  551. }
  552. // reinforcement
  553. intersection() {
  554. difference() {
  555. rounded_block_relative(height * 2, radius, radius, corner, gap);
  556. rounded_block_relative(height * 2, radius, radius, corner, gap - ring_wall);
  557. }
  558. //rotate([0, 0, 22.5]) rounded_octagon_wall(ring_ext_height * 2, 2 * radius - ring_wall, ring_wall);
  559. translate([radius + gap - ring_wall/2, 0, 0]) {
  560. rotate([0, 0, 45]) cylinder(r1 = 2 * radius, r2 = ring_wall/2 + 1, h = ring_ext_height * 2, $fn = 4);
  561. }
  562. }
  563. // connection to hub
  564. translate([radius + gap, -2, 0]) {
  565. cube([10, 4, ring_ext_height * 2]);
  566. }
  567. // rotating mount
  568. o_rad = 8;
  569. i_rad = 3;
  570. rotate([0, 90, -90]) {
  571. translate([-o_rad, radius + gap + o_rad + 8, -2]) {
  572. shock_mount_ring(o_rad, i_rad, ring_wall);
  573. }
  574. }
  575. }