Windows: C:\Program Files\Inkscape\extensions
Macs: /Applications/Inkscape.app/Contents/Resources/extensions/
Linux: somewhere, I'm sure
To help others write extensions, I wanted to distill down to mostly bare
bones an extension which acts upon an existing drawing (selection),
manipulates the path data in the drawing (selection), and then puts the
revision back into the drawing (selection). What I came up with is attached
below. It includes complete code to do most of the tedious heavy lifting
(e.g., traversing the SVG paths and reducing the path data down to lists
of absolute (x,y) coordinates). I'll eventually put a Wiki page up along
with a zip file at the code site if this proves sufficiently useful to
others.
The attached extension is in two files: twist.py and twist.inx. You can
put them in your private extensions directory,
Windows: ?
Macs: ~/.config/inkscape/extensions/
Linux: ~/.config/inkscape/extensions/
and then restart Inkscape to see the extension. While it is *not* an Eggbot
extension, it will (owing to the contents of twist.inx) appear under "EggBot"
in the list of extensions. Namely Extensions > EggBot > Twist. The .py file
is the Python code for the extension, while the .inx file is the
extension description which Inkscape uses to know what input the extension
needs and how to run it.
Cheers,
Dan
You may also find the lxml.etree tutorials & docs of some help when you
start trying to do manipulations of a parsed SVG document. lxml is the
parser with Inkscape's Python extension framework uses.
BTW, the twist.inx wasn't a good example of useful text for an extension
GUI. I had as the intro text a random snippet from a hatch fill extension
I had written. I forgot to make the text relevant to the "twist"
extension. Oh well.
If you have any questions, don't hesitate to ask.
Dan
Dan
P.S. FWIW, the issue was that Apple Mail's "attach" won't let me navigate
down a hidden directory (.config/inkscape/extensions/) and so I had to move
the file somewhere else where I could attach it from. However, I somehow
picked up an older, non-working version. Sigh.