BlinkenArea - GitList
Repositories
Blog
Wiki
partlib
Code
Commits
Branches
Tags
Search
Tree:
8a9acb1
Branches
Tags
master
stefan.experimental
partlib
pcb_footpr_conv
fp2dxf.py
PCB element Python types
Stefan Schuermans
commited
8a9acb1
at 2021-02-17 19:13:39
fp2dxf.py
Blame
History
Raw
#! /usr/bin/env python3 import pcb_parser import pcb_types import ezdxf import sys def read_footprint(file_name: str) -> pcb_types.Element: with open(file_name, 'r') as f: s = f.read() parser = pcb_parser.PcbFootprintParser(s) element = parser.parseElementBlock() return element def write_dxf(file_name: str): doc = ezdxf.new('R12') msp = doc.modelspace() msp.add_circle((1, 2), radius=3) doc.saveas(file_name) def main(): fp = read_footprint(sys.argv[1]) print(fp) if __name__ == '__main__': main()