Giter Club home page Giter Club logo

hm-panelizer's Introduction

hm-panelizer

icon

A GUI based PCB gerber file viewer and panelizer written in python

This tool would not have been possible without the following projects:

hm-panelizer is released under MIT license, Copyright 2021,2022 HalfMarble LLC (www.halfmarble.com)

Please note that I forked pcb-tools and pcb-tools-extension, made significant modifications, and included them as part of this tool.

Why did I create hm-panelizer?

There are a couple of open source tools out there that will help you panelize your Pcb, for example http://blog.thisisnotrocketscience.nl/projects/pcb-panelizer/ , https://github.com/sej7278/kicad-panelizer and www.github.com/yaqwsx/KiKit, however, I wanted a GUI based app, which I could run (easily) on a macOS based machine, so here we are.

It also gave me an opportunity to learn python (it is my first python app, so it is most certainly not optimally implemented) and gain some insight into the mysterious world of gerber files.

! WARNING !

I hope that you will find hm-panelizer useful, however, I offer no guarantee that it will work in your case - always verify with other tools, before you order your Pcb panels!

How to run

hm-panelizer is a python app, so you will need python version 3.6.x or higher (we use 3.9.12) and install kivy, pygame and pycairo python packages. Here is an example of steps I had to perform on my own macOS machine:

  • Install homebrew by following one step installation on https://brew.sh/

  • Add "/opt/homebrew/bin" to your PATH in ZSH configuration file:

    open -e ~/.zshrc
    
    export PATH=$PATH:/opt/homebrew/bin
    
  • Install "pkg-config" and "cairo":

    /opt/homebrew/bin/brew install pkg-config
    
    /opt/homebrew/bin/brew install cairo
    
  • Upgrade "pip":

    python3 -m pip install --upgrade pip
    
  • Install "kivy", pycairo" and "pygame" python packages:

    pip3 install kivy
    
    pip3 install pygame
    
    pip3 install pycairo
    
  • I have received a report that "cairocffi" python package is required as well. On my Mac things work fine without it, however, if your machine needs it, then you can install it with:

    pip3 install cairocffi
    

Once you have python and the required python packages installed, you can run hm-panelizer via command line (i.e. terminal) by cd'ing into the hm-panelizer folder, then issuing python3 main.py command.

Screenshots:

Main view

screenshot

Main view (outline verification)

screenshot3

Panel view

screenshot2

Will hm-panelizer work with my Pcb?

It might. The gerber viewer part should almost certainly work, but the panelizer feature is another story.

I personally use KiCad 6.x and wanted to panelize my own Pcb, so that's what I mostly tested. I did try a few other Pcbs created with other software and I am eager to hear your experience.

Please keep in mind, however, that hm-panelizer was just a side project for me. I am releasing it as open source in hopes that the community will contribute to it. If you find a bug and can fix it, then please help!

Having said that, here are requirements to create a Pcb that should make it suitable for hm-panelizer:

Limitations:

  • currently, the tool can only add mouse-bites to perfectly straight lines only (see hm-panelizer's "Outline verification" feature)
  • only horizontal mousebites are suppported
  • the horizontal/vertical feature is currently problematic with most Pcb houses (I recommend that you use your Pcb design app to do the rotation and only use hm-panelizer for layout and mousebites for now)

Here are the KiCad settings I personally use to export my Pcbs:

KiCad plot settings

KiCad plot settings

KiCad drill settings

KiCad drill settings

TODO

Here is a list of wish features that I personally would like to add when I have the time:

  • speed optimizations (rendering and panelization)
  • GUI for setting colors of Pcb layers, themes
  • scrollbars
  • support both horizontal and vertical mouse bites
  • standard output/error redirected to the progress panel to track the debug logs
  • render component parts
  • 3D rendering

Need help?

Visit my Discord channel https://discord.gg/7mf5qqBMEF

Please consider supporting hm-panelizer if you want to see more features!

ko-fi

hm-panelizer's People

Contributors

gerard-hm avatar

Stargazers

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

hm-panelizer's Issues

No image preview at jlcpcb.com of produced panel

Describe the bug
No image preview at jlcpcb.com of produced panel

To Reproduce
Steps to reproduce the behavior:

  1. Go to jlcpcb.com
  2. Upload gerber files
  3. Wait (takes some time)
  4. See error - no rendered pcb panel board preview

Expected behavior
A rendering of the board should appear

Screenshots
Screen Shot 2022-01-15 at 7 30 11 AM

Additional context

Force V-Score

For your feedback: I installed on my Mac M1 following your recommendation, nothing more, and it worked our of the box. I have an Eagle generated Gerber file. Generated with a .cam file from JCLPCB. I loaded that file and asked for 6x4 layout, see screenshot. Excellent work!
Screenshot 2022-06-18 at 12 24 23

I don't know what that green triangle represents, but it is not there in eagle, nor when I upload to JLCPCB

Mouse bites was added, which I don't need for this, V-Score only would be perfect. I could cheat a bit by entering '0' in number of bites, and I could reduce some of the spacing, but not all, see my setting below.
Screenshot 2022-06-18 at 12 29 21

Would it be possible to to V-score only?

Add KiCAD BOM, parts placement files for supported PCB houses

Is your feature request related to a problem? Please describe.
Panelizing for manufacture with SMT assembly requires BOM file + parts position files suitable for supported PCB houses (i.e. start with JLC, PCBWay)

Describe the solution you'd like
The tool should produce correct BOM files, parts placement files.

Mode "rU" is deprecated

In the project, files are opened with
open(fname, 'rU'), which is deprecated and not supported any longer by newest python versions. On my machine it can be replaced with open(fname, 'r'). Maybe some newline setting is required to work everywhere.

Mousebite sometimes forget their position when panelizing

Describe the bug
Sometimes (need reproducible steps) a mousebite will revert back to the last position when panelizing

To Reproduce

  • launch hm-panelizer
  • click on settings and change mouse bites count, click OK
  • click on add column or row
  • adjust mousebites
  • export

Mouse bites will revert back to defaults position

Turn hm-panelizer into a proper Python package

First of all, very nice and ambitious project!

I think you should consider turning the project into a proper Python package, i.e., respect all the conventions and provide setup.py or setup.cfg. It would allow you to simplify the installation as you can specify the dependencies directly and you also get an executable in PATH for free.

Then you could also publish the package on Pypi so your users can install it simply by pip install hm-panelizer. It is then also easy to distribute the updates to the users.

Multilayer PCB not working with Protel file extensions

When loading gerber zip files with Protel file extensions, then the inner layers of 4 layer PCBs are discarded. Using KiCad, the inner files have the extensions ".g2" and ".g3". Those extensions are not present in the extensions lists in "do_optimize.py" and "PcbExport.py". Adding the names to extensions and extensions_to_names seems to fix this issue.

OSHPark, JLCPCB (others) do not support rotated macros

Describe the bug
PCB panel rotated horizontally will produce with messed up pads

Expected behavior
expected

Actual behavior
actual

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Outline verification incorrect

Describe the bug

With small PCB's, the outline verification is incorrect and causes the panelised output to have no edgecuts whatsoever.

as you can see in the screenshots, the layout validation is a fraction of the size of the PCB.

To Reproduce
Steps to reproduce the behavior:

import gerbers, set JLC type, set panel to 8x5 (breaks even at 2x1)

Expected behavior
A panelised PCB to be created

Screenshots
image
image

Desktop (please complete the following information):

  • OS: Linux

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.