From 05f8d8b05138b6905f41aa139cd54964d4893791 Mon Sep 17 00:00:00 2001 From: Anders Blomdell Date: Thu, 19 Jan 2023 10:41:26 +0100 Subject: [PATCH 1/4] Add helix_angle parameter to involute_gear (overrides previous twist parameter) --- involute_gears.scad | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/involute_gears.scad b/involute_gears.scad index 39b24aa..a793d4e 100644 --- a/involute_gears.scad +++ b/involute_gears.scad @@ -315,7 +315,8 @@ module gear ( backlash=0, twist=0, involute_facets=0, - flat=false) + flat=false, + helix_angle=undef) { // Check for undefined circular pitch (happens when neither circular_pitch or diametral_pitch are specified) if (circular_pitch==undef) @@ -357,6 +358,9 @@ module gear ( rim_width = (rim_width!=undef?rim_width:root_radius * .1); rim_radius = root_radius - rim_width; + // Convert helix_angle to twist + twist = (helix_angle!=undef?180/pi*rim_thickness/(pitch_radius*tan(90-helix_angle)):twist); + // Variables controlling the hub hub_thickness = (hub_thickness!=undef?(hub_thickness!=0?hub_thickness:gear_thickness):gear_thickness * 2); hub_diameter = (hub_diameter!=undef?hub_diameter:root_radius * .3); From 168b748464e3bbdccb8e908f7eda3d9cf5ade740 Mon Sep 17 00:00:00 2001 From: Anders Blomdell Date: Thu, 19 Jan 2023 10:51:49 +0100 Subject: [PATCH 2/4] Add number_of_hidden_teeth to involute_gears (makes nice looking partial helical gears easier to create) --- involute_gears.scad | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/involute_gears.scad b/involute_gears.scad index a793d4e..316feee 100644 --- a/involute_gears.scad +++ b/involute_gears.scad @@ -316,7 +316,8 @@ module gear ( twist=0, involute_facets=0, flat=false, - helix_angle=undef) + helix_angle=undef, + number_of_hidden_teeth=0) { // Check for undefined circular pitch (happens when neither circular_pitch or diametral_pitch are specified) if (circular_pitch==undef) @@ -406,7 +407,8 @@ module gear ( base_radius = base_radius, outer_radius = outer_radius, half_thick_angle = half_thick_angle, - involute_facets=involute_facets); + involute_facets=involute_facets, + number_of_hidden_teeth = number_of_hidden_teeth); //if we have a 0 hub thickness, then hub must be removed if (hub_thickness == 0) @@ -551,13 +553,14 @@ module gear_shape ( base_radius, outer_radius, half_thick_angle, - involute_facets) + involute_facets, + number_of_hidden_teeth=0) { union() { rotate (half_thick_angle) circle ($fn=number_of_teeth*2, r=root_radius); - for (i = [1:number_of_teeth]) + for (i = [1:1:number_of_teeth-number_of_hidden_teeth]) { rotate ([0,0,i*360/number_of_teeth]) { From 5947cd2ccc4d54bd4f01daad4da6ae413c647081 Mon Sep 17 00:00:00 2001 From: Anders Blomdell Date: Thu, 19 Jan 2023 11:55:47 +0100 Subject: [PATCH 3/4] Add helix_angle to rack --- involute_gears.scad | 51 +++++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/involute_gears.scad b/involute_gears.scad index 316feee..e66ca1e 100644 --- a/involute_gears.scad +++ b/involute_gears.scad @@ -500,7 +500,8 @@ module rack( clearance=0.2, rim_thickness=8, rim_width=5, - flat=false) + flat=false, + helix_angle=0) { if (circular_pitch==false && diametral_pitch==false) @@ -514,23 +515,41 @@ module rack( dedendum = addendum + clearance; pitch_slope = tan(pressure_angle); - linear_extrude_flat_option(flat=flat, height=rim_thickness) - union() - { - translate([0,-dedendum-rim_width/2]) - square([number_of_teeth*pitch, rim_width],center=true); - - p1 = pitch / 4 + pitch_slope * dedendum; - p2 = pitch / 4 - pitch_slope * addendum; - for(i=[1:number_of_teeth]) - translate([pitch*(i-number_of_teeth/2-0.5),0]) - polygon(points=[ - [-p1,-dedendum], - [p1,-dedendum], - [p2,addendum], - [-p2,addendum] + module profile() { + translate([0,-dedendum-rim_width/2]) + square([number_of_teeth*pitch, rim_width],center=true); + + p1 = pitch / 4 + pitch_slope * dedendum; + p2 = pitch / 4 - pitch_slope * addendum; + for(i=[1:number_of_teeth]) + translate([pitch*(i-number_of_teeth/2-0.5),0]) + polygon(points=[ + [-p1,-dedendum], + [p1,-dedendum], + [p2,addendum], + [-p2,addendum] ]); + } + + if (flat) { + profile(); + } else { + // Helical helper variables + length = pitch * number_of_teeth; + height = rim_thickness + length*abs(tan(helix_angle)); + x = length + rim_thickness*abs(tan(helix_angle)); + intersection() { + translate([0,0,rim_thickness/2]) // Translate back to original baseline + rotate([0,helix_angle,0]) // Rotate with helix angle + translate([0,0,-height/2]) // Rotation around middle of extrusion + linear_extrude(height=height) { + rotate([0,-helix_angle,0]) // Adjust profile to helix angle + profile(); + } + // Clip extrusion to rim height + translate([-x/2,-dedendum-rim_width, 0]) cube([x, rim_width+dedendum+addendum, rim_thickness]); } + } } module linear_extrude_flat_option(flat =false, height = 10, center = false, convexity = 2, twist = 0) From 98b4826bfef26febe0a779185990e3dc350f20f8 Mon Sep 17 00:00:00 2001 From: Anders Blomdell Date: Thu, 19 Jan 2023 11:59:04 +0100 Subject: [PATCH 4/4] Add test of helix_angle and hidden teeth --- involute_gears.scad | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/involute_gears.scad b/involute_gears.scad index e66ca1e..8223587 100644 --- a/involute_gears.scad +++ b/involute_gears.scad @@ -871,3 +871,31 @@ module test_backlash () cylinder ($fn=20,r=backlash / 4,h=25); } +module test_helix_rack_and_gear_with_hidden_teeth() { + pitch = 5; + pressure_angle = 20; + helix_angle = 30; + rim_thickness = 10; + module helical_gear() { + translate([0,20*pitch/pi/2, 0]) rotate([0,0,-60]) + gear (number_of_teeth=20, + number_of_hidden_teeth=15, + circular_pitch=pitch, + pressure_angle=pressure_angle, + rim_thickness=rim_thickness, + helix_angle=helix_angle); + } + module helical_rack() { + rack(number_of_teeth=10, + circular_pitch=pitch, + pressure_angle=pressure_angle, + rim_thickness=rim_thickness, + helix_angle=-helix_angle); + } + helical_gear(); + helical_rack(); + mirror([0,0,1]) { + helical_gear(); + helical_rack(); + } +}