瀏覽代碼

really push changes to TinySpHEAR_common.scad, TinySpHEAR_mount_pcb.scad and TinySphEAR.scad

Fernando Pablo Lopez-Lezcano 10 年之前
父節點
當前提交
3f6a270667
共有 3 個文件被更改,包括 300 次插入 和 175 次删除
  1. 151 104
      TinySpHEAR_common.scad
  2. 147 69
      TinySpHEAR_mount_pcb.scad
  3. 2 2
      TinySphEAR.scad

+ 151 - 104
TinySpHEAR_common.scad

@@ -1,11 +1,12 @@
 //
-// TinySpHEAR, Tiny Spherical Harmonics Ear, 
-// First Order (B-format) Ambisonics Microphone Common Modules and Variables
+// Spherical Harmonics Ear Project (*SpHEAR)
+//
+// TinySpHEAR, First Order (B-format) Ambisonics Microphone
+// Common Modules and Variables
 //
 // Copyright 2015-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
@@ -19,26 +20,24 @@
 //  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/
 
-
 // https://en.wikipedia.org/wiki/Tetrahedron
 // angle of capsule to vertical axis = atan(sqrt(2)) = 54.7356103172
 
 ////
-//// model parameters
+//// default model parameters
+////
 
+// microphone capsule array
+//
 // dimensions of the electret microphone capsule
 capsule_radius = 5;
 capsule_height = 4.5;
 
 // distance between the face of a capsule and the center of array
-//
-// for a 10mm capsule: with vertical legs -> 10.5mm min radius
-//                     with horizontal legs -> 10mm min radius
 mic_radius = 9.6;
 
 // dimensions of the capsule holder connection legs
@@ -50,14 +49,16 @@ leg_thick = 1.75;
 wall = 1;
 
 // width of the ridge that connects to the mount
-//   measured: ridge = 2.20mm, slot = 2.0 .. 2.35mm
 ridge_width = 2.0;
 ridge_slot_width = 2.0;
+// depth of the connector mount ridge
+ridge_depth = 3.0;
 // add to the thickness of ridges
 ridge_wfit = 0.1;
 ridge_hfit = 3;
 
-// dimensions of microphone mount
+// microphone mount
+//
 mount_radius = 3.5;
 mount_wall = 0.75;
 
@@ -90,13 +91,6 @@ mic_mount_height = 35.0 + mic_wire_hole_offset + mic_wire_hole_radius + 2 * mic_
 ////
 //// rendering control
 
-// what to render:
-// 0 -> ready to print
-//   set = 0 -> one capsule, set = 1 -> four capsules
-// 1 -> the whole microhone with four capsules
-rendermic = 0;
-renderset = 1;
-
 // what type of connection to use between capsule holders:
 // 0 -> original cylindrical angled legs
 // 1 -> interlocking horizontal legs
@@ -154,8 +148,6 @@ mount_radius_capsule = capsule_sep_max;
 ////////
 // microphone capsule holder
 
-// azimuth: horizontal orientation of the capsule
-// elevation: vertical orientation of the capsule
 // mounts: vectors containing the angle of the mount and the angle to the adjacent capsule
 // twist: rotate the whole capsule to match mounting legs
 // ridge: add 0, 1 or 2 ridges for attaching the structure to the mount
@@ -163,102 +155,103 @@ mount_radius_capsule = capsule_sep_max;
 // ridge_hfit: adjust height of ridges when carving out the capsule rests
 // solid: make the capsule holder solid, used in the mount code to carve the capsule rests
 
-module capsule (azimuth, elevation, mounts, twist, ridge, ridge_wfit = 0.0, ridge_hfit = 0.0, solid = 0) {
-    rotate([0, 0, azimuth]) {
-        rotate([0, (90 - elevation), 0]) {
-            translate([0, 0, (rendermic == 0 && solid == 0) ? 0 : mic_radius - capsule_height]) {
-                difference () {
-                    union () {
-                        // main capsule holder
-                        cylinder(r = capsule_radius + wall, h = capsule_height, $fn = cfacets);    
-                        // the mounting legs
-                        for (angles = mounts) {
-                            rotate([0, 0, angles[0] + twist]) {
-                                // connect with cylindrical beams, very pretty
-                                if (connect == 0) {
-                                    leg_length = mic_radius * cos(angles[1]) - capsule_radius * sin(angles[1]);
-                                    translate([capsule_radius - wall, 0, capsule_height - wall]) {
-                                        rotate([0, 180 - angles[1], 0]) {
-                                            cylinder(d = leg_width, h = leg_length - 0.3, center = false, $fn = facets);
-                                        }
-                                    }
-                                }
-                                // connect with horizontal legs
-                                if (connect == 1) {
-                                    leg_length = (mic_radius - capsule_height + leg_thick) * tan(90 - angles[1]) - capsule_radius;
-                                    slot_depth = leg_thick * cos(90 - 2 * angles[1]) + wall + fit;
-                                    translate([capsule_radius + leg_length + fudge, - leg_width / 3, 0]) {
-                                        rotate([0, -90, 0]) {
-                                            difference() {
-                                                // thickness, width
-                                                cube([leg_thick, leg_width, leg_length]);
-                                                // cut slot in connector
-                                                translate([0, leg_width / 3 - (fit / 2), 0]) {
-                                                    cube([leg_thick, leg_width / 3 + fit, slot_depth]);
-                                                }
-                                            }
-                                        }
-                                    }
-                                }
-                                // connect with vertical legs
-                                if (connect == 2) {
-                                    // fix this 0.2 == (2 * fudge?)
-                                    leg_length = (mic_radius * tan(90 - angles[1]) - capsule_radius) * tan(angles[1]) - 0.2; 
-                                    slot_depth = leg_thick * cos (90 - (2 * angles[1]));
-                                    translate([capsule_radius - leg_thick / 2 + fudge, - leg_width / 3, 
-                                               - leg_length + capsule_height]) {
-                                        difference() {
-                                            // the connection
-                                            difference() {
-                                                cube([leg_thick + leg_thick / 2, leg_width, leg_length]);
-                                                translate([-leg_thick + wall - fudge, 0, - capsule_height + fudge]) {
-                                                    cube([leg_thick, leg_width, leg_length]);
-                                                }
-                                            }
-                                            // cut slot in connector
-                                            translate([0, leg_width / 3 - (fit / 2), 0]) {
-                                                cube([leg_thick + leg_thick / 2, leg_width / 3 + fit, slot_depth]);
-                                            }
-                                        }
-                                    }
-                                }
+module capsule (mounts, twist, ridge, ridge_wfit = 0.0, ridge_hfit = 0.0, solid = 0) {
+    difference () {
+        union () {
+            // main capsule holder
+            cylinder(r = capsule_radius + wall, h = capsule_height, $fn = cfacets);
+            // the mounting legs
+            for (angles = mounts) {
+                rotate([0, 0, angles[0] + twist]) {
+                    // connect with cylindrical beams, very pretty
+                    if (connect == 0) {
+                        leg_length = mic_radius * cos(angles[1]) - capsule_radius * sin(angles[1]);
+                        translate([capsule_radius - wall, 0, capsule_height - wall]) {
+                            rotate([0, 180 - angles[1], 0]) {
+                                cylinder(d = leg_width, h = leg_length - 0.3, center = false, $fn = facets);
                             }
                         }
-                        // add ridges for microphone mount
-                        ridge_length = (mic_radius - capsule_height) / tan(elev_angle) - (capsule_radius + wall);
-                        if (ridge == 2) {
-                            rotate([0, 0, twist]) {
-                                translate([capsule_radius + wall - ridge_length / 2, (ridge_width + ridge_wfit) / 2, 0]) {
-                                    cube([ridge_length * 3 / 2, ridge_width + ridge_wfit, capsule_height + ridge_hfit], center = false);
-                                }
-                                translate([capsule_radius + wall - ridge_length / 2, - (ridge_width + ridge_wfit) * 3 / 2, 0]) {
-                                    cube([ridge_length * 3 / 2, ridge_width + ridge_wfit, capsule_height + ridge_hfit], center = false);
+                    }
+                    // connect with horizontal legs
+                    if (connect == 1) {
+                        leg_length = (mic_radius - capsule_height + leg_thick) * tan(90 - angles[1]) - capsule_radius;
+                        slot_depth = leg_thick * cos(90 - 2 * angles[1]) + wall + fit;
+                        translate([capsule_radius + leg_length + fudge, - leg_width / 3, 0]) {
+                            rotate([0, -90, 0]) {
+                                difference() {
+                                    // thickness, width
+                                    cube([leg_thick, leg_width, leg_length]);
+                                    // cut slot in connector
+                                    translate([0, leg_width / 3 - (fit / 2), 0]) {
+                                        cube([leg_thick, leg_width / 3 + fit, slot_depth]);
+                                    }
                                 }
                             }
                         }
-                        if (ridge == 1) {
-                            rotate([0, 0, twist]) {
-                                translate([capsule_radius + wall - ridge_length / 2, - (ridge_width + ridge_wfit) / 2, 0]) {
-                                    cube([ridge_length * 3 / 2, ridge_width + ridge_wfit, capsule_height + ridge_hfit], center = false);
+                    }
+                    // connect with vertical legs
+                    if (connect == 2) {
+                        // fix this 0.2 == (2 * fudge?)
+                        leg_length = (mic_radius * tan(90 - angles[1]) - capsule_radius) * tan(angles[1]) - 0.2;
+                        slot_depth = leg_thick * cos (90 - (2 * angles[1]));
+                        translate([capsule_radius - leg_thick / 2 + fudge, - leg_width / 3,
+                                   - leg_length + capsule_height]) {
+                            difference() {
+                                // the connection
+                                difference() {
+                                    cube([leg_thick + leg_thick / 2, leg_width, leg_length]);
+                                    translate([-leg_thick + wall - fudge, 0, - capsule_height + fudge]) {
+                                        cube([leg_thick, leg_width, leg_length]);
+                                    }
+                                }
+                                // cut slot in connector
+                                translate([0, leg_width / 3 - (fit / 2), 0]) {
+                                    cube([leg_thick + leg_thick / 2, leg_width / 3 + fit, slot_depth]);
                                 }
                             }
                         }
                     }
-                    // make the hole for the capsule (also cuts leg overhang for vertical connectors)
-                    if (solid != 1) {
-                        translate ([0, 0, -capsule_height]) {
-                            cylinder(r = capsule_radius + fudge, h = capsule_height * 2, $fn = cfacets);
-                        }
+                }
+            }
+            // add ridges for microphone mount
+            ridge_length = (mic_radius - capsule_height) / tan(elev_angle) - (capsule_radius + wall);
+            if (ridge == 2) {
+                rotate([0, 0, twist]) {
+                    translate([capsule_radius + wall - ridge_length / 2, (ridge_width + ridge_wfit) / 2, 0]) {
+                        cube([ridge_length * 3 / 2, ridge_width + ridge_wfit, capsule_height + ridge_hfit], center = false);
                     }
-                    // remove any extra connecting beam material from the face of the holder
-                    if (connect == 0) {
-                        translate ([0, 0, capsule_height]) {
-                            cylinder(r = capsule_radius + wall * 2, h = 2, $fn = cfacets);
+                    translate([capsule_radius + wall - ridge_length / 2, - (ridge_width + ridge_wfit) * 3 / 2, 0]) {
+                        cube([ridge_length * 3 / 2, ridge_width + ridge_wfit, capsule_height + ridge_hfit], center = false);
+                    }
+                }
+            }
+            if (ridge == 1) {
+                rotate([0, 0, twist]) {
+                    difference() {
+                        translate([capsule_radius + wall - ridge_length / 2, - (ridge_width + ridge_wfit) / 2, 0]) {
+                            cube([ridge_depth, ridge_width + ridge_wfit, capsule_height + ridge_hfit], center = false);
+                        }
+                        translate([capsule_radius + wall + ridge_length, - (ridge_width + ridge_wfit) / 2, 0]) {
+                            rotate([0, elev_angle, 0]) {
+                                cube([ridge_depth, ridge_width + ridge_wfit, capsule_height * 2], center = false);
+                            }
                         }
                     }
                 }
             }
         }
+        // make the hole for the capsule (also cuts leg overhang for vertical connectors)
+        if (solid != 1) {
+            translate ([0, 0, -capsule_height]) {
+                cylinder(r = capsule_radius + fudge, h = capsule_height * 2, $fn = cfacets);
+            }
+        }
+        // remove any extra connecting beam material from the face of the holder
+        if (connect == 0) {
+            translate ([0, 0, capsule_height]) {
+                cylinder(r = capsule_radius + wall * 2, h = 2, $fn = cfacets);
+            }
+        }
     }
 }
 
@@ -340,11 +333,65 @@ module mount (angles, wall, stand_wall, separation) {
             }
             // indentations that match the two lower capsule holders
             translate([0, 0, mic_mount_height + mount_height + mount_top_height + 
-                       (mic_radius - capsule_height) + capsule_height * sin(elev_angle)]) {
-                capsule(angles[0], -elev_angle, [], 0, 1, ridge_wfit, ridge_hfit, 1);
-                capsule(angles[1], -elev_angle, [], 0, 1, ridge_wfit, ridge_hfit, 1);
+                       (mic_radius - capsule_height) + capsule_height * cos(elev_angle)]) {
+                rotate([0, (90 - elev_angle), angles[0]]) {
+                    translate([0, 0, mic_radius - capsule_height]) {
+                        capsule([], 0, 1, ridge_wfit, ridge_hfit, 1);
+                    }
+                }
+                rotate([0, (90 - elev_angle), angles[1]]) {
+                    translate([0, 0, mic_radius - capsule_height]) {
+                        capsule([], 0, 1, ridge_wfit, ridge_hfit, 1);
+                    }
+                }
+            }
+        }
+    }
+}
+
+// render a tetrahedral capsule array
+//
+module render_tetra_capsule_array(z_offset) {
+    translate([0, 0, z_offset]) {
+        // all four capsules
+        rotate([0, (90 - elev_angle), 45]) {
+            translate([0, 0, mic_radius - capsule_height]) {
+                capsule(leg_angles_top, 60, 0, 0.0, 0.0, 0);
             }
         }
+        rotate([0, (90 - elev_angle), -135]) {
+            translate([0, 0, mic_radius - capsule_height]) {
+                capsule(leg_angles_top, 60, 0, 0.0, 0.0, 0);
+            }
+        }
+        rotate([0, (90 + elev_angle), -45]) {
+            translate([0, 0, mic_radius - capsule_height]) {
+                capsule(leg_angles_bot, 0, 1, 0.0, 0.0, 0);
+            }
+        }
+        rotate([0, (90 + elev_angle), 135]) {
+            translate([0, 0, mic_radius - capsule_height]) {
+                capsule(leg_angles_bot, 0, 1, 0.0, 0.0, 0);
+            }
+        }
+    }
+}
+
+// render individual capsules
+//
+module render_tetra_capsule_top() {
+    capsule(leg_angles_top, 60, 0, 0.0, 0.0, 0);
+}
+
+module render_tetra_capsule_bot() {
+    capsule(leg_angles_bot, 0, 1, 0.0, 0.0, 0);
+}
+
+// render simple microphone stand mount
+//
+module render_simple_stand_mount(z_offset) {
+    translate([0, 0, z_offset]) {
+        mount([-45, 135], mount_wall, mic_mount_wall, mic_mount_height + mount_top_height + mount_height + capsule_bottom);
     }
 }
 

+ 147 - 69
TinySpHEAR_mount_pcb.scad

@@ -1,12 +1,12 @@
 //
-// *SpHEAR Project (Spherical Harmonics Ears), 
+// Spherical Harmonics Ear Project (*SpHEAR)
 //
-// Mount for four interface printed circuit boards
+// TinySpHEAR, First Order (B-format) Ambisonics Microphone
+// Mount for four Zapnspark phantom power printed circuit boards
 // 
 // Copyright 2015-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
@@ -20,14 +20,17 @@
 //  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 <TinySpHEAR_common.scad>;
 
-// size of printed circuit board
+////
+//// default model parameters
+////
+
+// size of Zapnspark printed circuit board
 pcb_length = 85.090;
 // measured = 16.26 (fit = 0.25)
 pcb_width = 16.51;
@@ -75,6 +78,16 @@ pcb_back = 2.0;
 // calculated minimum "radius" of microphone box
 box_radius = pcb_front + (pcb_thickness + pcb_tfit) + pcb_back + 2 * wall;
 
+// shock mount parameters
+//
+
+ring_sep = 30;
+ring_height = 6;
+band_angle = 40;
+main_radius_inc = (ring_sep / 2) / tan(band_angle);
+
+internal_ring_gap = 1.0;
+
 // the printed circuit board
 
 module pcb(length, width, thick) {
@@ -316,16 +329,24 @@ module tetra_capsule_array_mount(angles) {
         }
         // indentations that match the two lower capsule holders
         // add ridge height adjustment
-        translate([0, 0, mount_top_height + (mic_radius - capsule_height) + capsule_height * sin(elev_angle)]) {
-            capsule(angles[0], -elev_angle, [], 0, 1, 0.1, 3, 1);
-            capsule(angles[1], -elev_angle, [], 0, 1, 0.1, 3, 1);
+        translate([0, 0, mount_top_height + (mic_radius - capsule_height) + capsule_height * cos(elev_angle)]) {
+            rotate([0, (90 + elev_angle), angles[0]]) {
+                translate([0, 0, mic_radius - capsule_height]) {
+                    capsule([], 0, 1, 0.1, 3, 1);
+                }
+            }
+            rotate([0, (90 + elev_angle), angles[1]]) {
+                translate([0, 0, mic_radius - capsule_height]) {
+                    capsule([], 0, 1, 0.1, 3, 1);
+                }
+            }
         }
     }
 }
 
 // internal ring of shock mount
 
-module tetra_shock_mount_body_ring(height, radius, corner, gap, lip) {
+module tetra_shock_mount_internal_ring(height, radius, corner, gap, lip) {
     slot_sep = radius * 2 / 2.5;
     slot_w = 5;
     slot_o = height / 3;
@@ -410,7 +431,7 @@ module tetra_shock_mount_ring(outside_radius, inside_radius, thickness) {
     }
 }
 
-module tetra_shock_mount_main_ring(height, radius, corner, gap, lip) {
+module tetra_shock_mount_external_ring(height, radius, corner, gap, lip) {
     difference() {
         tetra_mount_box_relative(6, radius, mount_corner, gap);
         tetra_mount_box_relative(6, radius, mount_corner, gap - 4 * wall);
@@ -486,7 +507,7 @@ module tetra_shock_mount_stand(height, wall, stand_wall) {
             }
         }
         // top of mount
-        translate([0, 0, mic_mount_height]) {
+        translate([0, 0, height]) {
             difference() {
                 cylinder(h = mic_mount_radius, 
                         r1 = mic_mount_radius + mount_wall + wall + mic_mount_fit, r2 = 5, $fn = facets);
@@ -503,7 +524,7 @@ module tetra_shock_mount_stand(height, wall, stand_wall) {
         thk = 4;
         for (m = [0, 1]) mirror([0, m, 0]) {
             rotate([90, 90, 0]) {
-                translate([-(mic_mount_height + o_rad + 6), 0, thk/2 + fit]) {
+                translate([-(height + o_rad + 6), 0, thk/2 + fit]) {
                     rotate([0, 0, 45]) 
                         tetra_shock_mount_ring(o_rad, i_rad, thk);
                 }
@@ -512,75 +533,145 @@ module tetra_shock_mount_stand(height, wall, stand_wall) {
     }
 }
 
-*tetra_shock_mount_stand(mic_mount_height, mount_wall, mic_mount_wall);
+////
+//// render all the different parts
+////
 
-*translate([-18, 10, 0])
-    tetra_shock_mount_connector(ring_sep, 4, 10, 2, 0.1);
+// microphone body: flare to capsule array (slips into PCB holder body)
+//
 
-*translate([-18, -10, 0])
-    tetra_shock_mount_connector(ring_sep, 4, 10, 2, 0.1);
+module render_tetra_capsule_flare(z_offset) {
+    translate([0, 0, z_offset]) {
+        tetra_mount_flare(10 + pcb_hi_exp, mount_lip, flare_height, box_radius + wall,  mount_corner, mount_radius + wall, stalk_height);
+        translate([0, 0, 10 + pcb_hi_exp + flare_height + stalk_height]) {
+            tetra_capsule_array_mount([-45, 135]);
+        }
+    }
+}
 
-// main body of microphone mount
+// microphone body: main body, holds printed circuit boards
 //
-//translate([0, 0, -(pcb_length - pcb_low_exp - pcb_hi_exp + 10)]) {
-    *tetra_mount_body_new(pcb_length - pcb_low_exp - pcb_hi_exp, box_radius + wall, mount_corner, mount_lip, mount_lip, 0);
-//}
+tetra_pcb_mount_height = pcb_length - pcb_low_exp - pcb_hi_exp;
 
-// flare to microphone stalk
+module render_tetra_pcb_mount(z_offset) {
+    translate([0, 0, z_offset]) {
+        tetra_mount_body_new(tetra_pcb_mount_height, box_radius + wall, mount_corner, mount_lip, mount_lip, 0);
+    }
+}
+
+// microphone body: flare to microphone cable (slips into PCB holder body)
 //
 
-//translate([0, 0, pcb_length - pcb_low_exp - pcb_hi_exp + 10]) {
-*translate([0, 0, 0]) {
-    tetra_mount_flare(10 + pcb_hi_exp, mount_lip, flare_height, box_radius + wall,  mount_corner, 
-                    mount_radius + wall, stalk_height);
-    translate([0, 0, 10 + pcb_hi_exp + flare_height + stalk_height]) {
-        tetra_capsule_array_mount([-45, 135]);
+module render_tetra_cable_flare(z_offset, flip) {
+    translate([0, 0, z_offset]) {
+        tetra_mount_flare(10 + pcb_low_exp, mount_lip, 20, box_radius + wall, mount_corner, cable_diam / 2 + wall, 10);
     }
 }
 
-// flare to microphone cable
+// microphone body: render all parts with a vertical separation
 //
 
-//translate([0, 0, -(10 + pcb_length - pcb_low_exp - pcb_hi_exp + 10)]) {
-*translate([0, 0, -17]) {
+module render_tetra_body(z_offset, spread) {
     rotate([0, 180, 0]) {
-        tetra_mount_flare(10 + pcb_low_exp, mount_lip, 20, box_radius + wall, mount_corner, cable_diam / 2 + wall, 10);
+        render_tetra_cable_flare(0);
     }
+    render_tetra_pcb_mount(spread);
+    render_tetra_capsule_flare(tetra_pcb_mount_height + spread + spread);
 }
 
-// shock mount
+// microphone: render the full assembly with a vertical separation
 //
 
-ring_sep = 30;
-ring_height = 6;
-band_angle = 40;
-main_radius_inc = (ring_sep / 2) / tan(band_angle);
+module render_tetra_microphone(z_offset, spread) {
+    render_tetra_body(z_offset, spread);
+    render_tetra_capsule_array(z_offset + tetra_pcb_mount_height + mount_top_height +
+            flare_height + stalk_height + 10 + pcb_hi_exp + mount_lip + mic_radius + spread);
+}
 
-body_ring_gap = 1.0;
+// shock mount: microphone stand mount
+//
 
-translate([0, 0, 0]) {
-    //rotate([0, 180, 0]) {
-        *tetra_shock_mount_body_ring(10, box_radius + wall, mount_corner, body_ring_gap, 1);
-        *rotate([0, 180, 0]) {
-            translate([0, 0, ring_sep + 2]) {
-                tetra_shock_mount_body_ring(10, box_radius + wall, mount_corner, body_ring_gap, 1);
-            }
+module render_tetra_shock_mount_stand(z_offset) {
+    translate([z_offset]) {
+        tetra_shock_mount_stand(mic_mount_height, mount_wall, mic_mount_wall);
+    }
+}
+
+// shock mount: external ring
+//
+
+module render_tetra_shock_mount_external_ring(z_offset) {
+    translate([0, 0, z_offset]) {
+        tetra_shock_mount_external_ring(10, box_radius + wall, mount_corner, main_radius_inc, 0);
+    }
+}
+
+// shock mount: bottom internal ring
+//
+
+module render_tetra_shock_mount_internal_ring_bot(z_offset) {
+    translate([0, 0, z_offset]) {
+        tetra_shock_mount_internal_ring(10, box_radius + wall, mount_corner, internal_ring_gap, 1);
+    }
+}
+
+// shock mount: all four internal ring connectors
+//
+
+module render_tetra_shock_mount_ring_connectors(offset) {
+    for (o = [0, 1, 2, 3]) {
+        translate([-18, (10 + offset) * o, 0]) {
+            tetra_shock_mount_connector(ring_sep, 4, 10, 2, 0.1);
         }
-        // mock up the connecting rods
-        *for (r = [0, 90, 180, 270]) rotate([0, 0, r])
-            translate([box_radius + 3 * wall + body_ring_gap, 0, -1]) 
-                rotate([0, 90, 0])
-                    translate([-4, -5, 1]) {
-                        tetra_shock_mount_connector(ring_sep, 4, 10, 2, 0.1);
-                    }
-    //}
+    }
+}
+
+// shock mount: top internal ring
+//
+
+module render_tetra_shock_mount_internal_ring_top(z_offset) {
+    translate([0, 0, z_offset]) {
+        tetra_shock_mount_internal_ring(10, box_radius + wall, mount_corner, internal_ring_gap, 0);
+    }
 }
 
-//translate([0, 0, - ring_sep / 2 - 5]) {
-*translate([0, 0, 0]) {
-        tetra_shock_mount_main_ring(10, box_radius + wall, mount_corner, main_radius_inc, 0);
+// shock mount: render all parts
+//
+
+module render_tetra_shock_mount(z_offset) {
+    // internal rings
+    translate([0, 0, z_offset + ring_sep / 2]) {
+        render_tetra_shock_mount_internal_ring_top(0);
+        rotate([0, 180, 0]) {
+            render_tetra_shock_mount_internal_ring_bot(ring_sep + 2);
+        }
+        // insert the connecting rods
+        for (r = [0, 90, 180, 270]) {
+            rotate([0, 0, r]) {
+                translate([box_radius + 3 * wall + internal_ring_gap, 0, -1]) {
+                    rotate([0, 90, 0]) {
+                        translate([-4, -5, 1]) {
+                            tetra_shock_mount_connector(ring_sep, 4, 10, 2, 0.1);
+                        }
+                    }
+                }
+            }
+        }
+    }
+    // external ring
+    translate([0, 0, z_offset]) {
+        render_tetra_shock_mount_external_ring(0);
+    }
+    // mount to stand
+    translate([0, 85, -(mic_mount_height + mic_mount_radius)]) {
+        rotate([0, 0, 90]) {
+            render_tetra_shock_mount_stand(0);
+        }
+    }
 }
 
+
+
 // first try at a ccrma logo
 //
 *rotate([90, 0, 0]) {
@@ -591,16 +682,3 @@ translate([0, 0, 0]) {
     }
 }
 
-// the microphone itself
-rendermic = 1;
-
-translate([0, 0, 2.8 + pcb_hi_exp + flare_height + stalk_height + 30]) {
-    // all four capsules
-    capsule(45, elev_angle, leg_angles_top, 60, 0, 0.0, 0.0, 0);
-    capsule(-135, elev_angle, leg_angles_top, 60, 0, 0.0, 0.0, 0);
-    capsule(-45, -elev_angle, leg_angles_bot, 0, 1, 0.0, 0.0, 0);
-    capsule(135, -elev_angle, leg_angles_bot, 0, 1, 0.0, 0.0, 0);
-    // the mount
-    *mount([-45, 135], mount_wall, mic_mount_wall, mic_mount_height + mount_top_height + mount_height + capsule_bottom);
-}
-

+ 2 - 2
TinySphEAR.scad

@@ -1,11 +1,12 @@
 //
+// Spherical Harmonics Ear Project (*SpHEAR)
+//
 // TinySpHEAR, Tiny Spherical Harmonics Ear, 
 // First Order (B-format) Ambisonics Microphone
 //
 // Copyright 2015-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
@@ -19,7 +20,6 @@
 //  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/