Explorar el Código

render parts separately for both connect == 1 and connect == 2, tweak size of legs as 5mm seems to work best for connect == 2, otherwise the print is not very good

Fernando Pablo Lopez-Lezcano hace 11 años
padre
commit
4865888b24
Se han modificado 1 ficheros con 73 adiciones y 37 borrados
  1. 73 37
      first_order.scad

+ 73 - 37
first_order.scad

@@ -38,7 +38,8 @@ capsule_height = 4.5;
 mic_radius = 10;
 
 // dimensions of capsule holder connection legs
-leg_width = 4;
+// 4mm is too thin for the width, 5mm works better
+leg_width = 5;
 leg_thick = 2.5;
 
 // width of the ridge that connects to the mount
@@ -52,7 +53,7 @@ wall = 1;
 mount_radius = 3.5;
 
 // height of mount
-mount_height = 4;
+mount_height = 12;
 
 //// end of model parameters
 ////
@@ -69,7 +70,7 @@ renderset = 1;
 // 0 -> original cylinder beams
 // 1 -> interlocking beams (out)
 // 2 -> interlocking beams (in)
-connect = 2;
+connect = 1;
 
 //// end of rendering control
 ////
@@ -159,16 +160,13 @@ module capsule (azimuth, elevation, mounts, twist, ridge) {
                                     // 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 + fudge, - leg_width / 3, - leg_length + capsule_height]) {
+									translate([capsule_radius - leg_thick / 2 + fudge, - leg_width / 3, - leg_length + capsule_height]) {
 										difference() {
 											// thickness, width
-                                            //minkowski() {
-                                                cube([leg_thick, leg_width, leg_length]);
-                                                //cylinder(r = wall / 2, h = leg_length / 4, center = false, $fn = 32);
-                                            //}
+                                            cube([leg_thick + leg_thick / 2, 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]);
+												cube([leg_thick + leg_thick / 2, leg_width / 3 + fit, slot_depth]);
 											}
 										}
 									}
@@ -255,6 +253,7 @@ module mount (angles, wall, separation) {
 }
 
 // render a complete microphone
+
 if (rendermic == 1) {
 	capsule(45, elev_angle, leg_angles_top, 60, 0);
 	capsule(-135, elev_angle, leg_angles_top, 60, 0);
@@ -265,35 +264,72 @@ if (rendermic == 1) {
 }
 
 // print all the parts separately
-// at most print two parts at the same time
-part_sep = capsule_radius * 1.6;
+
 if (rendermic == 0) {
-    // #3
-	translate([part_sep, -part_sep, capsule_height]) { capsule(0, -90, leg_angles_top, 45 + 10, 0); }
-    if (renderset != 0) {
-        // #4
-        translate([part_sep, part_sep, capsule_height]) { capsule(0, -90, leg_angles_top, 45 + 10, 0); }
-        // #2
-        translate([-part_sep, part_sep, capsule_height]) { capsule(0, -90, leg_angles_bot, -90, 1); }
-        // #1
-        translate([-part_sep, -part_sep, capsule_height]) { capsule(0, -90, leg_angles_bot, 90, 1); }
-        // mount
-        translate([part_sep * 2.2, 0, mount_height]) { mount([-45, 135], 1, 0); }
-        
-        // add connecting ridges to make it all one part
-        translate([-wall / 2, -part_sep, 0]) {
-            cube([wall, part_sep * 2, wall / 2]);
-        }
-        translate([-(part_sep - capsule_radius - wall / 2), part_sep - wall / 2, 0]) {
-            cube([(part_sep - capsule_radius - wall / 2) * 2, wall, wall / 2]);
-        }
-        translate([-(part_sep - capsule_radius - wall / 2), - part_sep - wall / 2, 0]) {
-            cube([(part_sep - capsule_radius - wall / 2) * 2, wall, wall / 2]);
-        }
-        // connect the mount
-        translate([part_sep * 2 - mount_radius - wall, - mount_radius, 0]) {
-            rotate([0, 0, 45]) {
-                cube([mount_radius, wall, wall / 2]);
+    if (connect == 1) {
+        part_rot = 90;
+        part_height = 0;
+        part_sep = capsule_radius * 2.5;
+        // #3
+        translate([part_sep, -part_sep, part_height]) { capsule(0, part_rot, leg_angles_top, 60, 0); }
+        if (renderset != 0) {
+            // #4
+            translate([part_sep, part_sep, part_height]) { capsule(0, part_rot, leg_angles_top, 60, 0); }
+            // #2
+            translate([-part_sep, part_sep, part_height]) { capsule(0, part_rot, leg_angles_bot, -90, 1); }
+            // #1
+            translate([-part_sep, -part_sep, part_height]) { capsule(0, part_rot, leg_angles_bot, 90, 1); }
+            // mount
+            translate([part_sep * 2.2, 0, mount_height]) { mount([-45, 135], 1, 0); }
+            
+            // add connecting ridges to make it all one part
+            for (rot_a = [-45, 45]) {
+                rotate([0, 0, rot_a]) {
+                    translate([0, -part_sep, 0]) {
+                        cube([wall, part_sep * 2, wall / 2]);
+                    }
+                }
+            }
+            for (rot_b = [-30]) {
+                translate([part_sep * 1.41, -part_sep, 0]) {
+                    rotate([0, 0, rot_b]) {
+                        cube([wall, part_sep, wall / 2]);
+                    }
+                }
+            }
+        } 
+    } else {
+        // connect == 2
+        part_rot = -90;
+        part_height = capsule_height;
+        part_sep = capsule_radius * 1.666;
+        // #3
+        translate([part_sep, -part_sep, part_height]) { capsule(0, part_rot, leg_angles_top, 45 + 10, 0); }
+        if (renderset != 0) {
+            // #4
+            translate([part_sep, part_sep, part_height]) { capsule(0, part_rot, leg_angles_top, 0, 0); }
+            // #2
+            translate([-part_sep, part_sep, part_height]) { capsule(0, part_rot, leg_angles_bot, -90, 1); }
+            // #1
+            translate([-part_sep, -part_sep, part_height]) { capsule(0, part_rot, leg_angles_bot, 90, 1); }
+            // mount
+            translate([part_sep * 2.2, 0, mount_height]) { mount([-45, 135], 1, 0); }
+
+            // add connecting ridges to make it all one part
+            translate([-wall / 2, -part_sep, 0]) {
+                cube([wall, part_sep * 2, wall / 2]);
+            }
+            translate([-(part_sep - capsule_radius - wall / 2), part_sep - wall / 2, 0]) {
+                cube([(part_sep - capsule_radius - wall / 2) * 2, wall, wall / 2]);
+            }
+            translate([-(part_sep - capsule_radius - wall / 2), - part_sep - wall / 2, 0]) {
+                cube([(part_sep - capsule_radius - wall / 2) * 2, wall, wall / 2]);
+            }
+            // connect the mount
+            translate([part_sep * 2 - mount_radius - 1.5 * wall, - mount_radius - wall, 0]) {
+                rotate([0, 0, 45]) {
+                    cube([mount_radius + wall, wall, wall / 2]);
+                }
             }
         }
     }