Support unit of measure for render gears and render gear rack plugins
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
New
|
Wishlist
|
Unassigned |
Bug 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://
http://
http://
http://
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:/
https:/
https:/
https:/
To add unit of measure take 2 steps:
1) add "Unit" param to inx file:
<param name="unit" type="optiongroup" appearance=
<option value="
<option value="
<option value="
<option value="
<option value="
<option value="
<option value="
<option value="
</param>
2) then in Python file add unit param to OptionParser
self.OptionPar
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.
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\
- on Linux: ~/.config/
and restart Inkscape, then go to menu "Extensions/
There are no further bug-fix releases of Inkscape 0.48.x planned.
> pitch = inkex.unittouu( str(self. options. pitch) + self.options.unit )
Please note: using 'inkex.unittouu()' is not compatible with trunk or upcoming 0.91 [1].
Any chance you could coordinate your proposed changes with the author of this (likely) related request? /bugs.launchpad .net/inkscape/ +bug/1295641>
- Bug #1295641 “gears-dev -- an improved version of the gears extension”
<https:/
-- wiki.inkscape. org/wiki/ index.php/ Release_ notes/0. 91#Units: _Breaking_ change
[1] http://