https://github.com/bgamari/kicad-hs
Library and tools for working with Kicad designs
https://github.com/bgamari/kicad-hs
kicad
Last synced: about 1 year ago
JSON representation
Library and tools for working with Kicad designs
- Host: GitHub
- URL: https://github.com/bgamari/kicad-hs
- Owner: bgamari
- License: bsd-3-clause
- Created: 2018-10-06T17:10:48.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-07-09T01:13:45.000Z (about 1 year ago)
- Last Synced: 2025-07-19T22:25:40.384Z (about 1 year ago)
- Topics: kicad
- Language: Haskell
- Size: 41 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.mkd
- License: LICENSE
Awesome Lists containing this project
README
# kicad-hs
This is a Haskell library for reading and writing Kicad design files (currently
only `.kicad_pcb` files). It also includes a handy utility for replicating parts
of a layout.
## Installation
Install a [Haskell](https://www.haskell.org/) toolchain.
```bash
$ git clone https://github.com/bgamari/kicad-hs
$ cd kicad-hs
$ cabal install
```
## Using kicad-replicate
The `kicad-replicate` utility provides a convenient way to reuse a part of a
layout across multiple sub-schematics of a hierarchical design.
The utility takes a few inputs
* a [YAML](http://yaml.org/) configuration file (`kicad-replicate.yaml`) which
defines the regions to clone
* a netlist file (`.net`) used to determine component names
* the Kicad PCB design file (`.kicad_pcb`)
The configuration file looks something like,
```yaml
pcb-file: my-design.kicad_pcb
netlist-file: my-design.net
units:
- template: /top/gated-integ-unit-b/integ2/
trace-regions:
- [[248, 87.0], [297, 106.5]]
- [[248, 107.0], [297, 126.5]]
clones:
- sheet: /top/gated-integ-unit-b/integ1/
offset: [0, -20]
- sheet: /top/gated-integ-unit-a/integ1/
offset: [0, 41.5]
- sheet: /top/gated-integ-unit-a/integ2/
offset: [0, 61.5]
```
This configures `kicad-replicate` to create clones of the components in the
`/top/gated-integ-unit-b/integ2/` subschematic, changing their reference
designators to reflect those of the subschematics given in the `clones` section.
Each clone is translated by the amount given in the `clones.offset` field.
Moreover, the optional `trace-regions` section specifies a region of traces to
be replicated.