Splitting svg with icons into squares (individual icon files)

Discussion about writing code for Inkscape.
PrzemoF
Posts: 3
Joined: Sat Mar 02, 2019 4:26 am

Splitting svg with icons into squares (individual icon files)

Postby PrzemoF » Sat Mar 02, 2019 4:40 am

I'm not sure where to post it - please move it if there is a better place.

I'm looking for a way of automatic splitting an svg file containing icons for FreeCAD into individual svg files. Is there a way of extracting content of svg from a given coordinates + box size? The icons are located in a regular grid. An inkscape plugin/extension/script would be perfect, but I'm ready to use any open source solution. I can provide a sample file.

Please share any ideas, as I have none at this moment :)

PrzemoF
Posts: 3
Joined: Sat Mar 02, 2019 4:26 am

Re: Splitting svg with icons into squares (individual icon files)

Postby PrzemoF » Sat Mar 02, 2019 9:17 pm

Sample test file (I can't attach svg here): http://opencyclingcomputer.eu/FreeCAD/o ... XAMPLE.svg

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Splitting svg with icons into squares (individual icon files)

Postby Moini » Sun Mar 03, 2019 3:41 am

Try https://gitlab.com/su-v/inx-exportobjects (just make sure they are all individual objects and that the objects have the desired bounding box. If needed, add an invisible rectangle or square to each one).
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

PrzemoF
Posts: 3
Joined: Sat Mar 02, 2019 4:26 am

Re: Splitting svg with icons into squares (individual icon files)

Postby PrzemoF » Tue Mar 05, 2019 5:35 pm

Thanks, I'll test it!


Return to “Programming”