Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Update to Spur gear custom feature

NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,859
A number of existing custom features are currently in the process of being overhauled to bring the coding and UI in line with our own internal standards. These changes will make them more consistent to use and the code more understandable for anyone who wishes to learn FeatureScript. However, as is the case with Spur gear, some changes may cause existing designs to break if the feature is updated. If you do update existing features and some downstream features fail (in both Part Studios and Assemblies) then you should undo your changes and continue to use the previous version of the feature in your existing designs. Any new features should use the latest version.
Senior Director, Technical Services, EMEA

Comments

  • dbaardadbaarda Member Posts: 15 ✭✭

    I'm not sure what the best approach to contributing to official featurescript, but I've done some improvements/optimizations to the most recent Spur Gear featurescript that might be nice to get in to the official release.

    I'm not sure how to go about this, or if there are coding standards, procedures, processes, etc I should be using. Feel free to point me in the right directions…

    The actual fixes are to address some problems that I noticed related to using it for creating internal ring gears by using a spur gear as a negative. However, internal ring-gears have an inverted addendum/dedendum and root/tip compared to their Spur Gear negative, so to do this properly you need to use a Spur Gear with an Addendum-factor of 1.25 (x module) and Dedendum factor of 1.0 (x module), and a filleted tip not root. You can sort of get the Addendum and Dedendum right by playing with the root radius and tip radius settings, but you can't set Dedendum to 1.0 so you need to fiddle around to get it to undo the Dedendum=1.2 setting and it gets messed up if you change the gear module etc. For the fillets, you need to turn off the root fillet and manually fillet the tips after generating the Gear.

    This is all a pain, and browsing around public docs with Gears it looks like most designs with internal ring gears have insufficient ring root clearance and too-long ring teeth because they didn't notice/fix this problem. So I've copied and tweaked the featurescript with these changes;

    1. Added a tip fillet option with the same options as there are for root fillet. Note it's sometimes useful to have tip-fillets on Spur Gears too, to avoid a burr building up on the edge.
    2. Added a Dedendum "1.00 x Module" option.
    3. Added an Addendum option with all the same settings as there are for Dedendum, including the new "1.0 x Module" which is the Addendum default.
    4. I tidied and commented the tooth generation code a fair bit… not sure if it's faster because I had to add a bit to get the tip-fillets to work which probably cancelled my optimisations, but its a fair bit neater at least.

    This makes it possible to make a true-inverse of of a properly proportioned ring gear without having to mess around with it.

    Note I haven't removed the root radius and tip radius settings even though IMHO this makes them a bit redundant, because I'm not sure how that would affect backwards-compatibility, and they might still be useful for wacky stuff, though IMHO a better way to do that would be a "Custom" setting for Addendum and Dedendum where you could manually enter the module-multiple factor. A factor will scale properly with the gear when you change module.

    These fixes are available here;

    https://cad.onshape.com/documents/398504e1cabca3abfcaa15e3/v/12efea33ca501b189e0831c0/e/362561dc150d4cef514ae2b9

    If there is anything that needs work before it can be accepted, let me know and I should be able to tweak it.

  • dbaardadbaarda Member Posts: 15 ✭✭

    I've done a bunch more bug fixes, improvements, and optimisations that are in the latest version available here;

    Spur Gear - Custom feature - Copy V2.2.0

    I'm not at all familiar with what best-practices are for changing featurescript in ways to avoid breaking things, so I don't know if this is too radical a set of changes to accept upstream. Let me know and I can adjust it if necessary.

Sign In or Register to comment.