gear extension should have option to render a central hole

Bug #692719 reported by Jonathan Manton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
Jonathan Manton

Bug Description

The gear extension is great, but when using it to fabricate things it would be nice if there was a central hole in the gear. This makes it easier to do things like create a gear train on a laser cutter.

Revision history for this message
su_v (suv-lp) wrote :

Linking as duplicate to Bug #329431 in Inkscape: “Feature Request: Enhance the Gears Effect”. Please add a comment here and revert the duplicate status if you don't agree and think these are unrelated feature requests.

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

Reverting the duplicate state myself - bug #329431 seems to be about the live path effect, not the script extension to create gears (though it is ambiguous because in earlier versions (2009-02-14 -> 0.46), extensions used to be listed in the 'effects' menu).

Keeping this one as a feature request to enhance 'Extensions > Render > Gear…'.

Revision history for this message
Jonathan Manton (jmanton) wrote :
Revision history for this message
Jonathan Manton (jmanton) wrote :
Revision history for this message
Jonathan Manton (jmanton) wrote :

This is the first time I've submitted a patch, so I'm not sure if the file names at the top of the patch are what you need. I hope to do more minor patches in Inkscape, so please let me know how you'd like me to format the patch files (what filenames to use for the new/old files).

Also, this is a patch vs. the current 0.49.x branch of Inkscape, which had a couple of very small changes from the release branch. I don't know if the 0.48.x version has the same changes or not (just formatting things in gears.inx, and a change to the vim modeline in gears.py).

Revision history for this message
su_v (suv-lp) wrote :

Tested with Inkscape 0.48+devel r9967 on OS X 10.5.8: looks fine to me :)

I'm not sure about using the 'A' (arc) path command: Inkscape renders it correctly (using bézier curves internally), and converts the 'A' path commands to 'C' (cubic Bézier) as soon as the path is node-edited. Possibly the extension could generate an Inkscape/sodipodi 'ellipse' which would allow to edit the object with the circle/ellipse tool in Inkscape? Or an SVG <circle> basic shape (as done by the 'Number nodes' extension), possibly allowing easier manipulation of the object in animations since it does reference the center point (unlike a path with 'arc' commands)?

Another thought (just an idea): would it be possible to alternatively (optionally) define the radius in % of the overall width or of a relevant radius of the gear as actually rendered based on the parameters? Admittedly, I haven't tried to figure out how each of the gear parameters influences the final dimensions of the gear ;) - nor do I know if technically the hole is ever defined in relative terms instead of absolute values for the radius…

> this is a patch vs. the current 0.49.x branch of Inkscape, (…)

Providing the patch against trunk (0.49.x at the moment) is fine. It might be backported to the 0.48.x branch, but since that branch is maintained for bug fix releases of 0.48.0, it is more likely that the new feature will go into the next stable release.

> I hope to do more minor patches in Inkscape, (…)

Great! :) If you plan to work on more features / patches, you could consider using bazaar to create a local branch or checkout of lp:inkscape and for example create patches with 'bzr diff <filename>' or 'bzr diff <dirname>':
<http://inkscape.org/bzr.php?lang=en>

Note that once two of your contributions (patches or bug fixes) have been accepted and committed, you can apply for membership in the 'Inkscape Developers' team and get bzr commit access yourself.

Changed in inkscape:
status: New → In Progress
Revision history for this message
Jonathan Manton (jmanton) wrote :

Ok, here is the next try (patch generated with bzr diff of trunk).

I changed the inner circle into a sodipodi arc. This allows one to use the circle tool to change the radius. There is definitely a trade-off here - editing with the circle tool allows the user to easily adjust the radius, but for someone who is creating the gear to animate it might not be as good due to the center not being explicit in the SVG element.

In terms of percentage vs. absolute measure, for me at least the absolute measure is more useful, as it allows me to size the center hub to the right size for a shaft when cutting out using a laser cutter. With this in mind I also added an option to specify the sizes (both pitch and center hole) in different units (px, in, and mm), and also changed the measure to be the diameter, rather than the radius (since if you are sizing it to fit a shaft, you typically are thinking of the diameter of the shaft, rather than the radius).

Revision history for this message
su_v (suv-lp) wrote :

Thank you for the updated patch! Tested with Inkscape 0.48+devel r9991 on OS X 10.5.8

About the trade-off: since the gear is inserted as a group with the center in the upper left corner of the page (SVG origin 0,0), animation should work with the additional circle inserted as well (with the bonus of being able to edit its parameters with the ellipse tool).

See also <http://article.gmane.org/gmane.comp.graphics.inkscape.user/13378> with a brief description by one of the authors of the original version of the gear extension.

@JazzyNico - what do you think? Could you commit the second patch?

Revision history for this message
jazzynico (jazzynico) wrote :

Second patch available in the trunk as of revision 9992.
Feel free to reuse this report to attach further modifications.

As for the center hole, I'd prefer a real SVG circle, but unfortunately that kind of shape can't be edited with the ellipse tool. But the second patch looks good and greatly improve this extension.

Thanks Jonathan!

Changed in inkscape:
assignee: nobody → Jonathan Manton (jmanton)
milestone: none → 0.49
status: In Progress → Fix Committed
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
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.