Ver código fonte

remove old unused code and variables from TinySpHEAR, some tweaks to comments

Fernando Pablo Lopez-Lezcano 10 anos atrás
pai
commit
f065346d8f
1 arquivos alterados com 22 adições e 167 exclusões
  1. 22 167
      TinySphEAR.scad

+ 22 - 167
TinySphEAR.scad

@@ -1,7 +1,8 @@
 //
-// TinySphEAR, Tiny Spherical Ear, First Order (B-format) Ambisonics Microphone
+// TinySpHEAR, Tiny Spherical Harmonics Ear, 
+// First Order (B-format) Ambisonics Microphone
 //
-// Copyright 2015, Fernando Lopez-Lezcano, All Rights Reserved
+// Copyright 2015-2016, Fernando Lopez-Lezcano, All Rights Reserved
 // nando@ccrma.stanford.edu
 //
 //
@@ -30,42 +31,38 @@
 ////
 //// model parameters
 
-// dimensions of the EM182 electret microphone
+// dimensions of the electret microphone capsule
 capsule_radius = 5;
 capsule_height = 4.5;
 
-// distance between face of capsule and center of array
+// 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 = 10.6;
 
-// dimensions of capsule holder connection legs
-// 4mm is too thin for the width, 5mm works better
+// dimensions of the capsule holder connection legs
+// a width of 4mm is too thin, 5mm prints better
 leg_width = 5;
 leg_thick = 3;
 
+// wall thickness of the capsule holder
+wall = 1;
+
 // width of the ridge that connects to the mount
-//   measured: ridge = 2.20mm, slot = 2.0 - 2.35mm
+//   measured: ridge = 2.20mm, slot = 2.0 .. 2.35mm
 ridge_width = 2.0;
 ridge_slot_width = 2.0;
 // add to the thickness of ridges
 ridge_fit = 0.1;
 
-// wall thickness of capsule holder
-wall = 1;
-
-// dimensions of microphone holder
+// dimensions of microphone mount
 mount_radius = 2.75;
 mount_wall = 0.75;
 
 // height of mount
 mount_height = 40;
 
-// height of sleeve
-sleeve_height = 23;
-sleeve_wall = 0.75;
-
 // microphone stand mount
 //
 // diameter of existing shielded wires (x 4)
@@ -73,6 +70,7 @@ mic_wire_diam = 1.5;
 mic_wire_hole_radius = 2.5;
 mic_wire_hole_offset = 5;
 
+// standard microphone stand
 // measured diameter = 13.5, inside diameter of sleeve = 13.79 (
 mic_mount_radius = 13.50 / 2;
 // add this to inside diameter
@@ -91,8 +89,8 @@ mic_mount_height = 35.0 + mic_wire_hole_offset + mic_wire_hole_radius + 2 * mic_
 // 0 -> ready to print
 //   set = 0 -> one capsule, set = 1 -> four capsules
 // 1 -> the whole microhone with four capsules
-rendermic = 1;
-renderset = 0;
+rendermic = 0;
+renderset = 1;
 
 // what type of connection to use between capsule holders:
 // 0 -> original cylindrical angled legs
@@ -100,8 +98,8 @@ renderset = 0;
 // 2 -> interlocking vertical legs
 connect = 2;
 
-// what type of mount ridges to use
-// 0 -> nothing
+// how many mount ridges to create
+// 0 -> no ridges
 // 1 -> 1 ridge
 // 2 -> 2 ridges
 ridges = 1;
@@ -137,7 +135,7 @@ fit = 0.1;
 // number of facets for rendering cylinders
 facets = 64;
 
-// microphone holder geometry
+// microphone structure geometry
 capsule_sep_min = (mic_radius - capsule_height) * cos(elev_angle) - (capsule_radius + wall) * sin(elev_angle);
 capsule_sep_max = mic_radius * cos(elev_angle) - (capsule_radius + wall) * sin(elev_angle);
 capsule_bottom = mic_radius * sin(elev_angle) + (capsule_radius + wall) * cos(elev_angle);
@@ -150,9 +148,9 @@ mount_radius_capsule = capsule_sep_max;
 // elevation: vertical orientation of the capsure
 // 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: 1 -> print ridge for mount
-// ridge_fit: tune the fit, used for carving slot in mount
-// solid: make the capsule holder solid, used in the mount to carve the capsule rests
+// ridge: add 0, 1 or 2 ridges for attaching the structure to the mount
+// ridge_fit: tune the fit, used for carving slots in mount
+// solid: make the capsule holder solid, used in the mount code to carve the capsule rests
 
 module capsule (azimuth, elevation, mounts, twist, ridge, ridge_fit = 0.0, solid = 0) {
     rotate([0, 0, azimuth]) {
@@ -334,149 +332,6 @@ module mount (angles, wall, stand_wall, separation) {
     }
 }
 
-// microphone mount
-//
-// angles: angles for mount slots
-// wall: thickness of cylinder wall
-// separation: height of mount with respect of the microphone assembly
-
-module mount_stalk (angles, wall, separation, solid = 0) {
-    cone_height = 5;
-    translate([0, 0, -(separation - 0)]) {
-        difference() {
-            union() {
-                // conic section
-                translate([0, 0, -cone_height]) {
-                    difference() {
-                        cylinder(r2 = mount_radius_capsule, r1 = mount_radius + wall, h = cone_height, $fn = facets);
-                        // make the hole for the mount (* 1.5 to cut the ridge as well)
-                        if (solid == 0) {
-                            cylinder(r2 = mount_radius_capsule - wall, r1 = mount_radius, h = cone_height * 1.5, $fn = facets);
-                        }
-                    }
-                }
-                translate([0, 0, -mount_height]) {
-                    difference() {
-                        cylinder(r = mount_radius + wall, h = mount_height - cone_height, $fn = facets);
-                        // make the hole for the mount (* 1.5 to cut the ridge as well)
-                        cylinder(r = mount_radius, h = (mount_height - cone_height) * 1.5, $fn = facets);
-                    }
-                }
-            }
-            // indentations that match the lower capsule holders
-            translate([0, 0, (mic_radius - capsule_height) + capsule_height * sin(elev_angle)]) {
-                capsule(angles[0], -elev_angle, [], 0, 1, 0.1, 1);
-                capsule(angles[1], -elev_angle, [], 0, 1, 0.1, 1);
-            }
-            // slice it open so we can pop in cables
-            if (solid == 0) {
-                rotate([0, 0, 45]) {
-                    translate([mount_radius - fudge, - mic_wire_diam / 2, -mount_height]) {
-                        cube([mount_radius_capsule - mount_radius + fudge, mic_wire_diam, mount_height]);
-                    }
-                }
-            }
-        }
-    }
-}
-
-module mount_sleeve (wall, separation, solid = 0) {
-    translate([0, 0, -(separation + 0.0)]) {
-        difference() {
-            union() {
-                // main mount cylinder
-                translate([0, 0, -mount_height]) {
-                    difference() {
-                        cylinder(r = mount_radius + mount_wall + wall, h = sleeve_height, $fn = facets);
-                        // make the hole for the mount (* 1.5 to cut the ridge as well)
-                        if (solid == 0) {
-                            cylinder(r = mount_radius + mount_wall, h = sleeve_height * 1.5, $fn = facets);
-                        }
-                    }
-                }
-                // spine that fits into slice of mount body
-                rotate([0, 0, 45]) {
-                    translate([mount_radius - mount_wall, - mic_wire_diam / 2, -mount_height]) {
-                        cube([2 * mount_wall, mic_wire_diam, sleeve_height]);
-                    }
-                }
-            }
-            // cut a bit less that one half of the sleeve so it fits around the body
-            rotate([0, 0, 45]) {
-                translate([-mount_radius - 4 * wall, - (mount_radius + wall) /2, -mount_height]) {
-                    cube([mount_radius + wall, (mount_radius + wall), sleeve_height]);
-                }
-            }
-        }
-    }
-}
-
-// mount for microphone stand
-
-module stand_mount (wall, separation) {
-    translate([0, 0, -separation]) {
-        difference() {
-            union() {
-                // main mount cylinder
-                translate([0, 0, - mic_mount_height]) {
-                    difference() {
-                        cylinder(r = mic_mount_radius + mic_mount_fit + wall, h = mic_mount_height, $fn = facets);
-                        // make the hole for the mount (* 1.5 to cut the ridge as well)
-                        cylinder(r = mic_mount_radius + mic_mount_fit, h = mic_mount_height, $fn = facets);
-                    }
-                }
-            }
-            // slot for fitting into microphone stand
-            translate([mic_mount_radius - wall / 2, - mic_mount_slot_width / 2, - mic_mount_height]) {
-                cube([2 * wall, mic_mount_slot_width, mic_mount_slot_height]);
-            }
-            // eyelet for microphone stand
-            translate([mic_mount_radius - wall / 2, 0,  - mic_mount_height + mic_mount_slot_height]) {
-                rotate([0, 90, 0]) {
-                    cylinder(r = mic_mount_slot_radius, h = 2 * wall, $fn = facets);
-                }
-            }
-            // slot and hole for microphone wiring
-            translate([mic_mount_radius - wall / 2, - mic_wire_diam / 2, - mic_wire_hole_offset]) {
-                cube([2 * wall, mic_wire_diam, mic_wire_hole_offset]);
-            }
-            translate([mic_mount_radius - wall / 2, 0, - mic_wire_hole_offset]) {
-                rotate([0, 90, 0]) {
-                    cylinder(r = mic_wire_hole_radius, h = 2 * wall, $fn = facets);
-                }
-            }    
-        }
-    }
-}
-
-// the cap that connects the microphone stand mount with the microphone mount
-
-module stand_mount_cap (wall, separation) {
-    translate([0, 0, -(separation)]) {
-        difference() {
-            union() {
-                // cap
-                cylinder(r = mic_mount_radius + mic_mount_fit + wall, h = wall, $fn = facets);
-                translate([0, 0, - 2 * wall]) {
-                    cylinder(r = mic_mount_radius + mic_mount_fit, h = 3 * wall, $fn = facets);
-                }
-            }
-            // use mount and sleeve to cut hole of correct size and shape
-            translate([0, 0, mount_height - 2 * wall]) {
-                mount([45, -135], mount_wall, 0, 1);
-                mount_sleeve(sleeve_wall, 0, 1);
-            }
-            translate([0, 0, - 2 * wall]) {
-                cylinder(r = mount_radius + mount_wall, h = 3 * wall, $fn = facets);
-            }
-            // slot for microphone wiring
-            translate([0, - mic_wire_diam / 2, - 2 * wall]) {
-                cube([mic_mount_radius + mic_mount_fit + wall, mic_wire_diam, 3 * wall]);
-            }
-        }
-    }
-}
-
 // render a complete microphone
 
 if (rendermic == 1) {
@@ -548,7 +403,7 @@ if (rendermic == 0) {
                     }
                 }
                 // remove them in the inside of the mount
-                cylinder(r = mic_mount_radius + mount_wall / 2, h = wall / 2);
+                *cylinder(r = mic_mount_radius + mount_wall / 2, h = wall / 2);
             }
         }
     }