I was wondering if there exists any built in functionality or addon to allow to place components via importing placement file.
E.g. Imagine having PCB with 3 parts: R1, R2, R3.
I wonder if it would be possible to have some text file (csv, txt, xml) containing information about part descriptor, x coordinate, y coordinate, rotation.
Something like this:
The function would parse this text file and place each component at given coordinates with given locations.
Motivation: currently I am creating a copy of PCB made in Allegro Cadence SW. I have pick and place file for assembly and I wonder whether it is possible to use it to place components automatically so that I can avoid extra work.
Not that I’m aware of. I suppose it’s possible to write a script to parse the .kicad_pcb file and change the coordinates of the referenced components. Would also have to deal with origin and scale. This is just idle speculation on my part, I have no use case, so worth -2¢.
I would think the function of each component would dictate the placement of the parts. For instance bypass capacitors have to be located as close to the power pins of its related IC.
Perhaps when AI can design a board without humans getting in and mucking things up.
Yes, sounds like a reasonable argument to do it. I totally ‘get this’
Take a look at the PCB file- format is simple enough. I do not think needs to be a Kicad feature, but how handy are you with python ?
you might even get someone to write a script on some forum to do this for a little coin.
You’ll need to back annotate somehow to get the PCB footprint UUIDs teamed up with the Schematic symbols.
Handy enough to transform my text file into any other needed form. I might give it a try as you suggest to experiment with the layout file. I would say that I have zero experience with Kicad layout file structure thats why I wanted to avoid that.
Today I wanna try for 2 hours and if I have no satisfying results then I give up and place all the files manually.
Ok so it was pretty straight forward using Python.
Results are so-so since the origin points for some parts differ. Overall it helped me to get positioning done in a very rough way. Definitely not acceptable and a lot of fine tuning needs to be done, but it was a great experience playing around with KiCad layout files. Much easier than I would have thought.
F6.2 Footprint anchor should be placed in the middle of the component body
For THT footprints:
F7.2 For through hole components the footprint anchor should be placed at the location of pin 1.
Note that the locations of the anchor is not only used for visual things in KiCad (moving, aligning to grid, rotation, etc) but also exported to the placement data files. Unfortunately there is no consensus about the location of these anchor points in industry, and as a result there is often a lot of fiddling about to get the placement right.
The best KiCad can do is to have the KLC and adhere to it, so there is at least uniformity throughout the libraries, which should ease automation / scripting to make placement files compatible with whatever some PCB assembler requires.
Well, being on pin 1 for thru hole is nothing but a time waster, because when you change orientation, instead of just a rotate, you need to rotate then move. - extra clicks and mouse moves.
All the footprints of my own libraries have the anchor at their centre. Most of them are copied from the standard libraries. I move the anchor and the 3d model so rotation does not change their position.