From e1a02727248166728a33c06d7bdaeb1e55ee883e Mon Sep 17 00:00:00 2001 From: daniel watson Date: Sat, 25 Feb 2017 01:59:43 -0800 Subject: [PATCH] start curve with less overhang for printing --- spin-data.scad | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/spin-data.scad b/spin-data.scad index 0f0ae49..62e216a 100644 --- a/spin-data.scad +++ b/spin-data.scad @@ -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, -- 2.30.2