yaqwsx / KiKit

Automation tools for KiCAD
https://yaqwsx.github.io/KiKit
MIT License
1.53k stars 201 forks source link

Support merging multiple schematics for fab output #632

Open mvirkkunen opened 8 months ago

mvirkkunen commented 8 months ago

I want to be able to panelize boards from multiple different projects together in the same panel. This is an open feature request elsewhere, but for my purposes I just implemented a simple layout plugin to handle it. The plug in API is nice!

However for "fab --assembly" to work I also need to be able to merge the schematics for each board. This PR allows the user to specify the "--schematic" argument multiple times, and all components will be merged from each schematic.

For this to work, the reference designators must be unique across all schematics and I added validation to check that. Currently I think duplicate references are happily added to the BOM. This requirement could be relaxed if UUIDs were used to correlate components and reference designators were renamed to be unique for each board, however I think that would confuse both users and fabricators pretty fast. And it's pretty easy to have unique references by just setting the starting index for generating them to different values for each project.

If this is too much of a hack, feel free to close. I also de-duplicated the code that filters parts out of the BOM to make the uniqueness check work more nicely.

yaqwsx commented 7 months ago

Hi, I am sorry for not responding sooner enough. I am well aware of this problem, and I already know the proper solution. It has not been implemented yet as there are several complications with differences between KiCAD 7 & KiCAD 8.

The idea is the following:

However, the technicality I experience is the selection of a suitable format for baking.

I would like to hear your feedback on my solution proposal. Does it fit your use-case? Do you have ideas about improvements? Please, let me know.