GithubHelp home page GithubHelp logo

python-pcb's Introduction

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), ...]]

python-pcb's People

Contributors

vygr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python-pcb's Issues

Nothing displayed on the PCB viewer window

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>'

How long to run this program?

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

Input random generation

Could you provide a script for that?
Your input is not easily understand for some readers like me :(
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.