start curve with less overhang for printing
authordaniel watson <ozzloy@gmail.com>
Sat, 25 Feb 2017 09:59:43 +0000 (01:59 -0800)
committerdaniel watson <ozzloy@gmail.com>
Sat, 25 Feb 2017 09:59:43 +0000 (01:59 -0800)
spin-data.scad

index 0f0ae491481ef636b3bc34fcb532b5d033d897de..62e216ab4a5135972db6ebb5fbc653be53efc492 100644 (file)
@@ -76,7 +76,7 @@ module spin_footprint(weight_radius,
                       arms) {
   thinner_radius = (bearing_radius < weight_radius)?
     bearing_radius : weight_radius;
-  fillet(thinner_radius) {
+  fillet(thinner_radius / 2) {
     for(arm = [0 : arms - 1]) {
       hull() {
         circle(bearing_radius + round_extra);
@@ -104,13 +104,30 @@ module spin(weight_radius,
   actual_height = layers * layer_height;
   round_radius = actual_height / 2;
 
+  old_start = 0;
+  old_end = (layers / 2) - 1;
+
+  new_start = old_end / 16;
+  new_end = old_end;
+
+  old_range = old_end - old_start;
+  new_range = new_end - new_start;
+
+  factor = new_range / old_range;
+
+  initial_adjacent = round_radius - (new_start * layer_height);
+  initial_angle = acos(initial_adjacent / round_radius);
+  initial_round_extra = initial_adjacent * tan(initial_angle);
+  
   mirrored([0, 0, 1]) {
     for(layer = [0 : (layers / 2) - 1]) {
       translate([0, 0, layer * layer_height - actual_height / 2]) {
         linear_extrude(height = layer_height) {
-          adjacent = round_radius - (layer * layer_height);
+          new_layer = (layer - old_start) * factor + new_start;
+          adjacent = round_radius - (new_layer * layer_height);
           angle = acos(adjacent / round_radius);
-          round_extra = adjacent * tan(angle);
+          round_extra = adjacent * tan(angle) - initial_round_extra;
+          echo(round_extra);
           spin_footprint(weight_radius,
                          bearing_radius,
                          round_extra,