wokwi / kicad-jlcpcb-bom-plugin

Export a JLCPCB Compatible BOM directly from your KiCad schematic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rotation source and wildcards/regex in overrides

jonroger opened this issue · comments

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

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?

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.

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.

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.

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