Inkscape on the command line


I had no idea this was possible!
Since my copy of Illustrator is ancient, and I don’t want to buy an Adobe sub, I am investigating Inkscape for SVG making. The ability to make extensions, and to script it on the CLI is super useful.


What scripts are you thinking of making? Anything we would be interested in?


I won’t really know until I learn Inkscape well enough to find it’s flaws (if it has any). :smile:

In the past I have scripted Illustrator to automate repetitive sequences, but I have no idea what I will really end up doing. Even if I never actually use it, knowing it is there is still useful!


First thing that occurs for me is the possibility of doing kerf adjustment (inset/outset) for non-proofgrade. File goes in, script operates on it, other file comes out.


Scripting automation is definitely a win here.


SVG is a pretty readable file-format (it’s just text) and object styles are hierarchical, like CSS (you can in fact embed SVG in CSS and other HTML objects) so like @paulw points out, you ought to be able to programmatically apply a change to an entire line weight. Such a script wouldn’t even need Inkscape to work. That’s like a sed one-liner.


I don’t think changing the line weight makes any difference to the cut. I think it cuts down the middle. To adjust kerf you need to change all the endpoints to make the outline bigger if it is outside and smaller if it is inside.

It could be done with Python and Clipper but certainly not a sed one liner.


You’re right - I was thinking about line weights affecting laser focus rather than the position of the kerf wanting adjustment.


Corel Draw is inexpensive and can do everything Adobe illy can do without a subscription.


True, but inkscape is free and I am a cheapskate (and I work with open source for my day job).


cough fusion360 cough


I like onshape for modeling but still need a vector drawing editor.


from the Corel User Support Group thread:


You’re right. I should rephrase myself - Corel X8 does everything that AI does that matters :stuck_out_tongue_closed_eyes:


I need to go home, I’m getting some wacky deja-vu


Me too :grinning:



sed 's/.*MyStar.*$/\<g transform="matrix(1 0 0 -1 0 0)"\>&<\/g>/' MyStar.svg > MyStar.svg

(… okay I’m kidding, that’s a really cool link! :blush: I love how Inkscape’s dedication to their “verb”-based architecture enables this kind of thing)


You don’t need inkscape to make SVG’s.


Oh wow! I had a class in H.S. that taught :turtle: programming :grin:


I heart that you actually went ahead and demonstrated a sed one-liner for the task.