generating gear part

Hi

I wrote a gear generator script for QCAD. implemented as a part library item

So far, generates an Involute Spur gear outline only as a polyline. Can draw an axle hole, and spokes if required.


gear.dxf (36.8 KB)
for dimensioning the gear, you can specify the Pitch Circle Diameter and the number of teeth (it displays the Module, but you can’t specify it that way as yet). You can change the pressure angle too.

Excellent! Thanks for sharing this. A very interesting library item and a great example of what can be done with scripted QCAD library items.

Can this script be included in future QCAD packages?

Sure, and I will keep working on it for a while too

I want to generate an internal ring gear at least, and also this script does not handle undercutting at all - in fact I don’t know how to calculate that as in the real world the hobbing tool just does that automatically but it weakens the gear, and perhaps its better not to handle undercut but to do a profile shift instead to work around the need for it (with some manual calculation this can perhaps be generated already I’m not exactly sure!)

A question; if I want to make a different part using some of the same script, can I have a file of common routines in the directory without it appearing separately in the part list? ie I would have ‘Spur’ and ‘Ring’ gear in the parts list, and a common.js file included by both..

Hi Matfie - that looks promising … :smiley:

Right now I’m not sure how to run your script … :blush:
I created a Gears Folder which contains the InvoluteSpur.js and InvoluteSpur.ui files, restarted QCad and updated the Library. I can now see the InvoluteSpur entry but how to start the script?

Win10/QCad 3.16.2

just as any other part

I think you can double click on the ‘InvoluteSpur’ gear icon and it will open the options window (or single click to select it, and click the ‘insert object’ arrow at the bottom of the library browser window..) if you then move the mouse pointer to the drawing you will see a preview of what you are getting, hovering at the mouse pointer ready to be inserted. You can change the options in the options window and the preview will be redrawn with the new settings

That is what I thought … but obviously I’m doing something wrong …

If I insert it looks like I have nothing on my Mousepointer. The common insert option for Rotation scale etc will pop up but nothing more. If I insert this invisible gear in my drawing I can’t see / find it afterwards in the drawing.

And the Symbol looks way different than that in your screenshot …


Any idea what I’m doing wrong?

the little yellow triangle means that the script failed to produce an icon, and the lack of anything in the drawing means that the script failed to produce an object to insert

I find that when that happened, there would be an error message on the terminal that I ran qcad on; I don’t know how to make those error messages appear on the QCAD console, is that possible?

(btw I’m not on Windows)

Thanks for explanation!

I’m afraid I’m the wrong person to be ask - I’m only a QCad User. Maybe Andrew has an idea (I’m sure he has one!) :smiley:

Yes, including a shared script should work just fine (i.e. include(“common.js”)). You can include any JS file on disk. To keep things simple, I would recommend to put the shared script into the same directory as the library items.

I created such a file with a couple of functions, but it shows up in the library browser as a non useable part.. is there a way to prevent that?


Hm ok, if I use a different extension eg ‘common.ecma’ then it doesn’t show up.. would that be the best way?

Ouch.. didn’t think of that.

An alternative extension would be a way around that for now. An alternative might be to put it into a sub-directory called “_META”. The _META directories are currently used by the library browser to store meta information that applies to all items in a directory. It’s a slight abuse of that directory, but one I could live with. I’ll leave it up to you. This can be changed quite effortlessly if needed in the future.

Hi,

the Changelog to 3.16.3 is mentioning this gear tool - but I assume I have to wait a little bit longer to see it working in Windows, I’m right?

3.16.3 (2016/12/28)
Part Library Browser:
Add gear generator item (default > Mechanics > Gears > InvoluteSpur)

Hi Husky
I tried the tool and I do get a gear, you have to adjust the parameters before clicking where you want to insert it. I’m on Win7-64

Hi J-J - thanks for the info!

Uuuuuuuuuuuuuuuuuuuuuuuups … my fault! Dirt on me a whole shovel!!!

I haven’t recognized that I’m trying to work with the not working Gear Library item which is (was!) still on my OS for testing.
Thanks for waking me up and a happy new year!

P.s.: I hope that was my last 2016 mistake … e_confused

Is there right now a possibility to create two gears related to each other with a ratio e.g. 4:1?

tried that, but not sure they’d work properly. This is experimental I guess!
Happy New Year

I guess you are right! Thanks for the test - looks like it was a kind of fiddling to use it with a m=2.5.

I work with an extern Gear Generator and would like to see it equivalent (at least) replaced by QCAD. It looks like I have a
reason to be optimistic … :wink:

Happy New Year!

Two gears mesh if the module is the same.

It would help if we could enter the module instead of the pitch diameter. Then we would always get gears that work together.

Agreed, when designing meshing gears one uses the same module …
Looking at the script and the used equations we will always get a circular condition.
Or we define the module and get a certain diameter of the pitch circle for a number of teeth …
… or we define the pitch diameter and may get an odd module …
… or a fractional number of teeth … :unamused:

All apart from the fact that the involute curve is approximated by line segments … :frowning:
Pity that Matfie (Iain Hibbert) didn’t finish this:

I was initially looking ‘If’ and ‘Why not’ ScriptItems store the last options that were used.
In general they do not, some retain their setting in the same QCAD session, some always return to their defaults.

It seems that we could enhance some existing ScriptItems … If time permits.

Regards,
CVH