I have 100+ SVG files, each containing a few closed paths (with Bezier curves), like this:
I'd like to do the following:
- select the first (bottom) path
- duplicate it
- move the duplicate by an (x, y) amount
- subtract the duplicate from the original path.
And save the SVG.
Is there any way I can do this automatically?
Technologies I looked at:
- Inkscape - as far as I can see, you can only write scripts in Python that manipulate the SVG node hierarchy directly, can't call the built-in path subtract function.
- Illustrator - I tried to record the steps in an Action, but can't seem to be able to select the bottom path automatically, you can only select objects in an Action by name.
- Affinity Designer - not scriptable.
- CorelDRAW - messed up the width / height of the SVG straight away, didn't look further.
- Scribus - superb scriptability with Python, but can't seem to find the Python function for the subtract path operation (all the other steps work).
- Clipper library (C++, C# and Delphi) - doesn't support curves, only straight lines + you would need to write the SVG parsing yourself.
I'm looking for a solution using any scriptable vector editing tool, plugin, or programming language + library combo.