Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rotation source and wildcards/regex in overrides #1

Open
jonroger opened this issue Nov 16, 2019 · 5 comments
Open

rotation source and wildcards/regex in overrides #1

jonroger opened this issue Nov 16, 2019 · 5 comments

Comments

@jonroger
Copy link

Nice program, thanks. Looks like I have to rotate all capacitors and resistors, so pattern matching (like C*) in overrides.json would be convenient. It's too bad that rotation information is stored in a separate file and not tied to a specific part - preferable would be to store rotation information in a field in the schematic/part (which can be available as a BOM field).

@jonroger jonroger changed the title wildcards/regex in overrides rotation source and wildcards/regex in overrides Nov 16, 2019
@urish
Copy link
Collaborator

urish commented Nov 16, 2019

Thanks! Here is a proposed solution:

  1. Create a database of JLCPCB Part Number and Rotation Override. This database can be hosted as a CSV file in this repo, so it'll be a collaborative effort
  2. The pos_to_cpl script can then look at the BOM file to map Designator to LCSC Part #, and find the rotation based on that.

WDYT?

@jonroger
Copy link
Author

Great idea, much better than what I was thinking. JLCPCB has the data because they display a preview - I'll talk to them and see if they will assist.

@jonroger
Copy link
Author

JLCPCB was helpful, but says that they don't have information as to how each part is oriented on tape. But package (eg, SOIC8) is available for each part and I see that others do regex matching on footprint to determine the rotation needed transform from tape to the kicad standard. Not clear to me how reliable this is - but it may be the best option.

@rokan51
Copy link

rokan51 commented Mar 14, 2021

Wery nice!

With regard to kicad_pos_to_cpl.py:

I like the simplicity of your kicad_pos_to_cpl.py script (cant say anything about BOM as I use kibom-master with customl jlc-kibom.ini to generate JLCPCB bom and using [JOIN] to to accumulate/rename columns), however a few small additions to your kicad_pos_to_cpl.py might be useful:

  • I also think that 'Package' should be used (instead of 'Ref', line 34 in kicad_pos_to_cpl.py).
  • for the idea adding regexp possibility (using some python regexp library) for matching. First match would "win" (that is order could matter - this would allow adding exceptions to more general rules by prepending a new rule)
  • having possibility of multiple rules, eg project specific: one: For instance if in the directory would contain file "pos_to_cpl.db" and [/some/global/pos_to_cpl] would be the 3rd argument (default database file), those two can be merged (with local prior to global to allow override). This means that the same script (or wrapper) can be then used to all projects with possibility to add custom project-specific additions/overrides.
  • possibility to add two more columns dX dY for translation offsets (when missing defaulted to 0)

Maybe additional option for negating x axis for bottom side (it seems to me that kicad .pos is inverted for bottom side but JLC requires it as coordinates would look from "side of components" - am i correct?),

Thanks, R.

@DanielO
Copy link

DanielO commented Oct 5, 2021

+1 for package idea - I made that modification (in the simplest way - no REs etc) and it seemed quite effective.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants