Is there anyone out there who uses the Inkscape plugin Svg2Shenzhen that would be willing to help?

Sorry, really don’t know the right terms or best way to describe my issue so hope photos will help?

I’m trying to follow the only tutorial on using the plugin I can find on youtube.

But I get a very different layout than the one in the video when I import my SVG file.

The tutorial:
Imgur

My objects tree looks like this when I import an SVG:

Imgur

I get all the board layer options after preparing the document, but my original SVG stays in this nested group within a group and leads to all sorts of issues moving the right art to the right layer in the plugin, resulting in some strange rescaling and output to KiCad that is all over the place.(would post more but as a new user can only post two links)

Tried asking for help on some Inkscape forums, but they said I would have more luck with the KiCad community…hope that’s true!

So, if anyone has some free time to help take me by the hand and guide me through some fundamentals of importing the SVG it would be sincerely appreciated!

Please tell us your KiCad version and OS

Hi, I’m on Windows 10 and (5.1.10)-1 release build.

Here is an example of my problem. I bring in the SVG files from Adobe illustrator and copy them to the layers generated by the plugin.

Imgur

But when it exports I get this mess of scale and position.
Imgur

This is 100% human error, and just don’t know what I’m doing wrong, due to being new to inkscape and KiCad.

I think that is purely a scaling problem, probably a mix of metric and imperial

edit
I don’t think many people use SVG for more than a graphic, so the holes feature and their alignment is under-tested

Scale factor seems to be about 4, so another sort of problem seems more likely.

Old Inkscape was 91 DPI default

New Inkscape is 96 DPI

Kicad (if I remember correctly) is 91 DPI

The problem (assume) is the DPI. You can set it in Inkscape but not in Kicad. Thus, for an existing output, scale it by 96/91 or inverse (depending on versions and what you’re doing…)

EDIT: added screenshot of Inkscape panel

EDIT: re @paulvdh estimate of “4”…
96DPI / 25.4mm = 3.78 DPmm
Me thinks you’re also mixing Units :wink:

1 Like

Thank you BlackCoffee, have changed to 91DPI, but have the same issue:
Imgur

Imgur

Have also check my units for the SVG I made in Illustrator, all units set to mm:
Imgur
Imgur
Imgur

Anything else’s I could be doing wrong?

Seems to work fine if I draw in inskscap, just when importing the SVG things seem to go all funky!?

Imgur
Imgur

First, I know nothing about the Svg2Shenzhen plugin - it may the problem.

Post your SVG file, I’ll look at it. I’ve made far too many SVG’s for Fritzing parts and PCB’s so I’m curious. I’ve hand coded most of them but have also used Adobe, Inkscape, EZdraw, Libre, OpenOffice, Gravit, Coral… long list and SVG’s are simple to make and review…

Simple hand-coded example:

YES_xml_to_SVG copy 3

Here’s the SVG code (it’s just text !) See if you can load it the same way you’re loading your SVG… The code/text is complete in that if you copy and paste it into a text-file (UTF-8, not Rich-Text) and save with .SVG extension, it will be an SVG file :wink:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Enter The PCB design Shape Here -->
<rect x="1mm" y="1mm" width="100mm" height="70mm" style="fill:green;fill-opacity:0.3;stroke-opacity:0.9" />

<!-- this is a cutout in the board, if desired -->
<rect x="10mm" y="1mm" width="21mm" height="10mm"
style="fill:white;fill-opacity:1.0;stroke-opacity:0.9" />

<!-- this is a hole, if desired -->
<circle r="2mm" cx="12mm" cy="14mm"
style="fill:black;fill-opacity:1.0;stroke-opacity:1.0" />

</g>	<!-- end board -->

<g id="silksecreen" />

First, I know nothing about the Svg2Shenzhen plugin - it may the problem.

That’s the one part that seems to be working :smiley: if I use it as intended and draw my PCB in inkscape and then export with the plugin into KiCad I get what I would expect.

The issue seems to be when importing anything from illustrator to Inkscape, also noticed the scale is off when I import a SVG too from illustrator. I export it as 200mmx200mm and it comes in at 150.265x150.265mm? (but, gess I can work that part out later!)

Being totally new to inscape and kiCadis not helping either!

Maybe I should explain what I’m trying to do, and you can tell me a simpler way?

Basically, Im trying to reproduce a vintage and drawn PCB from the 60’s, normally I would trace it and send my fab a DXF and they would do all the hard work. but as this is just a small project for a friend I will send to go to a Chinese fab, so will need Gerber, so been trying to go from a scanned image of the board into illustrator out as an SVG into Inkscape, out via Svg2Shenzhen into KiCad…and well, frankly not having a lot of joy with the scale coming in, or the scale into KiCad of the different layers…about 5 days in an if I had hair left I would pull it out!

Thank you for taking the time to help, it is really appreciated!

Here is a link to the SVG
https://drive.google.com/file/d/19DkooCyqz1jt6fhSOVD1lPXo3vaSCwBZ/view?usp=sharing

<?xml version="1.0" encoding="UTF-8"?>

<!-- Enter The PCB design Shape Here -->
<rect x="1mm" y="1mm" width="100mm" height="70mm" style="fill:green;fill-opacity:0.3;stroke-opacity:0.9" />

<!-- this is a cutout in the board, if desired -->
<rect x="10mm" y="1mm" width="21mm" height="10mm"
style="fill:white;fill-opacity:1.0;stroke-opacity:0.9" />

<!-- this is a hole, if desired -->
<circle r="2mm" cx="12mm" cy="14mm"
style="fill:black;fill-opacity:1.0;stroke-opacity:1.0" />

</g>	<!-- end board -->

<g id="silksecreen" />

I get the error:

This page contains the following errors:

error on line 6 at column 1: Extra content at the end of the document

Below is a rendering of the page up to the first error.

I just cut and pasted that into notepad++ and made sure the encoding was set to UTF-8

I see three “Comma’s” that don’t belong there.

Aside from that, it wasn’t intended to show up in Kicad as a PCB - just wanted to know what get reported.

Now, knowing what you want to do…

I looked at the details of your posted file - no problems.

However, though the file contains the layers with the copper, they are lines without width… I could go on and on but, in the end, the file (as is) is not usable, in my opinion.

To confirm that, I opened it in Gravit, exported as PNG and used Kicad’s BitMap too to convert it to PNG. Then, loaded it in Kicad PCB.

Screenshots…

ah, that is something I think I can fix in illustrator.

(think there will be a few other issues with it too, trying lots of things that didn’t work, and go back and forth).

I will start the trace over, and see if I have any luck.

Do you happen to know a good guide or resource on bringing in images as board layers for KiCad, I have only done this before in Eagle, and well that did not end well.

Would make my life so much easier if I could find a way to get from a traced vector image of a PCB to production Gerber files.

There are a number of ways to get there… But, the simplest is to Start a new PCB in Kicad. It will save time and you’ll get what you want and what a PCB fab can make.

However, some info to answer your question(s) by example:

Using the PNG (exported from the SVG in Gravit ( you could use Inkscape, instead. In fact, just load your file in Inkscape and save it as PNG, then, use Kicad’s BitMap tool to make a .mod (footprint, as indicated in my previous post).

Now, with an exported .mod, load it into PCBnew. Screenshots below show it in Green with different ‘Threshold’ settings.

The last one (green dots) were set by checkbox for “Negative”. Then, I transferred them to the Edge-Cuts layer (i made plugin to do but, there many posts on how to edit the .mod file (it’s just a text file and need to change the layer name from user to edge cuts).

The last item shows exactly that, then I drew a rectangle around it. BUT, I did Not cleanup the lines and they need cleaning. In fact, with so many, I’d start from scratch, if it were me doing the work…

Sort of an Edit to my previous post…

If you want to trace it, options are:
• Do the PNG thing as I mentioned and Trace it in Kicad.
• Fritzing loves SVG’s (as long as it’s valid for Fritzing - (i.e. there are SVG details to address. First effort would be simply to load it (in Fritzing) as a ‘Board’ there’s clickable to do it. I no longer have Fritzing loaded on my machines, so, can’t help).

If it loads fine in Fritzing, then export it as file type you want… And, Fritzing users can help you…

EDIT: Once upon a time, I wrote a Java Program for making PCB’s. I loaded your SVG in it, no problem…

First, thank you so much for taking the time to break that down for me, it is so sincerely appreciated!

But, the simplest is to Start a new PCB in Kicad. It will save time and you’ll get what you want and what a PCB fab can make.

True, I wish it was that simple, I mainly work on the restoration of vintage audio equipment and some of the PCBs just strike me as somewhat troublesome to recreate in a PCB package as they were hand-drawn, and I mean hand-drawn not just hand transfers onto an assitate. And my customers are so particular about the aesthetics that I even have to hunt down old board stock to get a match.

But I think based on this experience of getting so much help, I will invest time to learn KiCad from the ground up!

I did Not cleanup the lines and they need cleaning. In fact, with so many, I’d start from scratch, if it were me doing the work…

Oh, I agree 100%, just looked at it and it is a mess, have restarted and am making it spotless clearing out all the lines and path and groups within groups!

Again thank you so much for the help, and for pointing me in the right direction.

Great!

FYI - One way to start fresh using Kicad and the PNG (from SVG, as previously indicated):

• Most all of your Dots are not at a Pitch in common use. Regardless (and you should figure out what Pitch to use) would be to “Trace” (as you indicated) over the existing Dots by placing a Custom Footprint of just a Pad, the size needed.

Example below shows a Simple one just made for this example. I set the grid to small value to enable placing somewhat close-enough for example, then, I drew Traces from Pad to Pad… and drew a rectangle around the entire area for the PCB shape.

That could/should give you some ideas

Learn how to make simple footprints… at least for a single pad…

Got frustratingly close using the Svg2Shenzhen plugin after redoing my SVG…just the holes totally in the wrong place and size. and the outline of the board being non-exsistant. :joy: :sob:

Imgur

Link to my SVG if anyone stubbles along and can tell me what on earth i’m doing wrong…

https://drive.google.com/file/d/1Y-sWxhK2YDlM3V1YVfoyNbmobm49jFJ8/view?usp=sharing

Ah, yes, the aesthetics of a PCB design…
Something like:

I guess these were hand drawn in negative, and then inverted photographically, or maybe black ink on plastic film and then the white lines scraped away.

These are somewhat similar to voronoi figures. Searching on Hackaday for voronoi gives at least two results related to PCB’s:

If you read the comments of those articles, then you find links to similar projects, such as:


Torsten Martinsen says:	
July 31, 2020 at 1:59 pm

How is this different to what pcb2gcode
(https://github.com/pcb2gcode/pcb2gcode) does when
passed the –voronoi option?

Yep, that’s exactly the sort of PCB that has got me reaching for the old phenolic clad, transfer paper, iron and ferric chloride too many times that I’m on the hunt for a digital way. thought Svg2Shenzhen plugin was going to solve all many issues…but after 4 days of trying and hunting down update documentation or guides, think it’s time to move on.

I’ll leave this topic with this:

If you know what you want it to look like (i.e., voronoi figures) and, you know where to attach them to others, then, you can do what I suggested (making pad and traces) then, for the voronoi’s, macaroni’s and spaghetti’s, you can make custom ‘Filled Zones’

Most folks here could have re-done the entire PCB in less than One Hour… and have professional looking board… If you (as a newbie to Kicad) did it from scratch, it might take a couple of hours - much less time than fussing around and you’d have learned enough Kicad to use it… And, could use the SVG/PNG as underlay for tracing, as shown…