From b05863e534500dc3555b0bf059c1870be253f974 Mon Sep 17 00:00:00 2001 From: Emard Date: Fri, 6 Jul 2018 09:53:36 +0200 Subject: [PATCH] footprints: svg convertsion tool for the logo (only Koncar works) --- footprints/logo/svg/Hrvatski_Grb_orig.svg | 8 ++ footprints/logo/svg/Koncar_Logo.svg | 149 ++++++++++++++++++++++ footprints/logo/svg/README.md | 13 ++ footprints/logo/svg/makefile | 28 ++++ 4 files changed, 198 insertions(+) create mode 100644 footprints/logo/svg/Hrvatski_Grb_orig.svg create mode 100644 footprints/logo/svg/Koncar_Logo.svg create mode 100644 footprints/logo/svg/README.md create mode 100644 footprints/logo/svg/makefile diff --git a/footprints/logo/svg/Hrvatski_Grb_orig.svg b/footprints/logo/svg/Hrvatski_Grb_orig.svg new file mode 100644 index 0000000..4430f64 --- /dev/null +++ b/footprints/logo/svg/Hrvatski_Grb_orig.svg @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file diff --git a/footprints/logo/svg/Koncar_Logo.svg b/footprints/logo/svg/Koncar_Logo.svg new file mode 100644 index 0000000..99f5439 --- /dev/null +++ b/footprints/logo/svg/Koncar_Logo.svg @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/footprints/logo/svg/README.md b/footprints/logo/svg/README.md new file mode 100644 index 0000000..52ed3c6 --- /dev/null +++ b/footprints/logo/svg/README.md @@ -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. diff --git a/footprints/logo/svg/makefile b/footprints/logo/svg/makefile new file mode 100644 index 0000000..de845dd --- /dev/null +++ b/footprints/logo/svg/makefile @@ -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 *~ +