Added logos and fancy silkscreen
This commit is contained in:
parent
71955f010a
commit
231553725b
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ $# != 3 ]]; then
|
||||
echo "Usage : $0 infile layer size"
|
||||
echo "Example : $0 foo.mod 21 13.00mm"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
infile="$1"
|
||||
layer="$2"
|
||||
size="$3"
|
||||
ssize="$(echo $size | sed 's/\./_/')"
|
||||
|
||||
case "$layer" in
|
||||
15)
|
||||
layername="cutop";;
|
||||
0)
|
||||
layername="cubot";;
|
||||
21)
|
||||
layername="silktop";;
|
||||
20)
|
||||
layername="silkbot";;
|
||||
*)
|
||||
echo "Unknown layer number $layer"
|
||||
esac
|
||||
|
||||
name=${infile%.*}
|
||||
outfile="${name}_${layername}_${ssize}.mod"
|
||||
outname="${name}_${layername}_${ssize}"
|
||||
|
||||
echo "Scaling $infile in layer $layer to $size"
|
||||
./scale.pl "$infile" "$outfile" "$layer" "$size"
|
||||
cat "$outfile" | sed "s/LOGO/$outname/g" | sponge "$outfile"
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
#!/usr/bin/perl -W
|
||||
|
||||
use feature qw(state);
|
||||
|
||||
sub usage();
|
||||
|
||||
if(scalar(@ARGV) < 4) {
|
||||
usage();
|
||||
}
|
||||
|
||||
my $outfile = $ARGV[1];
|
||||
my $size = $ARGV[3]; # in 'mm' or in 'in'
|
||||
my $factor;
|
||||
my $calibration;
|
||||
my $layer = $ARGV[2];
|
||||
|
||||
open(FILE, '<', $ARGV[0]) || die("cannot open: $!");
|
||||
my @infiledata = <FILE>;
|
||||
close(FILE);
|
||||
|
||||
foreach $line (@infiledata) {
|
||||
my $tmp = $line;
|
||||
state $xmin = 0; # same as 'static xmin = 0;' in C
|
||||
state $xmax = 0;
|
||||
state $ymin = 0;
|
||||
state $ymax = 0;
|
||||
if($tmp =~ m/^(.*Dl)\ (.*)\ (.*)$/) {
|
||||
if($2 <= $xmin) {
|
||||
$xmin = $2;
|
||||
}
|
||||
if($2 >= $xmax) {
|
||||
$xmax = $2;
|
||||
}
|
||||
if($3 <= $ymin) {
|
||||
$ymin = $3;
|
||||
}
|
||||
if($3 >= $ymax) {
|
||||
$ymax = $3;
|
||||
}
|
||||
}
|
||||
if( ($xmax - $xmin) > ($ymax - $ymin) ) {
|
||||
$calibration = ($xmax - $xmin);
|
||||
} else {
|
||||
$calibration = ($ymax - $ymin);
|
||||
}
|
||||
#print $xmin," - ",$xmax," - ",$ymin," - ",$ymax,"\n";
|
||||
#print $calibration;
|
||||
}
|
||||
|
||||
if($size =~ m/^\d{1,3}\.\d{1,3}in$/) {
|
||||
$size =~ s/in//;
|
||||
$factor = 10000/$calibration*$size; # currently all KiCad native units are in 1/10000 in
|
||||
} elsif($size =~ m/^\d{1,3}\.\d{1,3}mm$/) {
|
||||
$size =~ s/mm//;
|
||||
$factor = 10000/$calibration/25.4*$size;
|
||||
} else {
|
||||
usage();
|
||||
}
|
||||
|
||||
open(FILE,'>',$outfile) || die("cannot open: $!");
|
||||
foreach $line (@infiledata) {
|
||||
my $tmp = $line;
|
||||
if($tmp =~ m/^(.*Dl)\ (.*)\ (.*)$/) {
|
||||
if( ($layer == 21) || ($layer == 15) ) { # top silkscreen or top copper
|
||||
print FILE $1," ",int($2*$factor)," ",int($3*$factor),"\n";
|
||||
} elsif ( ($layer == 20) || ($layer == 0) ) { # bottom silkscreen or bottom copper - needs horizontal mirroring
|
||||
print FILE $1," ",int((-1)*$2*$factor)," ",int($3*$factor),"\n";
|
||||
}
|
||||
} elsif($tmp =~ m/^T(\d{1})\ 0\ (-{0,1}\d*)\ (-{0,1}\d*)\ (-{0,1}\d*)\ (-{0,1}\d*)\ (-{0,1}\d*)\ ([A-Z]{1})\ ([A-Z]{1})\ (-{0,1}\d*)\ (\".*\")$/) {
|
||||
# always print module text on top-silkscreen (layer 21)
|
||||
# printing it on the bottom silkscreen seems to confuse KiCad
|
||||
# and things go haywire (text always appers on 'top'-whatever
|
||||
# when graphics are on 'bottom'-whatever and vice versa).
|
||||
print FILE "T$1 0 ",int($2*$factor)," ",int($3*$factor)," ",int($4*$factor)," ",int($5*$factor)," ",int($6*$factor)," ",$7," ",$8," 21 N ",$10,"\n";
|
||||
} elsif($tmp =~ m/^(.*DP)\ (-{0,1}\d*)\ (-{0,1}\d*)\ (-{0,1}\d*)\ (-{0,1}\d*)\ (-{0,1}\d*)\ (-{0,1}\d*)\ (-{0,1}\d*)(.*)$/) {
|
||||
if( ($layer == 0) || ($layer == 15) ) { # on top/bottom copper layer - always print on top-copper to avoid crap. see above
|
||||
print FILE "$1 $2 $3 $4 $5 $6 $7 15\n";
|
||||
} elsif ( ($layer == 20) || ($layer == 21) ) { # on top/bottom silk - always print on top-silk to avoid crap. see above
|
||||
print FILE "$1 $2 $3 $4 $5 $6 $7 21\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
print FILE $line;
|
||||
}
|
||||
}
|
||||
close(FILE);
|
||||
|
||||
sub usage() {
|
||||
print "\nusage: scale.pl <infile.emp> <outfile.emp> <layer number> <size: e.g. 5.00mm or 0.25in>\n\n";
|
||||
print "The module will be scaled so that its largest dimension (x or y) matches <size>\n\n";
|
||||
print "KiCad layers:\n";
|
||||
print "-------------\n\n";
|
||||
print "Top copper: 15\n";
|
||||
print "Bottom copper: 0 (*)\n";
|
||||
print "Top silkscreen: 21\n";
|
||||
print "Bottom silkscreen: 20 (*)\n\n";
|
||||
print "(*) To move the mirrored logo to bottom copper/silkscreen\n";
|
||||
print " move the curser over it and press 'F' for flip layer.\n\n";
|
||||
print " The layer-swap is not done in this script as KiCad\n";
|
||||
print " gets confused and prints stuff on wrong layers.\n\n";
|
||||
exit;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
update=Tue 02 Dec 2014 11:29:43 PM CET
|
||||
update=Thu 04 Dec 2014 08:34:12 PM CET
|
||||
version=1
|
||||
last_client=eeschema
|
||||
last_client=pcbnew
|
||||
[general]
|
||||
version=1
|
||||
[cvpcb]
|
||||
|
@ -8,47 +8,6 @@ version=1
|
|||
NetIExt=net
|
||||
[cvpcb/libraries]
|
||||
EquName1=devcms
|
||||
[pcbnew]
|
||||
version=1
|
||||
LastNetListRead=esp8266_breakout.net
|
||||
UseCmpFile=1
|
||||
PadDrill=" 3.048000"
|
||||
PadDrillOvalY=" 3.048000"
|
||||
PadSizeH=" 4.064000"
|
||||
PadSizeV=" 4.064000"
|
||||
PcbTextSizeV=" 1.500000"
|
||||
PcbTextSizeH=" 1.500000"
|
||||
PcbTextThickness=" 0.300000"
|
||||
ModuleTextSizeV=" 1.000000"
|
||||
ModuleTextSizeH=" 1.000000"
|
||||
ModuleTextSizeThickness=" 0.150000"
|
||||
SolderMaskClearance=" 0.100000"
|
||||
SolderMaskMinWidth=" 0.200000"
|
||||
DrawSegmentWidth=" 0.200000"
|
||||
BoardOutlineThickness=" 0.100000"
|
||||
ModuleOutlineThickness=" 0.150000"
|
||||
[pcbnew/libraries]
|
||||
LibDir=libs
|
||||
LibName1=sockets
|
||||
LibName2=connect
|
||||
LibName3=discret
|
||||
LibName4=pin_array
|
||||
LibName5=divers
|
||||
LibName6=smd_capacitors
|
||||
LibName7=smd_resistors
|
||||
LibName8=smd_crystal&oscillator
|
||||
LibName9=smd_dil
|
||||
LibName10=smd_transistors
|
||||
LibName11=libcms
|
||||
LibName12=display
|
||||
LibName13=led
|
||||
LibName14=dip_sockets
|
||||
LibName15=pga_sockets
|
||||
LibName16=valves
|
||||
LibName17=limpkins_lib
|
||||
LibName18=logo_hacker_cutop_10_0mm
|
||||
LibName19=smisitoto_eu/w_smd_trans
|
||||
LibName20=smisitoto_eu/w_conn_rf
|
||||
[eeschema]
|
||||
version=1
|
||||
LibDir=libs
|
||||
|
@ -89,3 +48,45 @@ LibName28=atmel
|
|||
LibName29=contrib
|
||||
LibName30=valves
|
||||
LibName31=limpkins_lib
|
||||
[pcbnew]
|
||||
version=1
|
||||
LastNetListRead=esp8266_breakout.net
|
||||
UseCmpFile=1
|
||||
PadDrill=" 3.048000"
|
||||
PadDrillOvalY=" 3.048000"
|
||||
PadSizeH=" 4.064000"
|
||||
PadSizeV=" 4.064000"
|
||||
PcbTextSizeV=" 0.750000"
|
||||
PcbTextSizeH=" 0.750000"
|
||||
PcbTextThickness=" 0.300000"
|
||||
ModuleTextSizeV=" 0.750000"
|
||||
ModuleTextSizeH=" 0.750000"
|
||||
ModuleTextSizeThickness=" 0.200000"
|
||||
SolderMaskClearance=" 0.100000"
|
||||
SolderMaskMinWidth=" 0.200000"
|
||||
DrawSegmentWidth=" 0.200000"
|
||||
BoardOutlineThickness=" 0.100000"
|
||||
ModuleOutlineThickness=" 0.150000"
|
||||
[pcbnew/libraries]
|
||||
LibDir=libs
|
||||
LibName1=sockets
|
||||
LibName2=connect
|
||||
LibName3=discret
|
||||
LibName4=pin_array
|
||||
LibName5=divers
|
||||
LibName6=smd_capacitors
|
||||
LibName7=smd_resistors
|
||||
LibName8=smd_crystal&oscillator
|
||||
LibName9=smd_dil
|
||||
LibName10=smd_transistors
|
||||
LibName11=libcms
|
||||
LibName12=display
|
||||
LibName13=led
|
||||
LibName14=dip_sockets
|
||||
LibName15=pga_sockets
|
||||
LibName16=valves
|
||||
LibName17=limpkins_lib
|
||||
LibName18=smisitoto_eu/w_smd_trans
|
||||
LibName19=smisitoto_eu/w_conn_rf
|
||||
LibName20=chaosinkl_silkbot_25_00mm
|
||||
LibName21=logo_hacker_silkbot_15_00mm
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue