Gears extension improvements

Bug #707290 reported by Nick
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
In Progress
Wishlist
Gijs van Oort

Bug Description

Hi guys!

We've made an extension of Gears extension. It adds holes to the gear (central hole for the shaft and some radial holes to make gear lighter).

Source code is in the attachment.
Example could be found here: http://www.cnc-club.ru/forum/viewtopic.php?f=33&t=434#p2500

Also we've made an extension to create unordinary gears.
Source code and more info here: http://www.cnc-club.ru/forum/viewtopic.php?f=33&t=433

Revision history for this message
Nick (xepecine) wrote :
su_v (suv-lp)
tags: added: extensions-plugins
removed: extension gears
Changed in inkscape:
importance: Undecided → Wishlist
Revision history for this message
jazzynico (jazzynico) wrote :

Hi Nick,

Thanks for the improvement. The gears extensions has been modified recently to add a central hole (see Bug #692719, "gear extension should have option to render a central hole"), but I'm sure it's possible to merge it with your version. Let's target it for 0.49!
The unordinary gears extension is interesting too, I'll take a closer look a bit later.

Changed in inkscape:
milestone: none → 0.49
status: New → Triaged
Revision history for this message
Nick (xepecine) wrote :

>>Let's target it for 0.49!

Sure! What is need from my side?

Revision history for this message
jazzynico (jazzynico) wrote :

> Sure! What is need from my side?

We now need to compare your extension to the one in the trunk (extended with the patch from Bug #692719), and see how they differ and how we can merge them. And as we're at it, also see if it's possible to merge the unordinary gears too (maybe a bit more complicated). It would really help if you could give your opinion on it!

Thanks!

Revision history for this message
Gijs van Oort (gijsvanoort) wrote :

I have improved the (as far as I could find) newest version of this gear plugin. Please consider putting it in 0.49. I think it could simply replace the version that is in the trunk at this moment; in that version there is no extra functionality which is not in the version presented here.

I added:
- More accurate tooth profile. In earlier versions the involute curve was approximated by only three points; now by 15 (can be modified in the source code)
- Center cross (easy for aligning); off by default, can be turned on
- Pitch circle (easy for meshing; circles should touch for meshing gears); off by defalut can be turned on
- Info: in the SVG there is now an extra field telling a little about the gear (easy if you want to make a meshing gear but you forgot the settings used)

Note:
For gears with few teeth (e.g. 6), a phenomenon called 'undercut' is needed in order to make them run smoothly. This is not included in this plugin (couldn't find out how to do that...)

jazzynico (jazzynico)
Changed in inkscape:
assignee: nobody → Gijs van Oort (gijsvanoort)
status: Triaged → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

Not totally tested yet, but very interesting improvements!

It seems that the holes rounding option has no effect (it is not used at all in the Python file). If you have no plan to implement it in a near future, we will have to remove the option before committing it for 0.49.

Thanks for your new version, and sorry again for the delay.

Revision history for this message
jazzynico (jazzynico) wrote :

Two noticeable things that should be fixed:
1. Holes behaves weirdly in negative contexts, that is to say when the mount hole diameter is larger than the teeth (the teeth are inside the hole) or when the holes border width is too large compared to the place left inside the gear.
2. Some values lead to math errors (very likely a division by zero):
  File "gears-dev.py", line 222, in effect
    a = asin(holes_border/r_outer/2)
ValueError: math domain error

I'll send an example file later today.

Revision history for this message
jazzynico (jazzynico) wrote :

Test file attached.

Revision history for this message
jazzynico (jazzynico) wrote :

Note that a crash occurred while trying to set the parameters for the second gear (in live preview, playing with the holes border width value from 5 to 15).
Reproduced on Debian testing, Inkscape trunk revision 12015, not reproduced on Windows yet.
GDB trace attached.

Revision history for this message
Gijs van Oort (gijsvanoort) wrote :

Thank you for the detailed descriptions of the problems. I will try to find time soon to fix them.

What would be preferred behaviour in the case of incompatible parameters given by the user (e.g. a center hole larger than the gear itself)?
- Render the faulty gear (including too large 'center' hole) anyway?
- Render the gear without center hole?
- Render the gear with an as-large-as-possible center hole?
- Render an error message as text?
- Render nothing and use inkex.errormsg() for feedback? (as far as I understood, this feedback is hard to find for end users...)
- Anything else?

Revision history for this message
Alvin Penner (apenner) wrote :

- Render the gear with an as-large-as-possible center hole?
 - Render an error message as text?

I would be inclined to do both of the above. Apply a clamp to the illegal parameter to force it to stay in the allowed range and avoid the crash. And at the same time use inkex.errormsg() to let the user know what you have done. If I remember correctly, the error message will just be a popup message that will not interfere with the rendering.

Revision history for this message
Jürgen Weigert (jnweiger) wrote :

Here is a small extension on Gijs van Oort's version:
- Added an option to allow entry of Metric Module instead of Circular Pitch. Check mark this and (Pitch=Module) * Teeth is diameter of pitch circle. My metric-trained brain needs this.
- Made the dialog more compact again by moving the Clearance description to a seperate label.

Revision history for this message
Jürgen Weigert (jnweiger) wrote :

One more update:

- option added to set accuracy. 20 (default) is not needed for large number of teeth.
- range limits extended, to allow up to 1200 teeth. 360 was to low.
- updated the dialog to be more verbose and name all the limits.

su_v (suv-lp)
Changed in inkscape:
milestone: 0.91 → 0.92
Revision history for this message
su_v (suv-lp) wrote :

Related follow-up report (gears-dev):
- Bug #1295641 “gears-dev -- an improved version of the gears extension”
  <https://bugs.launchpad.net/inkscape/+bug/1295641>

jazzynico (jazzynico)
Changed in inkscape:
milestone: 0.92 → 0.93
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.