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.

http://tavmjong.free.fr/INKSCAPE/MANUAL/html/CommandLine.html

21 Likes

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

1 Like

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!

5 Likes

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.

7 Likes

Scripting automation is definitely a win here.

3 Likes

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.

3 Likes

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.

2 Likes

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.

2 Likes

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

6 Likes

cough fusion360 cough

3 Likes

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

4 Likes

from the Corel User Support Group thread:

7 Likes

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

5 Likes

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

5 Likes

Me too :grinning:

3 Likes

Alternatively…

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)

7 Likes

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

6 Likes

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

1 Like

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