dbrgn
January 13, 2023, 9:19pm
1
Hi all. To convert SVG files (e.g. a logo) to a LibrePCB library element, I wrote a small tool called “svg2librepcb”:
It also contains an Inkscape extension to simplify the workflow:
It’s still very rough around the edges, but can already be used to import arbitrary shapes into LibrePCB.
3 Likes
All the shapes are coming out far too big. Is there a way to scale them?
dbrgn
October 16, 2023, 7:27am
3
The dimensions in the SVG are used directly for the LibrePCB components. You will have to scale the elements in the SVG before conversion.
I’m not even sure if SVG has support for reference units. When saving an Inkscape SVG, the following element is inserted:
<sodipodi:namedview
...
inkscape:document-units="mm"
…however, when exporting a “Plain SVG”, that tag is gone.
One option would be to add a “treat SVG units as mm” option in the exporter. Pull requests would be welcome.
Another option would be a set off input fields for the bounding box target size. This way, an object could be re-scaled.
I’ve been going about making some of my own tools to modify and scale the librepcb packages (graphics), how have you been generating the footprint and polygon ids? I don’t know if there’s a way I can do it so it doesn’t conflict with the footprint or polygon ids for other packages, but I also don’t know if it matters.
dbrgn
March 31, 2024, 5:16pm
5