Hi, newbie here. I hope this is the right place to ask this.
I made pcbnew export Edge.Cuts and a few other layers to SVG, hoping to use it as input for a laser-cutter for making a protective plate. To my surprise, when I open it in Inkscape, I see small errors everywhere that make it hard to do manual adjustments needed for the plate.
It seems the problem is that KiCad is exporting to SVG in inches: the file sets a viewBox with 1 pixel per mil on an A4 sheet (not sure “pixel” is the right word here, but I mean whatever unit SVG drawing commands use). I have pcbnew set to use mm in the Preferences dialog. I’ve tried File > Plot, but that also exports in inches. Is there a way to have pcbnew export something that works better in mm, say one that sets a viewBox with 1 pixel per mm? I’m using KiCad 5.99.0+really5.1.10+dfsg1-1 on Ubuntu GNU/Linux.
Below are the first lines of an .SVG generated with KiCad, by using: PCB Editor / File / Export / AVG….
I exported the whole A4 sheet which is 297 by 210mm and the viewbox is also set to these coordinates.
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
width="29.700220cm" height="21.000720cm" viewBox="0 0 297002200 210007200">
<title>SVG Picture created as mumar_base_stm32-F_Cu.svg date 2022/01/26 16:17:23 </title>
<desc>Picture generated by PCBNEW </desc>
<g style="fill:#000000; fill-opacity:1.000000;stroke:#000000; stroke-opacity:1.000000;
stroke-linecap:round; stroke-linejoin:round;"
transform="translate(0 0) scale(1 1)">
</g>
<g style="fill:#000000; fill-opacity:0.0;
Also, the big numbers in the viewbox coordinates: 297002200 and 210007200 are a strong indication that KiCad uses nanometers, which is the native resolution in which KiCad does everything.
That’s what I’d like to see! I get the following instead. I did Pcbnew / File / Export / SVG (S)…, select SVG page size “current paper size”, select paging “all layers in a single file”, and hit Export. (I’m translating from Japanese menus, so the wording may be different.)
Just to make sure, “PCB Editor” is pcbnew, right? I don’t know about the version number, that’s just what dpkg (and the Help / About button on pcbnew) shows. I see, it might just be a version problem. Let me try out a different version and see.
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
width="29.700220cm" height="21.000720cm" viewBox="0 0 116930 82680">
<title>SVG Picture created as my-petite-split-brd.svg date 2022/01/27 00:24:24 </title>
<desc>Picture generated by PCBNEW </desc>
<g style="fill:#000000; fill-opacity:1;stroke:#000000; stroke-opacity:1;
stroke-linecap:round; stroke-linejoin:round;"
transform="translate(0 0) scale(1 1)">
</g>
Some people have quite good reasons for staying with an older stable version (For example if it’s for work), but your version suggests some lust for new stuff.
A stable version V6.0 was released around christmas, and has already been bumped to V6.0.1 with a few bug fixes. You can find installation instructions on the KiCad website.
Aha! Updating to 6.0.1 solved the problem, now everything is done cleanly in nanometers. And this is just a hobby project, so being on the cutting edge is no problem for me. Thank you so much paulvdh!