footprints: svg convertsion tool for the logo (only Koncar works)

pull/3/head
Emard 6 years ago
parent 1c6326fdb6
commit b05863e534

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="678" height="728">
<clipPath id="c"><path d="m4,4v385a335,335 0 1,0 670,0V4"/></clipPath>
<path fill="#D61517" d="m1,1v388a338,338 0 1,0 676,0V1"/>
<g clip-path="url(#c)">
<path stroke="#FFF" stroke-width="144" stroke-dasharray="134"
d="m138,76h402m134,144H4m134,144h402m134,144H4m134,144h402"/>
</g></svg>

After

Width:  |  Height:  |  Size: 392 B

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="690"
height="114.20025"
id="svg2"
version="1.1"
inkscape:version="0.47 r22583"
sodipodi:docname="Novi dokument 1">
<defs
id="defs4">
<clipPath
id="clipPath2832"
clipPathUnits="userSpaceOnUse">
<path
id="path2834"
d="M 0,792 612,792 612,0 0,0 0,792 z" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.3391304"
inkscape:cx="345"
inkscape:cy="57.100124"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1024"
inkscape:window-height="749"
inkscape:window-x="-4"
inkscape:window-y="-4"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/3.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-312.14286,-626.69067)">
<g
transform="matrix(1.2369535,0,0,-1.2369535,277.43085,1172.9307)"
inkscape:label="Končar__tmp_20091117111419_0"
id="g2826">
<g
id="g2828">
<g
clip-path="url(#clipPath2832)"
id="g2830">
<g
transform="translate(28.0625,426.207)"
id="g2836">
<path
id="path2838"
style="fill:#264284;fill-opacity:1;fill-rule:evenodd;stroke:none"
d="m 0,0 28.706,0 0,-31.054 L 55.064,0 89.272,0 c -5.927,-6.328 -22.426,-24.004 -28.526,-31.051 -0.6,-0.869 -1.037,-1.578 -1.282,-2.094 -0.072,-0.159 -0.174,-0.382 -0.24,-0.637 l -0.138,-0.531 0.264,-0.476 c 0.219,-0.392 0.647,-0.994 1.249,-1.71 6.672,-8.239 26.028,-30.596 32.276,-37.802 l -34.948,0 -29.221,37.718 0,-37.718 L 0,-74.301 0,0 z" />
</g>
<g
transform="translate(276.2983,426.207)"
id="g2840">
<path
id="path2842"
style="fill:#264284;fill-opacity:1;fill-rule:evenodd;stroke:none"
d="m 0,0 28.155,0 0,-74.301 -34.81,0 c -2.441,3.627 -15.247,22.633 -22.812,33.235 l -2.489,3.486 0,-36.721 -28.155,0 0,74.301 35.268,0 c 2.45,-3.692 15.355,-23.16 22.312,-33.597 l 2.519,-3.773 -0.006,4.537 C -0.027,-22.986 -0.006,-5.07 0,0" />
</g>
<g
transform="translate(176.2593,388.8643)"
id="g2844">
<path
id="path2846"
style="fill:#264284;fill-opacity:1;fill-rule:evenodd;stroke:none"
d="m 0,0 c 0,11.068 -6.861,19.107 -14.31,19.107 -7.448,0 -14.306,-8.039 -14.306,-19.107 0,-11.069 6.858,-19.108 14.306,-19.108 C -6.861,-19.108 0,-11.069 0,0 m 32.668,0.248 c 0,-22.303 -21.449,-39.835 -47.169,-39.835 -25.724,0 -47.17,17.532 -47.17,39.835 0,22.303 21.446,39.835 47.17,39.835 25.72,0 47.169,-17.532 47.169,-39.835" />
</g>
<g
transform="translate(548.8076,394.7578)"
id="g2848">
<path
id="path2850"
style="fill:#264284;fill-opacity:1;fill-rule:evenodd;stroke:none"
d="M 0,0 C 3.004,-0.096 4.696,1.967 4.606,4.711 4.517,7.409 2.72,9.82 -0.614,9.82 l -13.684,0 0,-9.817 L 0,0 z m -14.298,-42.852 -28.763,0 0,74.301 49.769,0 c 0.558,0.024 3.648,0.108 7.439,-0.707 4.124,-0.886 9.351,-2.881 13.082,-7.412 C 33.453,15.78 33.21,9.997 31.806,3.498 31.15,0.479 30.105,-1.435 28.847,-2.894 28.239,-3.597 27.613,-4.16 27.059,-4.643 l -1.623,-1.398 1.215,-1.039 c 0.866,-0.74 1.588,-1.596 2.064,-2.265 0.86,-1.213 1.584,-2.575 2.223,-3.641 1.288,-2.154 1.988,-8.721 1.868,-13.995 -0.066,-2.738 0.74,-6.038 1.512,-8.575 0.788,-2.588 1.603,-4.543 1.627,-4.609 l 1.132,-2.687 -24.169,0 c -1.389,0 -2.438,0.028 -3.414,0.498 -0.92,0.446 -1.965,1.392 -2.977,3.687 -0.389,0.88 -0.704,2.219 -0.971,3.603 -0.275,1.422 -0.539,3.108 -0.79,4.831 -0.479,3.351 -0.904,6.839 -1.237,8.69 -0.392,2.159 -1.243,2.936 -2.291,3.367 -0.629,0.257 -1.429,0.422 -2.453,0.515 -1.069,0.098 -2.246,0.104 -3.507,0.104 l -7.745,0.019 -1.821,0.006 0,-25.32 z" />
</g>
<g
transform="translate(444.7471,385.3809)"
id="g2852">
<path
id="path2854"
style="fill:#264284;fill-opacity:1;fill-rule:evenodd;stroke:none"
d="M 0,0 9.889,0 5.025,12.953 0,0 z m 53.507,-33.475 -30.536,0 -4.508,11.962 -26.724,0 -4.711,-11.962 -29.377,0 30.228,74.301 34.37,0 31.258,-74.301 z" />
</g>
<g
transform="translate(343.6738,388.8643)"
id="g2856">
<path
id="path2858"
style="fill:#264284;fill-opacity:1;fill-rule:evenodd;stroke:none"
d="m 0,0 c 0,-10.836 7.554,-19.108 16.284,-19.108 5.969,0 10.746,2.911 12.351,8.843 l 0.386,1.435 31.492,-0.066 -0.177,-2.093 c -1.587,-18.688 -23.339,-28.598 -44.055,-28.598 -25.876,0 -47.472,17.524 -47.472,39.835 0,22.315 21.596,39.835 47.472,39.835 21.531,0 42.441,-10.638 44.546,-30.081 L 61.058,7.855 29.432,7.903 29.058,9.355 C 27.515,15.384 22.436,19.107 16.284,19.107 7.554,19.107 0,10.835 0,0" />
</g>
<g
transform="translate(365.1904,441.6011)"
id="g2860">
<path
id="path2862"
style="fill:#264284;fill-opacity:1;fill-rule:evenodd;stroke:none"
d="m 0,0 14.866,0 -7.262,-9.344 -24.79,0 L -27.179,0 -10.752,0 -5.286,-2.495 0,0 z" />
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.9 KiB

@ -0,0 +1,13 @@
# Logos
Use [SVG2MOD](https://github.com/mtl/svg2mod) to convert from SVG to kicad
footprint.
In short before conversion srawing layer in the SVG file has to be
renamed usually "Layer 1" to "Cu" or "SilkS" (case insensitive). Renaming can be
done from SVG editor like "Inkscape" but in most case, "sed" will work too.
At convertsion usually some floating point scale factor is needed to make
object of desired size e.g "-f 1.5"
It can help if file is opened and saved from inkscape.

@ -0,0 +1,28 @@
svg2mod=~/src/downloaded/svg2mod/svg2mod/svg2mod.py
tmp_koncar=/tmp/koncar.svg
out_koncar=../koncar.pretty/koncar.kicad_mod
# svg2mod won't convert it correctly
tmp_grb=/tmp/hrvatski_grb.svg
out_grb=/tmp/hrvatski_grb.kicad_mod
all: $(out_koncar)
$(tmp_koncar): Koncar_Logo.svg
sed -e "s/Layer 1/SilkS/g" $< > $@
$(out_koncar): $(tmp_koncar)
$(svg2mod) --front-only --name koncar --value koncar -f 0.09 -i $< -o $@
$(tmp_grb): Hrvatski_Grb.svg
sed -e "s/_201329768/SilkS/g" $< > $@
$(out_grb): $(tmp_grb)
$(svg2mod) --front-only --name hrvatski_grb --value hrvatski_grb -f 1.5 -i $< -o $@
clean:
rm -f $(tmp_koncar) $(tmp_grb)
rm -f $(out_koncar) $(out_grb)
rm -f *~
Loading…
Cancel
Save