Prechádzať zdrojové kódy

add code to capsule module to be able to render the modified array mount with a fully symmetrical array (all capsules with three standard horizontal legs)

Fernando Pablo Lopez-Lezcano 9 rokov pred
rodič
commit
4c27b20bd7
1 zmenil súbory, kde vykonal 14 pridanie a 11 odobranie
  1. 14 11
      SpHEAR_common.scad

+ 14 - 11
SpHEAR_common.scad

@@ -33,6 +33,9 @@
 capsule_radius = 5;
 capsule_height = 4.5;
 
+// wall thickness of the capsule holder
+wall = 1;
+
 // distance between the face of a capsule and the center of array
 mic_radius = 9.6;
 
@@ -41,9 +44,6 @@ mic_radius = 9.6;
 leg_width = 5;
 leg_thick = 1.75;
 
-// wall thickness of the capsule holder
-wall = 1;
-
 // width of the ridge that connects to the mount
 ridge_width = 2.0;
 ridge_slot_width = 2.0;
@@ -162,25 +162,28 @@ module capsule (mounts, twist, ridge, ridge_wfit = 0.0, ridge_hfit = 0.0, solid
                     // connect with horizontal legs with triangular top (the best by far)
                     if (connect == 1 && render_legs >= 0) {
                         leg_length = capsule_radius + wall + capsule_height * tan(angles[1]) - fit;
+                        leg_w = (solid != 0)? leg_width + fit : leg_width;
                         slot_radius = (mic_radius - capsule_height) / tan(angles[1]);
-                        translate([0, 2 * (- leg_width / 3), 0]) {
+                        translate([0, 2 * (- leg_w / 3), 0]) {
                             difference() {
-                                cube([leg_length, leg_width + leg_width / 3, capsule_height]);
+                                cube([leg_length, leg_w + leg_w / 3, capsule_height]);
                                 // cut slots that lock with adyacent leg
-                                for (offset = [1, 3]) {
-                                    translate([slot_radius - 1 * fit, leg_width / offset - fit / 2, 0]) {
-                                        rotate([0, 90 - angles[1] * 2, 0]) translate([0, 0, - capsule_height])
-                                        cube([leg_length, leg_width / 3 + fit, capsule_height * 2]);
+                                if (solid == 0) {
+                                    for (offset = [1, 3]) {
+                                        translate([slot_radius - 1 * fit, leg_w / offset - fit / 2, 0]) {
+                                            rotate([0, 90 - angles[1] * 2, 0]) translate([0, 0, - capsule_height])
+                                            cube([leg_length, leg_w / 3 + fit, capsule_height * 2]);
+                                        }
                                     }
                                 }
                                 // shave triangular slice of fingers, starts at edge of capsule holder
                                 translate([capsule_radius + wall, 0, leg_height]) {
                                     rotate([0, 90 - angles[1], 0]) {
-                                        cube([leg_length, leg_width + leg_width / 3, capsule_height]);
+                                        cube([leg_length, leg_w + leg_w / 3, capsule_height]);
                                     }
                                 }
                                 // and remove the rest when the leg height is less than the capsule height
-                                translate([0, - 2 * (- leg_width / 3), leg_height]) {
+                                translate([0, - 2 * (- leg_w / 3), leg_height]) {
                                     difference() {
                                         cylinder(r = capsule_radius + leg_length, h = capsule_height, $fn = facets);
                                         cylinder(r = capsule_radius + wall, h = capsule_height, $fn = facets);