Screenshot of my extension

Screenshot of my Inkscape optical rotary encoder disc generator

I developed an extension for Inkscape which can create optical rotary encoder discs in any size/number of segments. It currently supports single and two-track (quadrature) encoders but I’m going to add support for gray encoded discs as well. Post a comment if you have any other suggestions for additional features!

Usage should be pretty straightforward, if you for example do not want a second track, just set its diameter to 0. This applies to other features (like the center hole) as well. The live preview is pretty handy too.

Inkscape extension architecture is pretty straightforward, the .inx file just basically tells Inkscape what kind of UI you want for your plugin, and then it just passes the values from the UI to your extension script (the param fields in the .inx file must match the argument names in your script). The documentation is unfortunately pretty much non-existent. It is easy to use though but pretty limited for anything too complicated. For example I’m not sure if there is any way of affecting the UI from the script so bye-bye any dynamic menus or other dynamic content in the plugin. It can basically run any kind of script your machine is able to run, you’re not just limited to Python, the communication is done through stdout.

You can find the files from GitHub: Inkscape rotary encoder disk generator

Edit: Added gray encoding support, see post: Inkscape optical rotary encoder disc generator: added gray encoder support

Edit: Added single-track gray encoder support, see post: Inkscape optical rotary encoder disc generator: added single-track gray encoder support

Categories: Programming

9 Responses so far.

  1. Jim says:

    Doesn’t wok for me on Linux Mint 12. Using the same versions of Inkscape and python. The extensions menu show an Optical Encoder Disk, but when you move the mouse to it a single short line is exposed rather than a menu. I’m not a python programmer so I have no idea what might be going on.

    I did try to execute the .py code and got a can’t find but added a import sys
    as suggested in a google search. That solved the problem but another python executions gave an index out of range. I suspect you can’t run it stand alone.

    Any ideas?


    • Jim says:

      I read some of the other responses RE: grey code. The permissions are fine. I used the zip file and it unzipped with execute permission on the .py file. I’ve restarted inkscape numerous times. Perhaps there is a deb package that is required that I don’t have? I just installed inkscape via apt-get.

    • Hey Jim! Thanks for the report, this is a bug which is now fixed in GitHub.

  2. sudarshan says:

    Just one doubt what is the mesurement unit that is being used for this ?

    Thank you its a very good plugin

  3. Gaël Mauron says:

    Your extension does not appear in my Inkscape 0.48.4 r9939 running on Windows.
    If you have any advice I would be greatful.

    • Hello Gaël! Unfortunately I’m not familiar with Inkscape on Windows, I have no idea.

    • sudarshan says:

      Hi i have been using it in inkscape on windows
      its working properly.

      all i did was copy pasted the files in site the specified folder
      started the inkscape and then went to extensions menu there i found it
      it was that easy

  4. [...] creating optical rotary encoder discs. Creando gráficos para encoders ópticos con Inkscape. Vía “DGK Electronics”. Compartir: TweetTambién te pueden interesar:La semana en links (17/07/2012)La [...]

Leave a Reply