Created
April 25, 2012 06:30
-
-
Save anonymous/2487245 to your computer and use it in GitHub Desktop.
render patch for http://www.thingiverse.com/thing:3575
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- parametric_involute_gear_v5.0_orig.scad 2012-04-25 09:23:23.000000000 +0300 | |
+++ parametric_involute_gear_v5.0.scad 2012-04-24 20:46:11.000000000 +0300 | |
@@ -14,13 +14,13 @@ | |
//test_gears (); | |
// Meshing Double Helix: | |
-//meshing_double_helix (); | |
+//meshing_double_helix(); | |
// Demonstrate the backlash option for Spur gears. | |
//test_backlash (); | |
// Demonstrate how to make meshing bevel gears. | |
-bevel_gear_pair (); | |
+//bevel_gear_pair (); | |
pi=3.1415926535897932384626433832795; | |
@@ -232,53 +232,55 @@ | |
// pitch_apex, | |
// cone_distance, | |
// half_thick_angle); | |
+ min_radius = max (base_radius*2,root_radius*2); | |
- min_radius = max (base_radius*2,root_radius*2); | |
- | |
- pitch_point = | |
- involute ( | |
- base_radius*2, | |
- involute_intersect_angle (base_radius*2, back_cone_radius*2)); | |
- pitch_angle = atan2 (pitch_point[1], pitch_point[0]); | |
- centre_angle = pitch_angle + half_thick_angle; | |
- | |
- start_angle = involute_intersect_angle (base_radius*2, min_radius); | |
- stop_angle = involute_intersect_angle (base_radius*2, outer_radius*2); | |
- | |
- res=(involute_facets!=0)?involute_facets:($fn==0)?5:$fn/4; | |
- | |
- translate ([0,0,pitch_apex]) | |
- rotate ([0,-atan(back_cone_radius/cone_distance),0]) | |
- translate ([-back_cone_radius*2,0,-cone_distance*2]) | |
- union () | |
- { | |
- for (i=[1:res]) | |
- { | |
- assign ( | |
- point1= | |
- involute (base_radius*2,start_angle+(stop_angle - start_angle)*(i-1)/res), | |
- point2= | |
- involute (base_radius*2,start_angle+(stop_angle - start_angle)*(i)/res)) | |
- { | |
- assign ( | |
- side1_point1 = rotate_point (centre_angle, point1), | |
- side1_point2 = rotate_point (centre_angle, point2), | |
- side2_point1 = mirror_point (rotate_point (centre_angle, point1)), | |
- side2_point2 = mirror_point (rotate_point (centre_angle, point2))) | |
- { | |
- polyhedron ( | |
- points=[ | |
- [back_cone_radius*2+0.1,0,cone_distance*2], | |
- [side1_point1[0],side1_point1[1],0], | |
- [side1_point2[0],side1_point2[1],0], | |
- [side2_point2[0],side2_point2[1],0], | |
- [side2_point1[0],side2_point1[1],0], | |
- [0.1,0,0]], | |
- triangles=[[0,1,2],[0,2,3],[0,3,4],[0,5,1],[1,5,2],[2,5,3],[3,5,4],[0,4,5]]); | |
- } | |
- } | |
- } | |
- } | |
+ pitch_point = | |
+ involute ( | |
+ base_radius*2, | |
+ involute_intersect_angle (base_radius*2, back_cone_radius*2)); | |
+ pitch_angle = atan2 (pitch_point[1], pitch_point[0]); | |
+ centre_angle = pitch_angle + half_thick_angle; | |
+ | |
+ start_angle = involute_intersect_angle (base_radius*2, min_radius); | |
+ stop_angle = involute_intersect_angle (base_radius*2, outer_radius*2); | |
+ | |
+ res=(involute_facets!=0)?involute_facets:($fn==0)?5:$fn/4; | |
+ | |
+ render(convexity=10) | |
+ { | |
+ translate ([0,0,pitch_apex]) | |
+ rotate ([0,-atan(back_cone_radius/cone_distance),0]) | |
+ translate ([-back_cone_radius*2,0,-cone_distance*2]) | |
+ union () | |
+ { | |
+ for (i=[1:res]) | |
+ { | |
+ assign ( | |
+ point1= | |
+ involute (base_radius*2,start_angle+(stop_angle - start_angle)*(i-1)/res), | |
+ point2= | |
+ involute (base_radius*2,start_angle+(stop_angle - start_angle)*(i)/res)) | |
+ { | |
+ assign ( | |
+ side1_point1 = rotate_point (centre_angle, point1), | |
+ side1_point2 = rotate_point (centre_angle, point2), | |
+ side2_point1 = mirror_point (rotate_point (centre_angle, point1)), | |
+ side2_point2 = mirror_point (rotate_point (centre_angle, point2))) | |
+ { | |
+ polyhedron ( | |
+ points=[ | |
+ [back_cone_radius*2+0.1,0,cone_distance*2], | |
+ [side1_point1[0],side1_point1[1],0], | |
+ [side1_point2[0],side1_point2[1],0], | |
+ [side2_point2[0],side2_point2[1],0], | |
+ [side2_point1[0],side2_point1[1],0], | |
+ [0.1,0,0]], | |
+ triangles=[[0,1,2],[0,2,3],[0,3,4],[0,5,1],[1,5,2],[2,5,3],[3,5,4],[0,4,5]]); | |
+ } | |
+ } | |
+ } | |
+ } | |
+ } | |
} | |
module gear ( | |
@@ -423,31 +425,33 @@ | |
pitch_point = involute (base_radius, involute_intersect_angle (base_radius, pitch_radius)); | |
pitch_angle = atan2 (pitch_point[1], pitch_point[0]); | |
centre_angle = pitch_angle + half_thick_angle; | |
- | |
start_angle = involute_intersect_angle (base_radius, min_radius); | |
stop_angle = involute_intersect_angle (base_radius, outer_radius); | |
res=(involute_facets!=0)?involute_facets:($fn==0)?5:$fn/4; | |
- union () | |
- { | |
- for (i=[1:res]) | |
- assign ( | |
- point1=involute (base_radius,start_angle+(stop_angle - start_angle)*(i-1)/res), | |
- point2=involute (base_radius,start_angle+(stop_angle - start_angle)*i/res)) | |
- { | |
- assign ( | |
- side1_point1=rotate_point (centre_angle, point1), | |
- side1_point2=rotate_point (centre_angle, point2), | |
- side2_point1=mirror_point (rotate_point (centre_angle, point1)), | |
- side2_point2=mirror_point (rotate_point (centre_angle, point2))) | |
- { | |
- polygon ( | |
- points=[[0,0],side1_point1,side1_point2,side2_point2,side2_point1], | |
- paths=[[0,1,2,3,4,0]]); | |
- } | |
- } | |
- } | |
+ render() | |
+ { | |
+ union () | |
+ { | |
+ for (i=[1:res]) | |
+ assign ( | |
+ point1=involute (base_radius,start_angle+(stop_angle - start_angle)*(i-1)/res), | |
+ point2=involute (base_radius,start_angle+(stop_angle - start_angle)*i/res)) | |
+ { | |
+ assign ( | |
+ side1_point1=rotate_point (centre_angle, point1), | |
+ side1_point2=rotate_point (centre_angle, point2), | |
+ side2_point1=mirror_point (rotate_point (centre_angle, point1)), | |
+ side2_point2=mirror_point (rotate_point (centre_angle, point2))) | |
+ { | |
+ polygon ( | |
+ points=[[0,0],side1_point1,side1_point2,side2_point2,side2_point1], | |
+ paths=[[0,1,2,3,4,0]]); | |
+ } | |
+ } | |
+ } | |
+ } | |
} | |
// Mathematical Functions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment