2

Background

I've designed a circuit board using Kicad and would like to put a texture onto all unused copper areas, simply for aesthetics. So, instead of flooding the unused areas with a solid "copper pour" as usual I want to put a regular pattern on it.

In its newer versions (I'm using version 6) Kicad has the feature to import SVG files into a copper polygon as well as exporting copper planes as SVG files.

So in theory I should be able to use external software to process the SVG files to get the desired result. I just have trouble importing the result in Kicad. It seems its SVG importer isn't very sophisticated and only handles primitive graphics.

Input files

I have two SVG files, both exported from Kicad:

  1. mask.svg - the outline of the "unused areas". This file can only be exported from Kicad as it's the result of a specific algorithm which uses strict electrical rules like clearance to traces etc. This file looks like this:

enter image description here

  1. texture.svg - this file contains the regular pattern. It was also created in Kicad and in contrast to the first graphic consists of only lines (not polygons). It looks like this:

enter image description here

Expected Result

I want to subtract the texture.svg from the mask.svg so I get a result like this:

enter image description here

I achieved this by loading both files into Inkscape and after selecting both images I called Object > Mask > set inverted mask. I hope the translation is clear, I'm using the German version of Inkscape.

Problem

When I export the result as "plain SVG" and import it in Kicad, the imported graphic looks the same like the initial mask.svg. I don't know much about the SVG file format, but I assume the resulting file consists of several objects according to the SVG standard which is just too complex for the rudimentary SVG importer that Kicad has.

I guess if I could get Inkscape to compile the result into a single polygon/object the issue would be solved. Another thing I tried after searching on the internet was to use the combine function on the SVGs, but that changed the thickness of the lines in texture.svg.

So, does anyone have an idea how I can subtract two SVG files in such a way that I get a simple enough output so the Kicad importer can understand it?

2
  • Try saving as Optimised SVG. Inkscape SVG's contain additional XML which only Inkscape understands, and which may confuse other software.
    – Billy Kerr
    Jun 28, 2023 at 7:49
  • 1
    BTW, it's very easy to change the interface language in Inkscape - Edit > Preferences, then click on Interface, and change the language, then restart Inkscape.
    – Billy Kerr
    Jun 28, 2023 at 7:57

1 Answer 1

3

Only guesses because a proper tested answer is possible only after having the problematic files or at least knowing details of their structures.

A guess:

Error 1: Your pattern has only open paths. Only a closed path can actually be subtracted from another path. The other path must also be a closed path. Both of them can be combined paths, but they must be made of closed paths. No groups, not even a single one!

Error 2: Masking subtracts nothing. It makes areas only invisible. The invisibility affects only rendering for the screen, all shapes are still there. Your CAD program may be unable to interpret Inkscape's masking.

Try to convert your pattern of crosses to paths in Inkscape and combine them. use Path > Stroke to Path and Path > Combine. Subtract with Path > Difference. It's well possible that you must rebuild the whole pattern in Inkscape if there's something more tricky than only separated crossing lines. Making a combined path generates easily holes to the overlapping closed paths. That depends on path directions and path filling rules.

This all is useless if your SVGs contain something tricky like symbols or clones which need to be disassembled at first. Or there's something which is proprietary and works only in your CAD program.

1
  • 1
    Thanks, looking at my files after your explanation I got the point. The problem was that the subtract operation required two single paths. After converting the lines to outline paths and combining those I managed to get it to work.
    – Sim Son
    Jun 28, 2023 at 1:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.