Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with SVG image containing hollow cutouts #11

Closed
plut0nium opened this issue Feb 16, 2021 · 2 comments
Closed

Problem with SVG image containing hollow cutouts #11

plut0nium opened this issue Feb 16, 2021 · 2 comments

Comments

@plut0nium
Copy link

I am trying to use svg-flatten to convert SVG images to kicad footprints (silkscreen graphics).
My drawings contain multiple closed shapes with cutouts but these are rendered as plain filled areas, here are original image from inkscape and result in kicad:
original_image
kicad_result

Am I missing something or do I need specific preparation of the SVG file ?

The command line I use is:
svg-flatten --format kicad --sexp-layer F.SilkS --sexp-mod-name tentacles_02 tentacles2.svg ../pcb/drawings.pretty/tentacles_02.kicad_mod

Thank you very much 😀

@plut0nium plut0nium changed the title Problem with SVG image containing cutouts Problem with SVG image containing hollow cutouts Feb 16, 2021
@neinseg
Copy link
Collaborator

neinseg commented Feb 17, 2021

Thank you for the report! Would you mind sharing the input SVG file with me at github@jaseg.de? This should work, so chances are you've found a bug.

@neinseg
Copy link
Collaborator

neinseg commented Feb 17, 2021

Thank you for the test file. I have had a look and your problem should be fixed in v2.0.6, now on the main branch and on pypi.

The underlying issue was that your SVG for some reason contained only open paths and no closed paths at all. In SVG, an open path is one whose two ends are not connected, like the shape of the letter "C" vs. "O". In SVG, filling open subpaths like that is still well-defined behavior (spec) even though here it likely is not what you want since when setting a stroke, things will look weird around the spot where the two ends of the path are.

Gerbolyze now handles this case according to spec and the resulting kicad_mod looks as you would expect. Please check it out, and feel free to re-open this issue or to open another issue should it not work as expected.

@neinseg neinseg closed this as completed Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants