You need to use EasyEDA editor to create some projects before publishing
SVG Image import does not work well
649 12
goyousalukis 3 years ago
I just wanted to post an issue I have. If I create a simple SVG box shape and insert it onto a PCB in the silkscreen layer, it behaves correctly. If I create a simple SVG Circle and insert it onto a PCB in the silkscreen layer, it imports it warped. Playing with the import controls do not seem to affect it. The more complex the SVG, the worse the import. Thanks! ![Screenshot from 2021-03-09 09-01-25.png](//image.easyeda.com/pullimage/d9x99ogiQEXUVcFcaFgdipszD8lL4YRg1tWMKczx.png)![Screenshot from 2021-03-09 09-02-52.png](//image.easyeda.com/pullimage/wcCLJ0ItNeONUdhGlJk2yPdeXwLOu5hZ4Fr9X629.png)
Comments
andyfierman 3 years ago
Please post a link to your svg files.
Reply
andreasbernhofer 3 years ago
Not sure why, but the stock SVG import is a mess - all shapes do get deformed, it simply cannot do a 1:1 import. Because I had the same problem, I've written an alternative SVG import: [https://github.com/xsrf/easyeda-svg-import](https://github.com/xsrf/easyeda-svg-import) It has some limitations though. It only works with SVG path objects. But you can usually convert all SVG shapes to paths with free tools like InkScape.
Reply
goyousalukis 3 years ago
Thanks Andreas! I will check it out.
Reply
goyousalukis 3 years ago
Andy, here is the text for a circle SVG that gets deformed. It was generated by inkscape. The circle is the only item in the file. <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg    xmlns:dc="[http://purl.org/dc/elements/1.1/](http://purl.org/dc/elements/1.1/)"    xmlns:cc="[http://creativecommons.org/ns#](http://creativecommons.org/ns#)"    xmlns:rdf="[http://www.w3.org/1999/02/22-rdf-syntax-ns#](http://www.w3.org/1999/02/22-rdf-syntax-ns#)"    xmlns:svg="[http://www.w3.org/2000/svg](http://www.w3.org/2000/svg)"    xmlns="[http://www.w3.org/2000/svg](http://www.w3.org/2000/svg)"    xmlns:sodipodi="[http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd](http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd)"    xmlns:inkscape="[http://www.inkscape.org/namespaces/inkscape](http://www.inkscape.org/namespaces/inkscape)"    width="210mm"    height="297mm"    viewBox="0 0 210 297"    version="1.1"    id="svg847"    inkscape:version="1.0.1 (0767f8302a, 2020-10-17)"    sodipodi:docname="Circle.svg">   <defs      id="defs841" />   <sodipodi:namedview      id="base"      pagecolor="#ffffff"      bordercolor="#666666"      borderopacity="1.0"      inkscape:pageopacity="0.0"      inkscape:pageshadow="2"      inkscape:zoom="3.9558719"      inkscape:cx="157.8459"      inkscape:cy="193.61669"      inkscape:document-units="mm"      inkscape:current-layer="layer1"      inkscape:document-rotation="0"      showgrid="false"      showborder="false"      inkscape:window-width="1848"      inkscape:window-height="1016"      inkscape:window-x="72"      inkscape:window-y="27"      inkscape:window-maximized="1" />   <metadata      id="metadata844">     \<rdf:RDF>       <cc:Work          rdf:about="">         \<dc:format>image/svg+xml</dc:format>         <dc:type            rdf:resource="[http://purl.org/dc/dcmitype/StillImage](http://purl.org/dc/dcmitype/StillImage)" />         \<dc:title></dc:title>       </cc:Work>     </rdf:RDF>   \</metadata>   <g      inkscape:label="Layer 1"      inkscape:groupmode="layer"      id="layer1"      style="opacity:1">     <circle        style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.87"        id="path2098"        cx="36.480904"        cy="46.756149"        r="10.31771" />   \</g> \</svg>
Reply
goyousalukis 3 years ago
Hmm, I guess the forum code is messing with the SVG. `<?xml version="1.0" encoding="UTF-8" standalone="no"?>` `<svg` `   xmlns:dc="`[`http://purl.org/dc/elements/1.1/`](http://purl.org/dc/elements/1.1/)`"` `   xmlns:cc="`[`http://creativecommons.org/ns#`](http://creativecommons.org/ns#)`"` `   xmlns:rdf="`[`http://www.w3.org/1999/02/22-rdf-syntax-ns#`](http://www.w3.org/1999/02/22-rdf-syntax-ns#)`"` `   xmlns:svg="`[`http://www.w3.org/2000/svg`](http://www.w3.org/2000/svg)`"` `   xmlns="`[`http://www.w3.org/2000/svg`](http://www.w3.org/2000/svg)`"` `   xmlns:sodipodi="`[`http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd`](http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd)`"` `   xmlns:inkscape="`[`http://www.inkscape.org/namespaces/inkscape`](http://www.inkscape.org/namespaces/inkscape)`"` `   width="210mm"` `   height="297mm"` `   viewBox="0 0 210 297"` `   version="1.1"` `   id="svg847"` `   inkscape:version="1.0.1 (0767f8302a, 2020-10-17)"` `   sodipodi:docname="Box.svg">` `  <defs` `     id="defs841" />` `  <sodipodi:namedview` `     id="base"` `     pagecolor="#ffffff"` `     bordercolor="#666666"` `     borderopacity="1.0"` `     inkscape:pageopacity="0.0"` `     inkscape:pageshadow="2"` `     inkscape:zoom="3.9558719"` `     inkscape:cx="157.8459"` `     inkscape:cy="193.61669"` `     inkscape:document-units="mm"` `     inkscape:current-layer="layer1"` `     inkscape:document-rotation="0"` `     showgrid="false"` `     showborder="false"` `     inkscape:window-width="1848"` `     inkscape:window-height="1016"` `     inkscape:window-x="72"` `     inkscape:window-y="27"` `     inkscape:window-maximized="1" />` `  <metadata` `     id="metadata844">` `    <rdf:RDF>` `      <cc:Work` `         rdf:about="">` `        <dc:format>image/svg+xml</dc:format>` `        <dc:type` `           rdf:resource="`[`http://purl.org/dc/dcmitype/StillImage`](http://purl.org/dc/dcmitype/StillImage)`" />` `        <dc:title></dc:title>` `      </cc:Work>` `    </rdf:RDF>` `  </metadata>` `  <g` `     inkscape:label="Layer 1"` `     inkscape:groupmode="layer"` `     id="layer1"` `     style="opacity:1">` `    <circle` `       style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.87"` `       id="path2098"` `       cx="36.480904"` `       cy="46.756149"` `       r="10.31771" />` `  </g>` `</svg>`
Reply
andyfierman 3 years ago
@goyousalukis, You might get a faster response from support if you change the Category of this topic to Bug Report. **_;-)_**
Reply
andreasbernhofer 3 years ago
There already is a Bug Report addressing this ;) [https://easyeda.com/forum/topic/SVG-Import-performs-really-bad-1eccada397514ed48b2567028f517ab6](https://easyeda.com/forum/topic/SVG-Import-performs-really-bad-1eccada397514ed48b2567028f517ab6) @goyousalukis to post code, switch to markdown and use the three backticks syntax
Reply
goyousalukis 3 years ago
Thanks Andreas, I did use the quotes on the second post and the SVG markup posted correctly. I have had some success with your extension, but I am finding that some files are not importing even after converting to paths. I'll try to find an example. Thanks for sharing your extension!
Reply
andreasbernhofer 3 years ago
Hope it may help you ;) Feel free to open an issue on github if you find an example that doesn't work.
Reply
goyousalukis 3 years ago
Thanks - I added an issue on github with a couple of screenshots.
Reply
goyousalukis 3 years ago
Andreas, One tip that might serve users of your plugin. One tactic is to create your complex SVG in Inkscape. Then export it as a PNG and open it in a new inkscape session. Then do a bitmap trace of the PNG. This creates vectors on the inside and outside of a circle for example, so it will import perfectly with your plugin. I think this workflow might be better than converting everything from an object to a path to a stroke. Just an idea!
Reply
andreasbernhofer 3 years ago
@goyousalukis Thx for that. I'm little worried that exporting as bitmap and tracing it again may wash out some details (not as bad as the stock EasyEDA import does, but a little). I'm sure there are options in Inkscape to do kind of the same complexity reduction (basically merge all overlapping paths to one). There are options for union and simplify. But as said, I'm not really an expert in Inkscape. I will add the examples from your last issue to the readme and I may also add this "hack" for those who are really desperate ;)
Reply
Login or Register to add a comment
goToTop
你现在访问的是EasyEDA海外版,建议访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus-@1x -mockplus-

Cookie Notice

Our website uses essential cookies to help us ensure that it is working as expected, and uses optional analytics cookies to offer you a better browsing experience. To find out more, read our Cookie Notice