Online Involute Spur Gear Builder

For the impatient: Just head over to the Online Involute Spur Gear Builder page.

UPDATE: This post refers to an old version. For information about version 2 see this post.

Still here and interested in some background? Perfect! Involute gears are by far the most commonly used gears today. An involute curve is fairly easy to calculate and quite a number of freely available tools and scripts exist that use this fact to create involute gear profiles (see e.g., Gear template generator, Parametric Involute Bevel and Spur Gears, OpenJsCad’s gear demo, and many more). However, I have not found a freely available tool that correctly caters for undercuts that occur for smaller tooth counts (around 10 or less):

UnderCutExample

If the undercuts are ignored the resulting gears will jam if machined and assembled precisely. For an elegant description of the issue including a recipe for how to graphically create correct spur gears see Michal Zalewski’s corresponding section in part six of his excellent Guerrilla guide to CNC machining, mold making, and resin casting series.

The code behind the online involute spur gear builder determines the tooth profile by simulating how a gear with infinite radius (aka rack) would cut into a smaller gear as discussed by Michal Zalewki. The advantage of the infinite gear is that it has a very simple trapezoidal tooth form solely defined by the addendum height and the pressure angle. In the figure below the rack is shown at the top. When the rack is moved to the right the gear needs to rotate clockwise so that a point on the pitch circle of the gear moves with the same speed as the rack. The code simulates this movement in steps and then for each step subtracts the shape of the rack from the gear.

InfiniteGearCutter

For illustration purposes the figure below has been calculated based on very coarse steps and only shows two teeth of the rack.

AnnotatedCutoutSteps

In reality the code simulates only one rack tooth and calculates the tooth profile of half a tooth of the matching gear. The complete gear is then assembled by mirroring and rotating the half tooth. All of this is accomplished by leveraging the ‘Constructive Area Construction’ capabilities of the csg.js library which is part of OpenJsCad. Each rack tooth location is calculated and created as a polygon. These polygons are joined together with the union operator to form one complex 2d shape that is then subtracted from a slice of the outer circle of the target gear to form half a tooth. Finally, the complete gear is assembled from rotated and mirrored half teeth:

CAG_AssemblySteps

The graphic above shows rough steps in the final output. This can be somewhat alleviated by using finer steps in the simulation but to really get rid of the steps additional smoothing is required. The step profile occurs in the undercut regions where the backside of the rotated rack tooth profile sticks out as a corner. The smoothing logic is explained in this diagram:

CutoutSmooting

The final result has smooth tooth profiles. As an example below is an image of a calculated gear set (pressure angle 14.5°) consisting of a 30 tooth gear meshing with an 8 tooth gear. Small values for clearance and backlash were used. Head over to the involute spur gear builder page to try it out yourself.

SpurGearExample

UPDATES:

67 thoughts on “Online Involute Spur Gear Builder”

  1. Thanks for the thorough review, Ian. In the meantime I extended the tool to also support internal gears and rack & pinion output. Profile shift is supported for all gear configurations as well. The underlying calculations are fairly fast even for higher quality modes and tooth counts. However, the rendering of the graphics is currently killing the performance. I am using the 3d webgl graphics engine that is embedded in the OpenJSCad framework. It is a powerful framework but overkill for rendering 2d graphics. Hopefully eventually I’ll find some time to replace it with a leaner and faster rendering solution.

  2. Hi, Doctor.
    Can you please make the non-circular involute gear available in your tools? I think in your tool , the profile generation is based on the context method,right? I want to study more about non-circular gears’ generation,and have think about writing code for it. but it seems that I do not have such time to do this..(Currently, I am a student who are pursuing p.h.d about gear vibration not gear machining)
    Thanks
    Xiaoqi

  3. Dear,
    I am really excited about this nice tool. I did try to import the generated dxf file intot Autodesk Inventor but Inventor keeps generating an error message. Would you have any experience with this or any hints ?
    kind regards,

    Koenraad Hansen

  4. I was finding the same error with my AutoCAd products. I found that I can import the DXF file into SketchUp.

  5. Dear Dr. Hessmer,

    Is this website only available to your students? I am trying to generate cad models for a machine concept I am working on at work. I searched and found the generator but I can’t see any input dialog boxes or update button. This would be a great tool to use if I could get access to it.

    Thanks,

    Vernon

  6. What’s the best way to calculate the radius of the gears and the distance between centres of the two gears?

  7. This is amazing! I’m also having trouble importing the .dxf into Vectorworks and into illustrator (only imports as text). Is there some secret to using the DXF files that are produced?

  8. Just an update for anyone else trying to use illustrator or having issues importing into drawing programs. I downloaded Dassault draftsight, opened the dxf generated by this generator, then saved it as 2009, 2010 and 2013 dxf. 2009 and 2010 opened fine in illustrator. Brilliant!

  9. This is great! It has helped me a lot with my project.

    But I do have one question for Dr. Hessmer or anyone else who could help me:
    How is Profile Shift implemented in this builder? I am not interested in programming code, but in equations that make profile shift.
    I would be really grateful if somebody could recommende a book or a web link to this equations?

  10. Hi. When I take the following random values; a pitch of 10, then a pressure angle of 20°, then set the pinion and gear teeth both at 10, leaving all other parameters at zero, then generate a high quality DXF, then overlay the geometry on top of an involute generated in Excel from the basic involute equation, the two don’t overlay precisely. Would you have any idea why? For the data as mentioned, I have calculated the radius of the base circle as (10 * 10) / (2 * PI) * COS 20° , i.e. 14.955672 This is the value plugged into the Excel equation. Am I missing something? This is all new to me.

    Here’s the involute equation I used.

    x=r*(cos theta + theta * sin theta)
    y=r*(sin theta – theta * cos theta)

    Just one other question. Again analysing your output geometry for the data above, then again after adding a 0.5 offset, the overlay shows a perfectly offset involute profile which I expected to see. However am I right to assume that the involute offset should be equal to ((addendum * (1 + offset )) – addendum) * SIN 20° When I create the geometry using Excel again they don’t overlay. I’m taking the Addendum as 10 / PI in my example. I would be glad to share my files with you if I had an email to send them to. Thanks

  11. Nice software tool!

    @Lael
    I found that the dxf output file can be opened in Inkscape (freeware on al platforms) and then saved in any vector format (I use eps) Opening the file in Adobe Illustrator is an easy next step.

  12. Has anyone yet proved the output geometry to be true?

    The author hasn’t replied to my previous post.

    I still cannot get it to agree with my own results.

    I just want to know if this is reliable and if so, then I need to search further to find the fault in my own construction geometry.

    I have modeled it both in 3D software with a simulated rack cutter operation, and also via Excel generated involutes, and my two end results agree to within 0.00001

    Thanks

  13. Very nice piece of work, but for some unknown reason I don’t seem to be able to achieve a
    download .dxf file. When I select the update, post input of data, picture depicts my input. But
    upon selecting generate dxf file it offers download dxf, but nothing happens when I select it.
    Any help would be greatly appreciated. Don’t believe I have any options in IE that would prevent
    download from taking place, often download files from other web sites.
    thx

  14. I also have trouble opening the .dxf file in bot illustrator CS6 and autoCAD 2014. Has anyone found a fix that doesn’t involve more programs? Seems weird to as both illustrator and autocad usually works with every file I throw at them…

    The tool itself is effin great!

  15. This is a superb online tool. However, I am having trouble generating a High resolution .dxf file for Internal Tooth Spur Gears. The only resolution I can get is Draft resolution. If you have a solution to this, that would be great. I may also be doing something incorrect. I have no problems importing the .dxf into my PC’s Turbocad 11.2. My Turbocad version does NOT do Internal Tooth Spur Gears.

    And thanks again for the great tool.

    1. I just posted an updated version that splits the former Quality setting into two separate settings:

      – Rotation steps per tooth angle (default 3)
      – Number of segments per 360 degree of rotation

      Particularly the first one is relevant and gives you more control over the desired quality. Increase the value slowly since the calculation time increases non-linearly with larger values.

  16. Sooo close. This is an exciting tool, but sadly, doesn’t seem to be working all that well. The tool is crashing on anything besides Draft, with these parameters (in order):

    0.065449847 (i.e. 48DP gear)
    20
    0.002
    0
    0
    18
    0
    18
    0
    Wheel 1 Only
    Draft

    And, even in Draft mode, I can only zoom in to the point that the gear is the size of pea in the middle of the viewing window.

    It would be great if we could just set Inch/Metric Module (much more intuitive/normal) instead of using Circular Pitch.

    This seems to work better with huge-sized gear inputs, not small gears.

    This is the most promising Involute generator I’ve found on the web so far, but it’s not quite done.

  17. Also, it makes me a bit nervous that the DXF file is named “CycloidalGear_1.dxf” and not Involute…two very different things…are we sure that this is an Involute profile and not a Cycloid?

  18. Brilliant.
    I am using geomagic (formerly alibre). When you open up the dxf file, it brings it into a drawing file. You have to explode symbol. You can then copy and paste it into a model space where it can be extruded. I am using it to 3D print nylon gears. Takes no time at all
    Thanks

  19. I love this tool, and have used it extensively in building a prototype device. Now I have a problem: I am trying to build a planetary set with tooth counts of 70, 28 and 14, with a pitch of 8. I have no problem with the 28 and 14 tooth gears, but when I enter -70 for the ring gear I get the following error message:

    Error: Area is not closed!
    at Object.CAG.getOutlinePaths (http://hessmer.org/gears/OpenJsCad/csg.js:6083:12)
    at Gear._createInternalGearShape (blob:http%3A//hessmer.org/8205b434-81c1-433e-8bde-dea01c51a264:352:37)
    at Gear._createZeroedShape (blob:http%3A//hessmer.org/8205b434-81c1-433e-8bde-dea01c51a264:147:19)
    at Gear.getZeroedShape (blob:http%3A//hessmer.org/8205b434-81c1-433e-8bde-dea01c51a264:138:31)
    at GearSet.createShape (blob:http%3A//hessmer.org/8205b434-81c1-433e-8bde-dea01c51a264:601:35)
    at main (blob:http%3A//hessmer.org/8205b434-81c1-433e-8bde-dea01c51a264:42:25)
    at Function.OpenJsCad.runMainInWorker (http://hessmer.org/gears/OpenJsCad/openjscad.js:387:18)
    at DedicatedWorkerGlobalScope. (blob:http%3A//hessmer.org/8205b434-81c1-433e-8bde-dea01c51a264:678:96)

    Am I doing something wrong?
    Thanks

    1. I tried it with the following parameters which worked for me. Can you try again and if you get stuck, send me the complete set of parameter values you use for the -70 gear?

      Circular pitch (the circumference of the pitch circle divided by the number of teeth):
      8
      Pressure Angle (common values are 14.5, 20 and 25 degrees):
      20
      Clearance (minimal distance between the apex of a tooth and the trough of the other gear; in length units):
      0.05
      Backlash (minimal distance between meshing gears; in length units):
      0.05
      Profile Shift (indicates what portion of gear one’s addendum height should be shifted to gear two. E.g., a value of 0.1 means the adddendum of gear two is increased by a factor of 1.1 while the height of the addendum of gear one is reduced to 0.9 of its normal height.):
      0
      Wheel 1 Tooth Count (n1 > 0: external gear; n1 = 0: rack; n1 < 0: internal gear): -70 Wheel 1 Center Hole Diameter (0 for no hole): 4 Wheel 2 Tooth Count: 8 Wheel 2 Center Hole Diameter (0 for no hole): 4 Show: Rotation steps per tooth angle when assembling the tooth profile (3 = draft, 10 = good quality). Increasing the value will result in smoother profiles at the cost of significantly higher calcucation time. Incease in small increments and check the result by zooming in. 6 Number of segments per 360 degree of rotation (only used for circles and arcs); 90 is plenty: 100

  20. Hello

    I have been using your application to generate gear profiles for a wooden clock – these will be milled via Cut2D (Vectric). The dxf files import faultlessly into Cut2D – this is great stuff!! I also tried to import into Autosketch in order to add crossing out detail to the gears. Unfortunately this gives an error message “Table flags missing on line 32.”.

    Not being an expert in DXF file syntax, I have no idea how to fix this. Are you able to offer any suggestions as to how to correct/change the file. DXF’s generated in Autosketch do import correctly into Cut3D.

    Help would be much appreciated.

    Thanks

  21. Hello,

    Thank you for that guidance – Inkscape solved the problem completely. What an awesome piece of software that is – and all for free as well. I really must take the time to learn to use it effectively.

    I must say a thanks too for the gear profile generators – just what a hobbyist need for fun projects.

  22. I can not get a DXF file without an error for the External Spur Gear Generator.
    Love the program. Its brilliant but I must be doing something wrong.
    I input:
    Circular Pitch 4.86440153
    Pitch Angle 10
    Clearance .03
    Backlash .010
    Profile Shift .15
    Wheel #1 N 31
    Bore Diameter 4
    Wheel #2 N 11
    Bore Diameter 3
    Last two values tried 10 and 90 but did not work even 3 and 30 did not work.
    I see the image and it appears to be generating the correct graphics.
    Thanks for any help you can provide.

  23. I want to thank you for this gear generator. I spent the better part of a couple of days learning everything about gear design and the math behind it for some wooden gears and locking mechanism (rack & pinion setup) I was commissioned to make for a client who’s got a closet for his Batman suit and weapons (no, I’m not kidding it’s a fully wearable Batman suit). Then sometime last night while taking a coffee break, found this generator and it gave me exactly what I needed!!

    It took me a minute to figure out the measurements to input were in mm and not inches and kept getting strange things, so maybe add in a note or something.

    Downloaded the DXF into TurboCAD (no issues at all) and then into illustrator (also into AutoCAD just to check) and from there into my CNC programs (ArtCAM8 Pro and MACH3). Will be cutting them out later, but thanks again for saving my bacon.

  24. I ported your JavaScript to C++ and OpenGL. If you do not object, I would like to share the result. I initially was going to make it an Inventor addin, but it was far simpler to export as a spline based DXF and import that to Inventor.

  25. I noticed that there are some jagged lines in the gears, even with 10 step/tooth and high resolutions. I found that running _smoothConcaveCorners one additional time removed the artifacts.

  26. Hello,
    I’m trying to generate a planetary gear with -240 teeth but the builder ‘s script blocks ! I genarated with the same builder last june other planetary gears with 360 teeth without any problem … What’s wrong ?
    Thank you, ciao !

    1. You might need to zoom out to see the generated gear set. I tested by leaving the default values for all but wheel 1 tooth count which I set to -240. After a while the gear set is generated but nothing is displayed. Once I zoomed out the gears showed.

        1. Please provide the full set of parameters that you used. Something like

          Circular Pitch …
          Pitch Angle …
          Clearance …
          Backlash …
          Profile Shift …
          Wheel #1 N ..
          Bore Diameter …
          Wheel #2 N …
          Bore Diameter …

  27. Hi,
    We’ve got a feature request for you to think about, please.
    We love Gear Builder, thank you. Here’s an example of where we used it: http://sheetcnc.co.uk/strandkrab/ These toys will be heading to Maker Faire UK in a couple of weeks. The gears of this and many of our other projects were designed on Gear Builder. So thank you!
    The StrandKRAB gears are CNC’d, which means they naturally have a radius at the bottom of the teeth. This radius can foul the tips of the meshing teeth. To prevent fouling we could instruct the CAM to overcut the corners, but this causes sideways cutting and results in very weak roots. Alternatively we can increase the clearance setting in Gear Builder. Increasing the clearance moves the radius deeper into the wheel where it won’t foul anything. Which is great… but we don’t really know how much clearance we should add. It’d be nice if Gear Builder could take our cutter CED as input and then compensate with additional clearance automatically in the designed wheel. Does that sound worth doing?
    Cheers,
    Ian.

    1. Hi Ian,

      I am happy that you found Gear Builder useful and I am really impressed by your strandKRAB and StrandSiameseKAT. In the past I used regular CAD software to add two cut-out circles at both sides of the valley between two teeth to make the gear cuttable with a given end mill diameter. I then created duplicated cut-out circles for each tooth by rotating the original two circles around the center of the wheel. The two circles effectively represent the dog-bone approach (http://blog.inventables.com/2014/06/learn-about-milling-inside-corner.html).

      While I like the idea of automating this in the gear builder I am afraid I won’t have time.

  28. I have noticed you don’t monetize your blog, don’t waste your traffic, you can earn extra cash every month because you’ve got
    hi quality content. If you want to know how to make extra $$$, search for: Mrdalekjd methods for $$$

  29. I tried your Gear Builder and have a kind of scaling problem (or thinking problem):
    I want to use the gear module, which is not part of your parameters.
    I tried to make a gear module 2 with 1 wheel 24 teeth and one wheel 8 teeth.
    Circumference of the pitch should be diameter of pitch x pi. At module 2 and 24 teeth, diameter of pitch is 24 x 2 = 48. Circumference is 48 x pi = 150.79…
    Your parameter “circular pitch” then would be 150.79.. / 24 = 6.283185307
    I entered that value and expected 2 wheels 24 and 8 teeth with a center distance of 32mm.
    But when I cut the file out of wood, I always got 30mm.
    So the wheels are around 7% smaller and the module is not the standard module of 2.
    I am not sure where this scaling error comes from. I tried different DXF import tools and all show the same effect.
    What value of “circular pitch” is correct when I want to make a wheel with a module of 2 ?
    Thanks

  30. Hi Joachim,

    Your calculations are correct and my program yields the same results. You can see it if you print out the generated dxf file (I used Inkscape) and then measure the distance between the two gears.

    Could it be that you cut out the gears with a 2mm bit and your cnc path does not take the required 1mm offset for cutting into account?

  31. Hello Dr. Hessmer,

    I used a Laser cutter, so the maximum tool gap was 0.1mm.
    I did the same test again now, and suddenly the dimensions are right. No idea where this came from.
    Very mysterious.

    Thank you very much

  32. Excellent tool, but when I try internal gears they don’t mesh. Is there a way to advance a gear to bring them into sync?

  33. Thank you. I like your code, a lot. It’s the only one I have found with clearance, backslash and profile shift, which are very usufull if you try to make a 3D print.

    Add one vote to the module option.

    Also, I think I have found some bugs with the internal gears:
    – When I tryed to obtain the dxf of a 135 internal gear (parameters: 3.1416, 20, 0.1, 0.1, 0, -135, 0, -, -, Wheel 1, 6, 30. Specifically 6 rotation steeps, it gives an error: Area it’s not closed.

    – For that same profile, I think that with rotating steps higer than 3 (I tryed 8, 5, 4 and 3) the profile has a problem: it kinds of deviates from a smooht line.
    – I asume that the hole parameter for internal gears is not used. I sugest to use it as the external diameter…
    – I also think that the clearance and backslash doesn’t work for the internal gear, at the bottom of the tooth. I used the profile shift to obtain a little clearance.

    Thank you again.

  34. Hello there!

    You Need Leads, Sales, Conversions, Traffic for hessmer.org ? Will Findet…

    I WILL SEND 5 MILLION MESSAGES VIA WEBSITE CONTACT FORM

    Don’t believe me? Since you’re reading this message then you’re living proof that contact form advertising works!
    We can send your ad to people via their Website Contact Form.

    IF YOU ARE INTERESTED, Contact us => lisaf2zw526@gmail.com

    Regards,
    Stamper

  35. Hello Dr Hessmer,
    The dxf generated by your program won’t open in the Autocad viewer I just downloaded. A message reads that the file is incomplete and doesn’t display anything and in fact locks up the Autodesk viewer.

    In case there was a problem with a parameter I entered, I tried again using the default parameter with the result.

    I am using Windows 10 Home on a new PC.

    Can you suggest a solution?

    Thank you.

  36. Ion Casino

    Ion casino is a trustworthy and best online casino site through 2010 that has dished up millions of players in Asia.
    Ion casino or also referred to as Ionclub is typically the top
    ranking option site because this provides the best experience for online gambling players in Indonesia.
    With an established license to function, this provider assures that players help to
    make bets without risk, credibility and can be relied upon.

  37. The state and Best Soccer Wagering Agent, One of the best soccer gambling internet sites operating in the Hard anodized
    cookware region, including Indonesia, is Sbobet. Known as the site that
    won 2 awards since the best operator, Sbobet have
    been serving its customers since 2004 and continues to survive as the earliest and most significant
    gambling online internet site in Asia.

Leave a Reply

Your email address will not be published. Required fields are marked *