2015-01-09 10:55:41 |
Anton |
description |
Hello,
Currently Render gears (and Render gears rack, which I can see appeared in trunk) only allow to provide size parameters in pixels. It would be nice if they allow to provide parameters in any units (physical units like millimeters are useful for CNC).
Plugin files in trunk:
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gear_rack.inx
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gear_rack.py
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gears.inx
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gears.py
I have implemented this in my own repository (fixed "generate gears" plugin from current stable 0.48, render rack and pinion based on the same "generate gears"):
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/rack_and_pinion.inx
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/rack_and_pinion.py
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/gears1.inx
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/gears1.py
To add unit of measure take 2 steps:
1) add "Unit" param to inx file:
<param name="unit" type="optiongroup" appearance="minimal" _gui-text="Unit">
<option value="cm">cm</option>
<option value="ft">ft</option>
<option value="in">in</option>
<option value="m">m</option>
<option value="mm">mm</option>
<option value="pc">pc</option>
<option value="pt">pt</option>
<option value="px">px</option>
</param>
2) then init params in Python file in the following way:
pitch = inkex.unittouu( str(self.options.pitch) + self.options.unit )
With this I have gears and rack and pinion plugins, that can generate details in millimeters in Inkscape 0.48
To test plugins with current Inkscape installation put inx and py files to
- on Windows: C:\Users\user\AppData\Roaming\inkscape\extensions
- on Linux: ~/.inkscape/extensions
and restart Inkscape, then go to menu "Extensions/Render/Gear1..." or "Extensions/Render/Rack and pinion...". |
Hello,
Currently Render gears (and Render gears rack, which I can see appeared in trunk) only allow to provide size parameters in pixels. It would be nice if they allow to provide parameters in any units (physical units like millimeters are useful for CNC).
Plugin files in trunk:
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gear_rack.inx
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gear_rack.py
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gears.inx
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gears.py
I have implemented this in my own repository (fixed "generate gears" plugin from current stable 0.48, render rack and pinion based on the same "generate gears"):
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/rack_and_pinion.inx
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/rack_and_pinion.py
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/gears1.inx
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/gears1.py
To add unit of measure take 2 steps:
1) add "Unit" param to inx file:
<param name="unit" type="optiongroup" appearance="minimal" _gui-text="Unit">
<option value="cm">cm</option>
<option value="ft">ft</option>
<option value="in">in</option>
<option value="m">m</option>
<option value="mm">mm</option>
<option value="pc">pc</option>
<option value="pt">pt</option>
<option value="px">px</option>
</param>
2) then in Python file add unit param to OptionParser
self.OptionParser.add_option("-u", "--unit",
action="store", type="string",
dest="unit", default="px",
help="The unit of dimensions")
and init other params using this unit in the following way:
pitch = inkex.unittouu( str(self.options.pitch) + self.options.unit )
With this I have gears and rack and pinion plugins, that can generate details in millimeters in Inkscape 0.48
To test plugins with current Inkscape installation put inx and py files to
- on Windows: C:\Users\user\AppData\Roaming\inkscape\extensions
- on Linux: ~/.inkscape/extensions
and restart Inkscape, then go to menu "Extensions/Render/Gear1..." or "Extensions/Render/Rack and pinion...". |
|
2015-01-09 16:11:48 |
Anton |
description |
Hello,
Currently Render gears (and Render gears rack, which I can see appeared in trunk) only allow to provide size parameters in pixels. It would be nice if they allow to provide parameters in any units (physical units like millimeters are useful for CNC).
Plugin files in trunk:
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gear_rack.inx
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gear_rack.py
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gears.inx
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gears.py
I have implemented this in my own repository (fixed "generate gears" plugin from current stable 0.48, render rack and pinion based on the same "generate gears"):
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/rack_and_pinion.inx
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/rack_and_pinion.py
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/gears1.inx
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/gears1.py
To add unit of measure take 2 steps:
1) add "Unit" param to inx file:
<param name="unit" type="optiongroup" appearance="minimal" _gui-text="Unit">
<option value="cm">cm</option>
<option value="ft">ft</option>
<option value="in">in</option>
<option value="m">m</option>
<option value="mm">mm</option>
<option value="pc">pc</option>
<option value="pt">pt</option>
<option value="px">px</option>
</param>
2) then in Python file add unit param to OptionParser
self.OptionParser.add_option("-u", "--unit",
action="store", type="string",
dest="unit", default="px",
help="The unit of dimensions")
and init other params using this unit in the following way:
pitch = inkex.unittouu( str(self.options.pitch) + self.options.unit )
With this I have gears and rack and pinion plugins, that can generate details in millimeters in Inkscape 0.48
To test plugins with current Inkscape installation put inx and py files to
- on Windows: C:\Users\user\AppData\Roaming\inkscape\extensions
- on Linux: ~/.inkscape/extensions
and restart Inkscape, then go to menu "Extensions/Render/Gear1..." or "Extensions/Render/Rack and pinion...". |
Hello,
Currently Render gears (and Render gears rack, which I can see appeared in trunk) only allow to provide size parameters in pixels. It would be nice if they allow to provide parameters in any units (physical units like millimeters are useful for CNC).
Plugin files in trunk:
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gear_rack.inx
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gear_rack.py
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gears.inx
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/share/extensions/render_gears.py
I have implemented this in my own repository (fixed "generate gears" plugin from current stable 0.48, render rack and pinion based on the same "generate gears"):
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/rack_and_pinion.inx
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/rack_and_pinion.py
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/gears1.inx
https://github.com/1i7/metalrobot/blob/master/inkscape/extensions/gears1.py
To add unit of measure take 2 steps:
1) add "Unit" param to inx file:
<param name="unit" type="optiongroup" appearance="minimal" _gui-text="Unit">
<option value="cm">cm</option>
<option value="ft">ft</option>
<option value="in">in</option>
<option value="m">m</option>
<option value="mm">mm</option>
<option value="pc">pc</option>
<option value="pt">pt</option>
<option value="px">px</option>
</param>
2) then in Python file add unit param to OptionParser
self.OptionParser.add_option("-u", "--unit",
action="store", type="string",
dest="unit", default="px",
help="The unit of dimensions")
and init other params using this unit in the following way:
pitch = inkex.unittouu( str(self.options.pitch) + self.options.unit )
With this I have gears and rack and pinion plugins, that can generate details in millimeters in Inkscape 0.48
To test plugins with current Inkscape installation put inx and py files to
- on Windows: C:\Users\user\AppData\Roaming\inkscape\extensions
- on Linux: ~/.config/inkscape/extensions
and restart Inkscape, then go to menu "Extensions/Render/Gear1..." or "Extensions/Render/Rack and pinion...". |
|