Explorar el Código

fix the rounded corners of all boxes so that the wall is constant thickness, create another function for the support ring of the shock mount, calculate radius of support ring based on the approximate angle of the elastic bands and the separation between the body rings

Fernando Pablo Lopez-Lezcano hace 10 años
padre
commit
e2c2a4ffd4
Se han modificado 1 ficheros con 48 adiciones y 35 borrados
  1. 48 35
      TinySpHEAR_mount_pcb.scad

+ 48 - 35
TinySpHEAR_mount_pcb.scad

@@ -109,6 +109,8 @@ module tetra_pcb_clear(length, width, thick, slot_depth, front, back) {
     }
 }
 
+// create a box with rounded corners
+
 module tetra_mount_box(height, radius, corner) {
     rd = radius - corner;
     minkowski() {
@@ -119,10 +121,14 @@ module tetra_mount_box(height, radius, corner) {
     }
 }
 
+module tetra_mount_box_relative(height, ref_radius, ref_corner, radius_inc) {
+    corner = (ref_radius + radius_inc) * (ref_radius - ref_corner) / ref_radius;
+    tetra_mount_box(height, ref_radius + radius_inc, corner);
+}
+
 // the main body of the microphone mount
 
 module tetra_mount_body(height, radius, corner, lower_lip, upper_lip, clear) {
-    rd = radius - corner;
     difference() {
         tetra_mount_box(height, radius, corner);
         union() {
@@ -134,7 +140,7 @@ module tetra_mount_body(height, radius, corner, lower_lip, upper_lip, clear) {
             slot_len = 15;
             translate([0, 0, slot_len]) {
                 hull() {
-                    tetra_mount_box(height - (3 * slot_len), radius - 2 * wall, corner);
+                    tetra_mount_box_relative(height - (3 * slot_len), radius, corner, - (2 * wall));
                     translate([0, 0, height - (2 * slot_len) + height / 3]) {
                         cylinder(r = radius / 3, h = 1, $fn = facets);
                     }
@@ -144,14 +150,14 @@ module tetra_mount_body(height, radius, corner, lower_lip, upper_lip, clear) {
             translate([0, 0, height - upper_lip]) {
                 difference() {
                     tetra_mount_box(upper_lip, radius, corner);
-                    tetra_mount_box(upper_lip, radius - (wall + lip_fit), corner);
+                    tetra_mount_box_relative(upper_lip, radius, corner, -(wall + lip_fit));
                 }
             }
             // lower lip for flare to cable
             translate([0, 0, 0]) {
                 difference() {
                     tetra_mount_box(lower_lip, radius, corner);
-                    tetra_mount_box(lower_lip, radius - (wall + lip_fit), corner);
+                    tetra_mount_box(lower_lip, radius, corner, -(wall + lip_fit));
                 }
             }
         }
@@ -199,9 +205,9 @@ module tetra_mount_flare(height, lip, transition, bot_radius, bot_corner, top_ra
     // bottom rounded box
     difference() {
         tetra_mount_box(height, bot_radius, bot_corner);
-        tetra_mount_box(height, bot_radius - 2 * wall, bot_corner);
+        tetra_mount_box_relative(height, bot_radius, bot_corner, -(2 * wall));
         // flange to mount on body
-        tetra_mount_box(lip + 1.0, bot_radius - wall, bot_corner);
+        tetra_mount_box_relative(lip + 1.0, bot_radius, bot_corner, - wall);
     }
     // flare to round section
     translate([0, 0, height]) {
@@ -213,7 +219,7 @@ module tetra_mount_flare(height, lip, transition, bot_radius, bot_corner, top_ra
                 }
             }
             hull() {
-                tetra_mount_box(1, bot_radius - 2 * wall, bot_corner);
+                tetra_mount_box_relative(1, bot_radius, bot_corner, - 2 * wall);
                 translate([0, 0, transition]) {
                     cylinder(r = top_radius - wall, h = 1, $fn = facets);
                 }
@@ -252,21 +258,23 @@ module tetra_capsule_array_mount(angles) {
 
 // internal ring of shock mount
 
-module tetra_shock_mount_int_ring(height, radius, corner, lip) {
+module tetra_shock_mount_body_ring(height, radius, corner, rinc, lip) {
     slot_sep = radius * 2 / 2.7;
     slot_w = 6;
     slot_o = height / 3;
-    difference() {
-        tetra_mount_box(slot_o, radius + wall, corner);
-        tetra_mount_box(slot_o, radius - 2 * wall, corner - 2.0);
+    // base ring
+    *difference() {
+        tetra_mount_box_relative(slot_o, radius + rinc, corner, 3 * wall);
+        tetra_mount_box(slot_o, radius + rinc, corner);
     }
+    // upper ring with slots for rubber bands
     difference() {
-        tetra_mount_box(height, radius + 2 * wall, corner);
-        tetra_mount_box(height, radius, corner - 2.0);
+        tetra_mount_box_relative(height, radius + rinc, corner, 4 * wall);
+        tetra_mount_box_relative(height, radius + rinc, corner, 2 * wall);
         for (rot = [0, 90, 180, 270]) {
             rotate([0, 0, rot]) {
                 for (xo = [1, -1] * slot_sep) {
-                    translate([-slot_w / 2 + xo, radius - 2 * wall, slot_o]) {
+                    translate([-slot_w / 2 + xo, radius + rinc, slot_o]) {
                         // slots for rubber bands
                         cube([slot_w, 10, slot_o]);
                         translate([slot_w / 3, 0, 0]) {
@@ -280,7 +288,7 @@ module tetra_shock_mount_int_ring(height, radius, corner, lip) {
     for (rot = [0, 90, 180, 270]) {
         rotate([0, 0, rot]) {
             // slots for connecting the upper and lower rings
-            translate([radius + wall, -(slot_sep + slot_w/3)/2, 0]) {
+            translate([radius + rinc + 2 * wall, -(slot_sep + slot_w/3)/2, 0]) {
                 difference() {
                     cube([5, slot_sep + slot_w/3, height]);
                     translate([0, wall, 0]) {
@@ -291,7 +299,7 @@ module tetra_shock_mount_int_ring(height, radius, corner, lip) {
             // lip to support microphone on lower ring only
             if (lip == 1) {
                 lip_w = 10;
-                translate([radius, -lip_w/2, height]) {
+                translate([radius + rinc + 2 * wall, -lip_w/2, height]) {
                     rotate([90, 90, 180]) {
                         linear_extrude(height = lip_w) {
                             polygon([[0, 0], [0, 4], [1, 4], [height * 2/3, 0]]);
@@ -303,6 +311,23 @@ module tetra_shock_mount_int_ring(height, radius, corner, lip) {
     }    
 }
 
+module tetra_shock_mount_main_ring(height, radius, corner, rinc, lip) {
+    difference() {
+        tetra_mount_box_relative(6, box_radius, mount_corner, rinc);
+        tetra_mount_box_relative(6, box_radius, mount_corner, rinc - 4 * wall);
+    }
+    for (rot = [0, 90, 180, 270]) {
+        rotate([0, 0, rot]) {
+            translate([box_radius + rinc + 4 * wall, -7.5, 0]) {
+                cube([4, 15, 6]);
+            }
+            translate([box_radius + rinc, -2, 0]) {
+                cube([7, 4, 6]);
+            }
+        }
+    }
+}
+
 // main body of microphone mount
 //
 *translate([0, 0, -(pcb_length - pcb_low_exp - pcb_hi_exp + 10)]) {
@@ -325,7 +350,7 @@ module tetra_shock_mount_int_ring(height, radius, corner, lip) {
 //
 
 //translate([0, 0, -(10 + pcb_length - pcb_low_exp - pcb_hi_exp + 10)]) {
-translate([0, 0, -15]) {
+translate([0, 0, -14]) {
     rotate([0, 180, 0]) {
         tetra_mount_flare(10 + pcb_low_exp, mount_lip, 20, box_radius + wall, mount_corner, cable_diam / 2 + wall, 10);
     }
@@ -335,35 +360,23 @@ translate([0, 0, -15]) {
 //
 
 ring_sep = 30;
+ring_height = 6;
+band_angle = 40;
+main_radius_inc = (ring_sep / 2) / tan(band_angle);
 
 translate([0, 0, -3]) {
     //rotate([0, 180, 0]) {
-        tetra_shock_mount_int_ring(10, box_radius + 3.5 * wall, 12, 0);
+        tetra_shock_mount_body_ring(10, box_radius, mount_corner, 0.5, 0);
         rotate([0, 180, 0]) {
             translate([0, 0, ring_sep]) {
-                tetra_shock_mount_int_ring(10, box_radius + 3.5 * wall, 12, 1);
+                tetra_shock_mount_body_ring(10, box_radius, mount_corner, 0.5, 1);
             }
         }
     //}
 }
 
 translate([0, 0, - ring_sep / 2 - 5]) {
-    difference() {
-        tetra_mount_box(6, box_radius + 25, 25);
-        tetra_mount_box(6, box_radius + 25 - 4 * wall, 25 - 2.0);
-//        cylinder(r = box_radius + 25, h = 6, $fn = facets);
-//        cylinder(r = box_radius + 25 - 3 * wall, h = 6, $fn = facets);
-    }
-        for (rot = [0, 90, 180, 270]) {
-            rotate([0, 0, rot]) {
-                translate([box_radius + 25 + 4 * wall, -7.5, 0]) {
-                    cube([4, 15, 6]);
-                }
-                translate([box_radius + 25, -2, 0]) {
-                    cube([7, 4, 6]);
-                }
-            }
-        }        
+        tetra_shock_mount_main_ring(10, box_radius, mount_corner, main_radius_inc, 0);
 }
 
 // first try at a ccrma logo