### Remember to Post a Make!

Remember to come back and post what you've printed as Make.
It's good for the designer and the community (that means you)!
To post a Make, come back to this Thing and click **Post a Make**.
Or, you can use the Thingiverse Mobile app found on
Google Play
and the Apple App Store.

Great work!

But it that possible that you add the code to create inner gear as well?

I guess you tried to create all the cases possible in the code, but you forgot this one, I suppose.

Thank for your work.

Great work! I think I'll use this when I finally get around to building a star tracker.

I noticed that the twist function doesn't allow gears to mesh. One of each meshed pair of gears will need to be mirrored to get the twist going in the right direction when calling the gear module:

mirror(v=[0, 0, 1]) gear(mm_per_tooth,n1,thickness,hole);

Also, the twist seems to be a function of the gears' diameter. A larger diameter gear will generate a greater tooth slope preventing gears of differing diameters from meshing properly.

Dividing the twist by the number of teeth is one way to fix it:

linear_extrude(height = thickness, center = true, convexity = 10, twist = twist / number_of_teeth)

You could also include a multiplier to allow the twist variable to stay small:

linear_extrude(height = thickness, center = true, convexity = 10, twist = twist / number_of_teeth*10)

A rotation offset could also be applied to to keep things lined up in the display pane.

Jeremy

I made the twist modifications and replaced "pi = 3.1415926" with the native "PI" function, and removed the calls to the assign() function as it is depreciated. I also moved all of the gear variables to the example section at the bottom of the script. Hopefully everything makes sense.

Jeremy

fantastic. no way. thanks

Thanks a lot! Exactly what I need.

This is brilliant! Thankyou!

Thanks for this - I've found a couple of issues with the "rack" gear calculations. I think these were spotted earlier, but I've got (I think) the correct fixes. The first issue is with the tooth shape on the rack itself. The pressure calculation angle is wrong - it should be "tan" not "cos" with no constant offset. The second issue is with the rack position on the example view - it should be scaled by the mm_per_tooth rather than the fixed value of 9 (which only works with the example value).

The patch is:

Perfect, thanks!

I believe the rack module ist still brocken. I changed it in the following way and added some more parameters. Now it works for me.

I ran this code verbatim on my MacBook Air running OpenSCAD 2013.06 and got square teeth on all gears. How to I get the involute shape on the teeth?

I tried creating a rack with mm_per_tooth=3 and I get a weird looking teeth. In fact if I change your example with mm_per_tooth=3, and I also divide the other length type variable by 3, I get the same weird result.

I think it's down to line 118:

assign(t = a*cos(pressure_angle)-1)

the -1 is outside the multiplication. I don't really know what this all means, I just tried to change it to:

assign(t = a*(cos(pressure_angle)-1))

but that only made it bad for all mm_per_tooth. Since I don't know what this all means, I don't know how to fix it.

Can you help?

I noticed the rendering of the example gear set was kind of time-consuming on my machine, so I made the following patch to speed it up.

Compiling and rendering the example gear set took somewhere around 3:40 on my 6-Core AMD machine under OpenSCAD 2013.06 . I moved the order in which the linear extrusion occurred in this script, and it dropped compile and render time down to less than a second.

Here's a patch for anyone who might find it useful:

## 81c81

< for (i = [0:number_of_teeth-teeth_to_hide-1] )

## > linear_extrude(height = thickness, center = true, convexity = 10, twist = twist) for (i = [0:number_of_teeth-teeth_to_hide-1] )

83d82

< linear_extrude(height = thickness, center = true, convexity = 10, twist = twist)

119c118

< for (i = [0:number_of_teeth-1] )

> linear_extrude(height = thickness, center = true, convexity = 10) for (i = [0:number_of_teeth-1] )

121d119

< linear_extrude(height = thickness, center = true, convexity = 10)

It seems like line 118 should be:

Â Â Â Â Â Â Â assign(t = a/2*cos(pressure_angle))Â Â Â Â Â Â Â Â //tooth side is tilted so top/bottom corners move this amount

Rather than what it is.

You're right. I'll fix that, and give an attribution in the comments.

It would be great if there were a function to create a outer ring gear, ie the barrell of a epicyclic gearbox. I'm no coder, any thoughts and i'd be very greatful.

This is trivial to do with openscad! Make a cylinder that's the right size and thickness for the gear you want, then subtract a gear from it:

difference() {

Â cylinder(r=1,h=1);

Â gear(0.9*3.14159/20,20,1,0);

}

that would give you a gear with 20 teeth, 1.8cm inner-diameter, and a wall thickness of about 1mm, 1cm high. Modify as you please.

I think I'll probably add an internal gear ring in the future, so it can do planetary gears. But I think it will have to be slightly more complicated than the above code. It looks to me like there are at least 3 things that need to change if we want to create an internal gear as the difference of a disk and gear: swap the addendum and dedendum, negate the backlash, and change the fillet on the subtracted gear (so it's a removal from the tooth tip, rather than an addition to the tooth base). I'll have to think about whether there are any other changes, or if those 3 are enough.

WOW, amazing stuff. Thank you.

This is very good!! I do love the faceting of the teeth, almost even. Thanks a lot!

I just enclosed between comments the last lines of the script (to disable the example) and then played a little some code like:

include

&

lt;publicDomainGearV1.1.0.scad

&

gt;

PI=3.141592;

pitch_d=0; // Pitch diameter for the 1st gear

// set as zero and will be computed from "circular_p" parameter.

circular_p=4; // Circular pitch for the 1st gear

n1 = 17; // 1st gear number of teeth

n2 = 9; // 2nd gear number of teeth

mm_per_tooth=pitch_d != 0 ? pitch_d*PI/n1 : circular_p;

pressure_angle=28;

thickness = 5;

hole = 3.5;

clearance = 0.0;

backslash = 0.0;

d12=pitch_radius(mm_per_tooth,n1) + pitch_radius(mm_per_tooth,n2);

echo("Distance between gears axes:", d12);

1])

translate([0,0,thickness/2])

gear(mm_per_tooth=mm_per_tooth,

number_of_teeth=n1,

thickness=thickness,

clearance=clearance,

pressure_angle=pressure_angle,

hole_diameter=hole,

backlash=backslash);

rotate([0,0,($t+n2/2)*360/n2])

gear(mm_per_tooth=mm_per_tooth,

number_of_teeth=n2,

thickness=thickness,

clearance=clearance,

pressure_angle=pressure_angle,

hole_diameter=hole,

backlash=backslash);

Try to run the animation (i.e. FPS

&

amp; Steps set to 25)

Thanks a lot for sharing !!

here is an unfinished project that incorporates a modified version of your code:

http://www.thingiverse.com/thing:8598http://www.thingiverse.com/thi...

thanks for making it public domain!

There are other gear libraries, but I really like this because you've made it public domain. I, or anyone, might like to just take a snippet from here and there, and this will accelerate innovation.

I've been considering making some of my own wandering designs public domain for similar reasons. So, this is very inspirational.

Double involute worm gearing?

I probably won't add more to it, now that it does everything the Rhombot needs. But if you'd like to use it to make a script with more features, that would be great.

OK, thanks very much for this. Haven't actually started working with OpenSCAD yet though so likely nothing in the near future, but... :) You wouldn't happen to have the mathematical description of a proper worm-gear interface kicking around as a starting point would you?

That's awesome! I was wondering where this thing went to. (Thanks for the rack!)

No problem. I hope you find it useful.