refactoring for gear trains
Opened this issue · 4 comments
I had an idea. When we've got it working. How about refactoring it so effect() calls a routine to print a gear with given parameters.
If we did that then we could have the UI define a number of gears and do a gear train. One tab for each gear (another tab for the common settings). We can then also annotate the ratios of driven to other gears and show the simple spur gear calculations.
The user could then choose to cut each out and mount then in any way (stacked or chained edge to edge, etc) but because we did the calcs - they would know reduction ratios etc.
I'm thinking something like seen in this:
http://uqu.edu.sa/files2/tiny_mce/plugins/filemanager/files/4280336/machines/GEARS%20Lec-12.pdf
Where the user defines for each tab whether gear is locked to previous tab or meshes with previous. First tab is driver.
We'd make (4 or 6) tabs and let user use only those they needed (probably just first two for classic pinion/spur).
Visually - layout each gear non meshing (so they can be printed,laser cut, whatever..) but maybe draw a simple representation of stacked or meshed layout with just circles as a layout guide.
What do you think of this idea.
Here's an instructable showing an end result. IMHO it would be good to enable this kind of end result.
http://www.instructables.com/id/Laser-Cut-Display-Gears/
The internal function might look like this:
# add to center hole a D for a key (width, height defined on pg 737
def generate_gear_path(teeth_count, module, pressure_angle, mount_hole_dia,
clearance=0, unit_factor=1,
mount_radius=0, spoke_count=0, spoke_border=0,
accuracy=20, draw_guides=False,
):
""" returns a path (for svg) of the gear where:
- unit_factor is precomputed based on document and dialog dimension
- spoke_count equivalent to hole_count
- draw_guides shows both centercross and pitch circle.
Missing parameters:
- key - an (x,y) tuple of box shape to cut out of mount hole
- spoke_rounding - for smoother internal hole corners
-
"""
# Calls a function to calculate pitch circle (so can be called to show layout of simplified gears)
# - draw pitch circle using draw_SVG_circle()
pass
def generate_rack_path(teeth_count, module, pressure_angle, tab_length
clearance=0, unit_factor=1,
accuracy=20, draw_guides=False
):
""" Just draw the rack """
pass
I've refactored the rack out - I will be stopping here until you've fixed the scale issues and module bugs I may have added. :)
Its clear that when undercutting occurs on low toth count gears the balance of the fix can be profile shifted to either gear in the couple.
This suggests we make the current plugin allow manual mod of the profile shift.
It also suggests we calculate this in a new plgin for gear trains so that this can be shared amongst gears in the chain.
New gear-chain plugin only when this one is all done :)