| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- //
- // Spherical Harmonics Ear Project (*SpHEAR)
- //
- // TinySpHEAR, First Order (B-format) Ambisonics Microphone
- // Common files for H2N add-on array
- //
- // Copyright 2016, Fernando Lopez-Lezcano, All Rights Reserved
- // nando@ccrma.stanford.edu
- //
- // This program is free software: you can redistribute it and/or modify
- // it under the terms of the GNU General Public License as published by
- // the Free Software Foundation, either version 3 of the License, or
- // (at your option) any later version.
- //
- // This program is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- // GNU General Public License for more details.
- //
- // You should have received a copy of the GNU General Public License
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
- //
- // 3d Models released under the Creative Commons license as follows:
- // Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
- // http://creativecommons.org/licenses/by-nc-sa/4.0/
- include <SpHEAR_common.scad>;
- include <TinySpHEAR_common.scad>;
- include <TinySpHEAR_mount_pcb.scad>;
- // outline of H2N front
- // include<h2n/H2N_front_outline.scad>;
- // outline of H2N top
- // include<h2n/H2N_top_up_outline.scad>;
- // dimensions of the EM200 electret microphone capsule (measured 14.59 max)
- capsule_radius = 14.6 / 2;
- capsule_height = 4.75;
- mic_radius = 11;
- // dimensions of H2R recorder
- // width and depth at middle of ring
- h2n_width = 62.00;
- h2n_depth = 42.66;
- h2n_width_up = 57.0;
- module tube(or, ir, h) {
- difference() {
- cylinder(r = or, h = h, $fn = facets);
- cylinder(r = ir, h = h, $fn = facets);
- }
- }
- // main support ring
- module h2n_ring(width, depth, radius, height, slot_w, slot_d, band_wall, tube_wall, wall) {
- // main support ring
- difference() {
- rounded_block(height, width / 2 + band_wall, depth / 2 + band_wall, radius - thin_mint);
- rounded_block_relative(height, width / 2 + band_wall, depth / 2 + band_wall, radius - band_wall - thin_mint, - band_wall);
- }
- // inner band
- difference() {
- difference() {
- rounded_block(height, width / 2 + wall - h2n_side_band, depth / 2 + band_wall, radius - thin_mint);
- rounded_block_relative(height, width / 2 + wall - h2n_side_band, depth / 2 + band_wall, radius - wall - thin_mint, - wall);
- }
- for (m = [0, 1]) mirror([m, 0, 0]) {
- // cut slots on the sides
- translate([-width / 2, -h2n_side_band_w / 2, 0]) {
- cube([width / 2, h2n_side_band_w, height]);
- }
- }
- }
- }
- // side columns
- module h2n_columns(width, height, ring_height, tilt, band, transition, radius, wall) {
- // side tubes for cables
- for (m = [0, 1]) mirror([m, 0, 0]) {
- translate([-(width / 2 + mount_radius - wall), 0, 0]) {
- // angled tube (4 degrees inward tilt)
- difference() {
- hull() {
- // rounded_block(thin_mint, radius, radius, radius / 1 - thin_mint);
- cylinder(r = radius, h = thin_mint, $fn = facets);
- translate([height * tan(tilt) - wall/2, 0, height]) {
- // rounded_block(thin_mint, radius, radius, radius / 1 - thin_mint);
- cylinder(r = radius, h = thin_mint, $fn = facets);
- }
- }
- hull() {
- // rounded_block_relative(thin_mint, radius, radius, radius / 1 - thin_mint, - wall);
- cylinder(r = radius - wall, h = thin_mint, $fn = facets);
- translate([height * tan(tilt) - wall/2, 0, height]) {
- // rounded_block_relative(thin_mint, radius, radius, radius / 1 - thin_mint, - wall);
- cylinder(r = radius - wall, h = thin_mint, $fn = facets);
- }
- }
- // slots for cables
- translate([mount_radius - wall - ring_height * tan(tilt), - mount_radius * 2, -ring_height]) {
- rotate([0, tilt, 0]) {
- cube([5.0, mount_radius * 4, 22.0]);
- translate([0, 2 * mount_radius, 22.0]) {
- rotate([0, 90, 0]) {
- cylinder(r = mount_radius + wall, h = 5.0, $fn = facets);
- }
- }
- }
- }
- }
- }
- // connector to bridge
- translate([-(width / 2 + mount_radius - wall / 2 - height * tan(tilt)), 0, height]) {
- tube(mount_radius + wall / 2, mount_radius, 5.0);
- }
- }
- }
- // bridge that connects to capsule array
- module semi_cylinder(r, h, e = thin_mint) {
- difference() {
- cylinder(h, r, r, $fn = facets);
- translate ([-r*2, -(r+e), -e])
- cube([2*(r+e), 2*(r+e), h+2*e]);
- }
- }
- module quarter_sphere(r, e = thin_mint) {
- difference() {
- sphere(r, $fn = facets);
- translate([-r, -r, -r])
- cube([2*(r+e), 2*(r+e), (r+e)]);
- translate([-r, -r, 0])
- cube([(r+e), 2*(r+e), (r+e)]);
- }
- }
- module cylcube(width, depth, height, wall) {
- difference() {
- semi_cylinder(r = depth, h = height);
- semi_cylinder(r = depth - wall, h = height);
- }
- translate([-(width + depth / 2), -depth, 0]) {
- difference() {
- cube([(width + depth / 2), depth * 2, height]);
- translate([0, wall, 0]) {
- cube([(width + depth), (depth - wall) * 2, height]);
- }
- }
- }
- }
- module h2n_bridge(width, height, ring_height, ring_wall, tilt, band, transition, radius, col_wall, wall) {
- // capsule array mount
- translate([0, 0, band + 20.0]) {
- tetra_capsule_array_mount([-45, 135]);
- }
- // stalk
- translate([0, 0, band]) {
- difference() {
- tube(mount_radius + wall, mount_radius, 20.0);
- // remove the part of the stalk that is inside the bridge
- translate([width / 2, 0, -4*thin_mint]) {
- rotate([0, -90, 0]) {
- semi_cylinder(r = radius + col_wall - wall, h = width);
- }
- }
- }
- }
- // top of bridge
- translate([width / 2, 0, band]) {
- rotate([0, -90, 0]) {
- difference() {
- // curvy ceiling
- semi_cylinder(r = radius + col_wall, h = width);
- semi_cylinder(r = radius + col_wall - wall, h = width);
- // make a hole for the cables
- translate([0, 0, width / 2]) {
- rotate([0, 90, 0]) {
- cylinder(r = mount_radius, h = 10, $fn = facets);
- }
- }
- }
- }
- }
- // caps at ends
- for (m = [0, 1]) mirror([m, 0, 0]) {
- // fixme: why the 0.3 magic below?
- translate([width / 2 - 0.3, 0, band]) {
- difference() {
- quarter_sphere(r = radius + col_wall);
- quarter_sphere(r = radius + col_wall - wall);
- }
- }
- }
- // base of bridge
- translate([0, 0, 0]) {
- for (m = [0, 1]) mirror([m, 0, 0]) {
- translate([width / 2 + mount_radius - col_wall - height * tan(tilt) + wall, 0, 0]) {
- cylcube(width / 2 - height * tan(tilt), radius + col_wall, band, wall);
- }
- }
- }
- // reinforcement beams at the base
- translate([-col_wall / 2, -(radius + wall), 0]) {
- cube([col_wall, (radius + wall) * 2, col_wall]);
- }
- for (m = [0, 1]) mirror([m, 0, 0]) {
- translate([-width / 2 + radius + wall + 0.5, -(radius + wall), 0]) {
- cube([col_wall, (radius + wall) * 2, col_wall]);
- }
- }
- }
- connector_height = 40;
- transition_height = 30;
- // measured = 11.50, should be 13.1 -> ratio =
- // h2n_side_radius = 18.2;
- h2n_side_radius = 18.4;
- h2n_side_band = 1.5;
- h2n_side_band_w = 13.1;
- h2n_width_m = 63.0;
- h2n_depth_m = 36.4;
- h2n_band_height = 6.0;
- // base band width
- h2n_band_wall = 1.6;
- // walls for the columns
- h2n_col_wall = 2 * wall;
- // render the whole thing
- difference() {
- union() {
- *h2n_ring(h2n_width_m, h2n_depth_m, h2n_depth * 0.425, h2n_band_height, h2n_side_band_w, h2n_side_band, h2n_band_wall, 0.0, wall);
- *h2n_columns(h2n_width_m, connector_height, h2n_band_height, 4.0, 10.0, transition_height, mount_radius + h2n_col_wall, h2n_col_wall);
- h2n_bridge(h2n_width_m, connector_height, h2n_band_height, h2n_band_wall, 4.0, 10.0, transition_height, mount_radius, h2n_col_wall, wall);
- }
- *translate([-40, -50, 0]) {
- cube([80, 50, 80]);
- }
- }
- // capsule holders and connector to main body
- *rotate([0, 0, 0]) {
- render_tetra_capsule_array(connector_height + transition_height + 30);
- }
- // make sure dimensions are fine
- *translate([-(h2n_width_m - 0.1) / 2, - 0.5, 0]) {
- cube([h2n_width_m - 0.1, 1, 1]);
- }
- *translate([-0.5, -(h2n_depth_m - 0.1) / 2, 0]) {
- cube([1, h2n_depth_m - 0.1, 1]);
- }
- // some tests with traced profiles
- *difference() {
- translate([0, -2.5, 0]) {
- scale([2.15, 2.15, 1.0]) {
- H2N_top_up_outline(5.0);
- }
- }
- // scale([1.75, 1.75, 1.0]) {
- translate([0, -2.4, 0]) {
- scale([2.02, 2.02, 1.0]) {
- H2N_top_up_outline(5.0);
- }
- }
- }
- *scale(1.665) {
- translate([0, 10, -0]) {
- rotate([0, 0, 0]) {
- H2N_front_outline(1.0);
- }
- }
- }
- *rotate([0, 0, 4]) translate([35, 0, 0])
- cube([2, 80, 4]);
|