Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 5.05 KB

README.md

File metadata and controls

65 lines (46 loc) · 5.05 KB

Tools

  • layout2image.py - generate KLE style SVG image from keyboard layout
  • layout2schematic.py - generate KiCad schematic file from keyboard layout
  • layout2url.py - generate KLE url
  • layout2openscad.py - generate plate for openscad (:warning: experimental)

How to run

The kbplacer project uses pyprojet.toml with hatch project manager. It defines tools environment with required dependencies and scripts. To execute, run:

$ hatch run tools:layout2image {args...}
$ hatch run tools:layout2schematic {args...}
$ hatch run tools:layout2url {args...}
$ hatch run tools:layout2openscad {args...}

Alternatively, install required dependencies and run as regular python script:

python tools/layout2image.py {args...}
python tools/layout2schematic.py {args...}
python tools/layout2url.py {args...}
python tools/layout2openscad.py {args...}

Examples

To generate schematic file and schematic image based on layout file:

hatch run tools:layout2schematic -in examples/2x2/via.json -out 2x2.kicad_sch
kicad-cli sch export svg -e 2x2.kicad_sch

2x2-svg (cropped for readability)

To generate layout image based on layout file:

hatch run tools:layout2image -in tests/data/ergogen-layouts/absolem-simple-points.yaml \
  -out absolem.svg

absolem-svg

As you can see, there are slight rotation issues on this generated image. This is the problem with SVG generation code because layout imported to KLE looks ok:

absolem-png

To generate KLE url for run:

hatch run tools:layout2url -in tests/data/ergogen-layouts/absolem-simple-points.yaml

This will produce following link.

To convert ergogen layouts to KLE see layout and format conversion script