Skip to content

mignon-p/footprint-to-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage: footprint-to-script [-x FLOAT] [-y FLOAT] [-r DEGREES]
                           INPUTFILE.kicad_mod OUTPUTFILE.py

Available options:
  -h,--help                Show this help text
  -v,--version             Print version
  -x FLOAT                 Amount to translate in X (default 0)
  -y FLOAT                 Amount to translate in Y (default 0)
  -r DEGREES               Clockwise rotation around origin, after applying
                           translation. Must be 0, 90, 180, or 270. (default 0)

footprint-to-script takes a KiCad footprint (a .kicad_mod file), and produces a Python script which, when run, will generate that footprint.

For each unique x or y coordinate, the Python script contains a variable for that coordinate. This makes it easier to move things around by changing the values of the variables.

To run, the Python script requires the KicadModTree library.

Apologies for the long line length; this is a known limitation of language-python.

Binary releases

Binaries are available for Linux, Mac OS X, and Windows.

Building from source (with stack)

Install stack and then do:

git clone --recursive https://github.com/ppelleti/footprint-to-script.git
cd footprint-to-script
stack --install-ghc install

The binary will be installed in ~/.local/bin.

Building from source (with cabal)

Install the Haskell Platform and then do:

git clone --recursive https://github.com/ppelleti/footprint-to-script.git
cd footprint-to-script/footprint-to-script
cabal sandbox init
cabal sandbox add-source ../kicad-data
cabal install

The binary will be installed in ~/.cabal/bin.

License

footprint-to-script and most of its dependencies are licensed under the 3-clause BSD license. However, one dependency is GPL licensed. Therefore, the GPL applies to the program as a whole.