vygr / python-pcb Goto Github PK
View Code? Open in Web Editor NEWPython PCB autorouter
License: GNU General Public License v2.0
Python PCB autorouter
License: GNU General Public License v2.0
Python-PCB ========== Python PCB router and viewer. There are two viewer apps, view.py requires aggDraw module to be installed, view_mpl.py requires matplotlib module to be installed. The matplotlib viwer is much more heavyweight than the former. Example command line would be: pypy pcb.py --v 1 netlist.pcb | python view.py You can drop the output to a file and view it as an animation with: pypy pcb.py --v 1 netlist.pcb > anim python view.py anim -h or --help for help on either app. Format of .pcb input file or stdin is: [width, height, depth] [track_radius, via_radius, gap_width, [(terminal_radius, terminal_gap, (x, y, z), [(x, y), ...]), ...]...] You can stop a netlist early by just putting: [] For example: [width, height, depth] [track_radius, via_radius, track_gap, [(terminal_radius, terminal_gap, (x, y, z), [(x, y), ...]), ...]...] [track_radius, via_radius, track_gap, [(terminal_radius, terminal_gap, (x, y, z), [(x, y), ...]), ...]...] [] [track_radius, via_radius, track_gap, [(terminal_radius, terminal_gap, (x, y, z), [(x, y), ...]), ...]...] [track_radius, via_radius, track_gap, [(terminal_radius, terminal_gap, (x, y, z), [(x, y), ...]), ...]...] Format of the view.py input is similar but has the track paths appended: [width, height, depth] [track_radius, via_radius, track_gap, [(terminal_radius, terminal_gap, (x, y, z), [(x, y), ...]), ...]...], [(x, y, z), ...]]
Could you provide a script for that?
Your input is not easily understand for some readers like me :(
Thanks!
hi, vygr:
I run your program on windows with python3.8. I modify the code and it can implement, but it can't stop, keeps running.
I used command : python pcb.py --v 1 netlist.pcb > anim
Display the result, you can see that it has been repeated!I don't know exactly what went wrong!THX
Hi, could you please give the community the paper your router is based on and how to customize it?
Thanks!
When I run this command pypy pcb.py --v 1 netlist.pcb | python view.py
, it gets executed with pcb viewed popped up with nothing in it. The following errors are thrown. Can you please tell I am missing? Thanks in advance.
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python3.8/tkinter/__init__.py", line 1892, in __call__
return self.func(*args)
File "/usr/lib/python3.8/tkinter/__init__.py", line 814, in callit
func(*args)
File "view.py", line 81, in doframe
scale_and_split_tracks(tracks, scale)
File "view.py", line 44, in scale_and_split_tracks
track[4] = split_paths(track[4])
File "view.py", line 25, in split_paths
_, _, zb = b
TypeError: cannot unpack non-iterable NoneType object
Traceback (most recent call last):
File "view.py", line 226, in <module>
main()
File "view.py", line 223, in main
image.save(args.i[0])
AttributeError: 'NoneType' object has no attribute 'save'
Traceback (most recent call last):
File "pcb.py", line 74, in <module>
main()
File "pcb.py", line 59, in main
if not pcb.route(args.t[0]):
File "/home/Python-PCB/router.py", line 128, in route
self.print_netlist()
File "/home/Python-PCB/router.py", line 146, in print_netlist
net.print_net()
File "/home/Python-PCB/router.py", line 296, in print_net
[[(x * scale, y * scale, z) for x, y, z in spath] for spath in spaths]]
IOError: [Errno 32] Broken pipe: '<fdopen>'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.