Files

copied
Last update 5 years 7 months by Noelia Scotti
FilesPCBFSLkicad_scripts
..
3dkicad2freecad.pl
MK60FX512VLQ15.csv
bom_opt.pl
borra_valores_pcb.sh
genlib.sh
leeme.txt
replacesimbolfiled.sh
3dkicad2freecad.pl
#!/usr/bin/perl ############################################################################## # # Copyright (c) 2014 David M. Caruso <daviud en inti gov ar> # Copyright (c) 2014 Instituto Nacional de TecnologĂ­a Industrial # ############################################################################## # # Target: Any # Language: Perl # Interpreter used: v5.6.1/v5.8.4 # Text editor: SETEdit 0.5.5 # ############################################################################## # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA # ############################################################################## # # Description: Convert 3D kicad to use in Freecad # ############################################################################## use Getopt::Long; use Locale::TextDomain('kicad_tools'); $version='1.0.0'; ParseCommandLine(); open(F,"CIAA_K60.wrl") || die "Can't open CIAA_K60.wrl"; open(S,">CIAA_K60_out.wrl") || die "Can't create CIAA_K60_out.wrl"; while ($line=<F>) { if ($line=~/Inline/) # No Contiene la palabra Inline { $line=<F>; # lee la siguiente linea $line=~s/url//g; # saca la palabra url $line=~s/\"//g; # saca las " $comp_wrl=$line; #ruta del archivo @name_split=split('/',$comp_wrl); $comp_wrl=$name_split[$#name_split]; $comp_wrl="footprints/packages3d/"."$comp_wrl"; $text_wrl=`cat $comp_wrl`; print S $text_wrl; $line=<F>; # lee la siguiente linea $line=~s/\}//g; } print S $line; } close S; close F; #----------------------------------------------------------------------------- # ParseCommandLine: # Parser #----------------------------------------------------------------------------- sub ParseCommandLine { GetOptions("verbose|v=i" => \$verbosity, "version" => \$showVersion, "input=s" => \$filein, "dir=s" => \$outdir, "output=s" => \$fileout, "help|?" => \$help) or ShowHelp(); if ($showVersion) { print "3dkicad2freecad.pl (kicad_tools) $version\n". "Copyright (c) 2014 David M. Caruso/INTI\n". "License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>\n". __("This is free software: you are free to change and redistribute it.\n". "There is NO WARRANTY, to the extent permitted by law.\n\n"). __("Written by")." David M. Caruso.\n"; exit(0); } print "3D Kicad to Freecad (VRML) v$version Copyright (c) 2014 David M. Caruso/INTI\n"; ShowHelp() if $help; unless($filein) { print "You must specify an input file name.\n"; ShowHelp(); } unless($fileout) { $fileout="out-$filein"; } if ($outdir && !(-e "$outdir")) { system "mkdir $outdir"; } unless ($outdir) { $outdir='.'; # Si no se especifica el directorio, asigna el actual } } sub ShowHelp { print __"Usage: 3dkicad2freecad.pl [options]\n"; print __"\nAvailable options:\n"; print __"--version Outputs version information and exit.\n"; print __"--input=name Input VRML File Generated by Kicad\n"; print __"--dir=name Output Directory, Default=Current\n"; print __"--output=name Output VRML File, Default=out<IN FILE>\n"; print __"--help Prints this text.\n\n"; exit 1; }
Report a bug