Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom addendum and dedendum radii #15

Open
dylanede opened this issue Aug 16, 2022 · 1 comment
Open

Custom addendum and dedendum radii #15

dylanede opened this issue Aug 16, 2022 · 1 comment

Comments

@dylanede
Copy link

Hi, and thanks for providing this great library.

Currently, the addendum and dedendum radii are not configurable, and controlled by the constants ka and kd in GearBase. Would it be possible to expose options to override these values, and/or specify the radii directly? I am currently trying to replicate some existing gears whose radii do not match those calculated by this library. If you provide some direction on how you think such a feature would be incorporated into the API, I'm happy to put together a PR.

Thanks!

@meadiode
Copy link
Owner

Hi, you can configure those constants by simply creating a class inherited from SpurGear like so:

class CustomGear(SpurGear):
    ka = 1.3
    kd = 1.1

Then use this CustmGear just like SpurGear:

gear1 =   SpurGear(module=1.0, teeth_number=17, width=5.0, bore_d=5.0)
gear2 = CustomGear(module=1.0, teeth_number=17, width=5.0, bore_d=5.0)

wp = cq.Workplane('XY').gear(gear1).moveTo(20, 0).addGear(gear2)

print('gear1 dedendum radius:', gear1.rd)
print('gear2 dedendum radius:', gear2.rd)

The result:
image

Initially I figured that since these coefficients need to be changed only in some special cases, I didn't expose them in e.g. a constructor or a method, thinking that one can just override them in an inherited class, or just directly override them like SpurGear.kd = 1.05 etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants