Jelajahi Sumber

push the latest (very old) changes to the Octathingy design

Fernando Pablo Lopez-Lezcano 10 tahun lalu
induk
melakukan
eefa3b97fa
1 mengubah file dengan 112 tambahan dan 110 penghapusan
  1. 112 110
      Octathingy.scad

+ 112 - 110
Octathingy.scad

@@ -6,7 +6,7 @@
 // by Eric Benjamin, Audio Engineering Society Convention Paper 8728, 
 // October 2012, San Francisco
 
-// Copyright 2015, Fernando Lopez-Lezcano, All Rights Reserved
+// Copyright 2015-2016, Fernando Lopez-Lezcano, All Rights Reserved
 // nando@ccrma.stanford.edu
 //
 //
@@ -32,7 +32,7 @@
 ////
 //// model parameters
 
-// dimensions of the EM182 electret microphone
+// dimensions of the electret microphone capsule
 capsule_radius = 5;
 capsule_height = 4.5;
 
@@ -69,13 +69,13 @@ tetra_compat = 0;
 // 0 -> ready to print
 //   set = 0 -> one capsule, set = 1 -> four capsules
 // 1 -> the whole microhone with eight capsules
-rendermic = 0;
-renderset = 1;
+rendermic = 1;
+renderset = 0;
 
 // what type of connection to use between capsule holders:
-// 0 -> original cylinder beams
-// 1 -> interlocking beams (out)
-// 2 -> interlocking beams (in)
+// 0 -> original cylindrical angled legs
+// 1 -> interlocking horizontal legs
+// 2 -> interlocking vertical legs
 connect = 1;
 
 // adjustment for the radius of the capsule
@@ -84,7 +84,7 @@ connect = 1;
 fudge = 0.15;
 
 // adjustment for fit of slots in connection legs and mount
-fit = 0.2;
+fit = 0.1;
 
 // number of facets for rendering cylinders
 facets = 64;
@@ -150,88 +150,90 @@ mount_slot_depth = ridge_length * sin(elev_angle);
 // mounts: vectors containing the angle of the mount and the angle to the adjacent capsule
 // twist: rotate the whole capsule to match mounting legs
 
-module capsule (azimuth, elevation, mounts, twist, ridge) {
-	rotate([0, 0, azimuth]) {
-		rotate([0, (90 - elevation), 0]) {
-  			translate([0, 0, rendermic == 0 ? 0 : mic_radius - capsule_height]) {
-				difference () {
-					union () {
-						// main capsule holder
-						cylinder(r = capsule_radius + wall, h = capsule_height, $fn = facets);	
-						// the mounting legs
-						for (angles = mounts) {
-							rotate([0, 0, angles[0] + twist]) {
-								// connect with cylindrical beams, very pretty
+module capsule (azimuth, elevation, mounts, twist, ridge, ridge_fit = 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 = facets);    
+                        // the mounting legs
+                        for (angles = mounts) {
+                            rotate([0, 0, angles[0] + twist]) {
+                                // connect with cylindrical beams, very pretty
                                 leg_length = mic_radius * sin(angles[1]) - (capsule_radius + wall) * cos(angles[1]) + wall;
-								if (connect == 0) {
-									translate([capsule_radius - wall, 0, capsule_height - wall]) {
-										rotate([0, 180 - (90 - angles[1]), 0]) {
-											cylinder(d = leg_width, h = leg_length - 0.1, center = false, $fn = facets);
-										}
-									}
-								}
-								// connect with horizontal legs
-								if (connect == 1) {
+                                if (connect == 0) {
+                                    translate([capsule_radius - wall, 0, capsule_height - wall]) {
+                                        rotate([0, 180 - (90 - angles[1]), 0]) {
+                                            cylinder(d = leg_width, h = leg_length - 0.1, center = false, $fn = facets);
+                                        }
+                                    }
+                                }
+                                // connect with horizontal legs
+                                if (connect == 1) {
                                     leg_length = (mic_radius - capsule_height + leg_thick) * tan(angles[1]) - capsule_radius;
                                     slot_depth = leg_thick * cos(90 - 2 * angles[1]) + 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) {
+                                    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) {
                                     leg_length = (mic_radius * tan(angles[1]) - capsule_radius) * tan(90 - angles[1]); 
                                     slot_depth = leg_thick * (cos (90 - 2 * angles[1]) + tan(90 - 2 * angles[1])) + fit;
-									translate([capsule_radius + fudge, - leg_width / 3, - leg_length + capsule_height]) {
-										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]);
-											}
-										}
-									}
-								}
-							}
-						}
-						// add ridges for microphone mount
-						if (ridge == 1) {
-							rotate([0, 0, twist]) {
-								translate([capsule_radius + fudge, - wall , 0]) {
-									difference() {
-										cube([ridge_length, ridge_width, capsule_height], center = false);
-										//rotate([0, 90 - elev_angle, 0]) {
-										//	cube([ridge_length, ridge_width, capsule_height], center = false);
-										//}
-									}
-								}
-							}
-						}
-					}
-					// make the hole for the capsule
-					translate ([0, 0, -2]) {
-						cylinder(r = capsule_radius + fudge, h = capsule_height + 2, $fn = facets);
-					}
-					// 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 = facets);
-						}
-					}
-				}
+                                    translate([capsule_radius + fudge, - leg_width / 3, - leg_length + capsule_height]) {
+                                        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]);
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                        // add ridges for microphone mount
+                        if (ridge == 1) {
+                            rotate([0, 0, twist]) {
+                                translate([capsule_radius + fudge, - wall , 0]) {
+                                    difference() {
+                                        cube([ridge_length, ridge_width, capsule_height], center = false);
+                                        //rotate([0, 90 - elev_angle, 0]) {
+                                        //  cube([ridge_length, ridge_width, capsule_height], center = false);
+                                        //}
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    // make the hole for the capsule
+                    if (solid != 1) {
+                        translate ([0, 0, -2]) {
+                            cylinder(r = capsule_radius + fudge, h = capsule_height + 2, $fn = facets);
 			}
-		}
-	}
+                    }
+                    // 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 = facets);
+                        }
+                    }
+                }
+            }
+        }
+    }
 }
 
 // microphone mount
@@ -241,45 +243,45 @@ module capsule (azimuth, elevation, mounts, twist, ridge) {
 // separation: height of mount with respect of the microphone assembly
 
 module mount (angles, wall, separation) {
-	translate([0, 0, -(separation + 0.1)]) {
-		difference() {
-			union() {
-				// grips for the capsule holder ridge
-				for (rot = angles) {
-					rotate([0, 0, rot]) {
-						translate([-capsule_sep_max, -(ridge_width - fit / 2), -mount_height]) {
-							cube([capsule_sep_max, ridge_width * 2 - fit, mount_height]);
+    translate([0, 0, -(separation + 0.1)]) {
+        difference() {
+            union() {
+                // grips for the capsule holder ridge
+                for (rot = angles) {
+                    rotate([0, 0, rot]) {
+                        translate([-capsule_sep_max, -(ridge_width - fit / 2), -mount_height]) {
+                            cube([capsule_sep_max, ridge_width * 2 - fit, mount_height]);
                             rotate([0, -elev_angle, 0]) {
                                 cube([capsule_sep_max, ridge_width * 2 - fit, mount_height * cos(elev_angle)]);
                             }
-						}
-					}
-				}
-				translate([0, 0, -mount_height]) {
-					cylinder(r = mount_radius + wall, h = mount_height, $fn = facets);
-				}
-			}
-			// make the hole for the mount (* 2 to cut the ridge as well)
-			translate([0, 0, -mount_height]) {
-				cylinder(r = mount_radius, h = mount_height * 2, $fn = facets);
-			}
+                        }
+                    }
+                }
+                translate([0, 0, -mount_height]) {
+                    cylinder(r = mount_radius + wall, h = mount_height, $fn = facets);
+                }
+            }
+            // make the hole for the mount (* 2 to cut the ridge as well)
+            translate([0, 0, -mount_height]) {
+                cylinder(r = mount_radius, h = mount_height * 2, $fn = facets);
+            }
             // cut the outside of the sloped ridge
-			translate([0, 0, -mount_height]) {
+            translate([0, 0, -mount_height]) {
                 difference() {
                     cylinder(r = capsule_sep_max + mount_height * 2, h = mount_height * 2, $fn = facets);
                     cylinder(r = capsule_sep_max, h = mount_height * 2, $fn = facets);
                 }
-			}
-			// and cut a slot for the ridges in the wall of the cylinder
+            }
+            // and cut a slot for the ridges in the wall of the cylinder
             for (rot = angles) {
                 rotate([0, 0, rot]) {
                     translate([-capsule_sep_max * 2, -ridge_width + 4 * fit, -mount_slot_depth]) {
                         cube([capsule_sep_max * 2, ridge_width + 2 * fit, mount_height * 2]);
                     }
                 }
-			}
-		}
-	}
+            }
+        }
+    }
 }
 
 // render a complete microphone
@@ -289,7 +291,7 @@ if (rendermic == 1) {
         capsule(az + 45, -elev_angle, leg_angles, 0, 1);
     }
     // the mount
-	mount([0, 90, -90, 180], 1, capsule_bottom);
+    mount([0, 90, -90, 180], 1, capsule_bottom);
 }
 
 // print all the parts separately