Bladeren bron

fix indentation, add mounting stalk, remove connecting beams for bottom microphones

Fernando Pablo Lopez-Lezcano 11 jaren geleden
bovenliggende
commit
9139578f48
1 gewijzigde bestanden met toevoegingen van 79 en 34 verwijderingen
  1. 79 34
      first_order.scad

+ 79 - 34
first_order.scad

@@ -12,44 +12,85 @@
 
 // microphone capsule holder
 
-module capsule (azimuth, elevation, separation, radius, height, wall, twist) {
+
+// azimuth: orientation of the capsule
+// elevation: orientation of the capsure
+// separation: how far from the center to displace the capsule
+// radius: radius of the microphone
+// height: height of the microphone
+// wall: thickness of the microphone housing walls
+// twist: adjust the angle of the mounts so they match
+// mounts: number of mounts to create (2 or 3)
+
+
+module capsule (azimuth, elevation, separation, radius, height, wall, twist, mounts) {
 	rotate([0, 0, azimuth]) {
-	rotate([0, (90 - elevation), 0]) {
-  translate([0, 0, separation]) {
-		// the capsule holder
-		difference () {
-				union () {
-					// main capsule holder
-					cylinder(r = radius + wall, h = height, $fn = 128);	
-					// ridge to stop capsule when inserted
-					translate(v = [0, 0, - (wall / 2)]) {
-						difference() {
-							cylinder(r = radius + wall, h = wall / 2, $fn = 128);
-							cylinder(r = radius - 0.4, h = wall / 2, $fn = 128);
+		rotate([0, (90 - elevation), 0]) {
+  			translate([0, 0, separation]) {
+				// the capsule holder
+				difference () {
+					union () {
+						// main capsule holder
+						cylinder(r = radius + wall, h = height, $fn = 128);	
+						// ridge to stop capsule when inserted
+						translate(v = [0, 0, - (wall / 2)]) {
+							difference() {
+								cylinder(r = radius + wall, h = wall / 2, $fn = 128);
+								cylinder(r = radius - 0.4, h = wall / 2, $fn = 128);
+							}
 						}
-					}
-					// the attachment point to the other capsules
-					for (rot = [0 : 120 : 360]) {
-						rotate(a = rot + twist, v = [0, 0, 1]) {
-							translate(v = [radius + wall, 0, wall * 2]) {
-								rotate(a = 145, v = [0, 1, 0]) {
-									cube([wall * 2.5, wall * 2, separation], center=true);
-//								  cylinder(d=wall * 3, h = seaparation, center=true);
+						// the attachment point to the other capsules
+						for (rot = [-120 : 120 : mounts == 2 ? 0 : 120]) {
+							rotate(a = rot + twist, v = [0, 0, 1]) {
+								translate(v = [radius + wall, 0, wall * 2]) {
+									rotate(a = 145, v = [0, 1, 0]) {
+										cube([wall * 2.5, wall * 2, 6], center=true);
+//								  		cylinder(d=wall * 3, h = seaparation, center=true);
+									}
 								}
 							}
 						}
 					}
+					// the inside of the capsule holder
+					cylinder(r = radius, h = height, $fn = 128);
+					// remove the upper part of the attachment points
+					translate(v = [0, 0, height]) {
+						cylinder(r = radius + wall, h = wall);
+					}
 				}
-				// the inside of the capsule holder
-				cylinder(r=radius, h=height, $fn = 128);
-				// remove the upper part of the attachment points
-				translate(v = [0, 0, height]) {
-					cylinder(r = radius + wall, h = wall);
-				}
-			};
+			}
 		}
 	}
 }
+
+// mounting stalk
+
+module stalk (radius_top, radius_bot, length, wall, separation) {
+	// top cone
+	translate([0, 0, -separation]) {
+		difference() {
+			cylinder(h = length, r1 = radius_bot, r2 = radius_top, center = true, $fn = 128);
+			cylinder(h = length, r1 = radius_bot - wall, r2 = radius_top - wall, center = true, $fn=128);
+			// carve out the two microphones, this is a hack
+			translate([-(wall * 3), wall * 3, cap_sep * 1.5]) {
+				rotate([0, 145 + 90, -45]) {
+					cylinder(h = length * 1.4, r = mic_radius + wall, center = true, $fn=128);
+				}
+			}
+			translate([wall * 3, -(wall * 3), cap_sep * 1.5]) {
+				rotate([0, 145 + 90, 135]) {
+					cylinder(h = length * 1.4, r = mic_radius + wall, center = true, $fn=128);
+				}
+			}
+		}
+		// mounting stalk
+		translate([0, 0, -(1.5 * length)]) {
+			difference() {
+				cylinder(h = length * 2, r = radius_bot, center = true, $fn=128);
+				cylinder(h = length * 2, r = radius_bot - wall, center = true, $fn=128);
+			}
+		}
+	}
 }
 
 // vectors pointing in the directions of the four capsules
@@ -77,14 +118,18 @@ el4 = -asin(1/dist);
 mic_radius = 5;
 mic_height = 4.5;
 
-// seaparation between capsules
+// separation between capsules
 cap_sep = 6;
 
 // connect the four instances together
-capsule(az1, el1, cap_sep, mic_radius, mic_height, 1, 60);
-capsule(az2, el2, cap_sep, mic_radius, mic_height, 1, 0);
-capsule(az3, el3, cap_sep, mic_radius, mic_height, 1, 60);
-capsule(az4, el4, cap_sep, mic_radius, mic_height, 1, 0);
+capsule(az1, el1, cap_sep, mic_radius, mic_height, 1, 60, 3);
+capsule(az2, el2, cap_sep, mic_radius, mic_height, 1, 240, 2);
+capsule(az3, el3, cap_sep, mic_radius, mic_height, 1, 60, 3);
+capsule(az4, el4, cap_sep, mic_radius, mic_height, 1, 240, 2);
+
+// the mount
+stalk(mic_radius * 1.25, mic_radius * 2/3, 8, 1, 12);
+
 
 // just one to test
-//capsule(0, -90, cap_sep, mic_radius, mic_height, 1, 0);
+//capsule(0, -90, -mic_height, mic_radius, mic_height, 1, 0);