https://github.com/wideopensource/picad
Python package for reading and writing KiCad 6+ S-expression files, no dependency on KiCad. pip install picad.
https://github.com/wideopensource/picad
kicad pip python s-expression
Last synced: 10 days ago
JSON representation
Python package for reading and writing KiCad 6+ S-expression files, no dependency on KiCad. pip install picad.
- Host: GitHub
- URL: https://github.com/wideopensource/picad
- Owner: wideopensource
- Created: 2023-03-22T11:31:13.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-27T16:23:18.000Z (about 3 years ago)
- Last Synced: 2025-09-29T01:17:39.294Z (9 months ago)
- Topics: kicad, pip, python, s-expression
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PiCad
## Installation
pip install picad
## Usage
This example finds small breaks in the board outline and joins them at their midpoint.
```
from picad import Layout
def fix_edge_cuts(layout:Layout, max_distance:float=1.0):
points = sum([x.end_points for x in board_layout.get_all_lines(layer_name="Edge.Cuts")], ())
for p in points:
closest_p = min([x for x in points if 0 != p.distance_from(x)], key=lambda a: p.distance_from(a))
if closest_p.distance_from(p) < max_distance:
p.lerp(closest_p, 0.5)
closest_p.move_to(p)
```