Duplicate Edge Cuts

Hello everyone, just a quick one about the edge.cuts. How would you go about duplicating one edge panel of one PCB (with holes) to another PCB. In fact I have to line up two PCBs with holes to put spacers, I would like it to fall opposite! Thanks for your suggestions.

What does this mean:

Do you want them to be the same, or do you want the other to be mirrored?

The simplest way is probably to first design one of the PCB’s, then copy the PCB file to the other project and delete everything except the Edge.Cuts layer and the mounting holes.

A very similar way is to turn your first PCB into a custom template, which can then be used to start other projects from. In KiCad a “template” is just a regular project, so can have anything that any other project has. The mechanism behind the templates takes care of the file renaming.

Another way is to design the PCB outline in an external CAD program, and then import it into KiCad as a .dxf format.

Another method worthwhile because of it’s simplicity is to simply write down the coordinates (copy to a text file) and put some items of interest back on those coordinates.
When you’re talking coordinates… (I like to use 127, 127) as a reference location on the PCB because it lines up with both a metric grid and that other grid. Sometimes it’s a corner of the PCB, sometimes it is pin 1 of some connector or even just a fiducal. This way you can use both grids with the same reference and without messin’ with offsets.

As a general rule I find that checking and repairing stuff is easier & quicker when some sensible grids are used. Big THT connectors and 0.1" I always put on a 0.1" grid (habit for matrixboard compatibility, that also helps when making mods), while I use metric for everything else. PCB outlines and mounting holes are on whole millimeters. I usually don’t care where the SMT stuff and tracks land.

Keeping all the important stuff on a whole mm grid helps with detecting mistakes. For example if you forgot to lock the location and it got moved in some intermediate block move long ago. If you ever see coordinates with numbers after the decimal separator, then it’s time to investigate what’s going on…

About the mirroring…
You can select the whole shebang, then right click and select “flip” from the pop-up menu, but I advise against doing so. When working with the mirror image all coordinates change which makes it hard to check parity between the PCB’s. It would be easier, to swap F.Cu and B.Cu “in your head”, that means, use “F.Cu” as the “main component side” for one PCB, and use “B.Cu” for footprints on the other. Related to this, have a look at: Pcbnew / View / Flip Board View. This does not change the actual PCB, but just mirrors the presentation of the PCB on your screen.

For complicated stuff, such as 2 packed PCB’s both with high footprints (such as elco’s) which have to have clearances from each other, the way to go is to first verify your 3D models are accurate, then export the PCB’s as .step files and load those files in a mechanical CAD program. FreeCAD with the StepUp workbench (Specifically designed to work with KiCad) may be of use here.

1 Like

Hello and thank you @paulvdh for the explanations. I agree, but initially I started the project with a single PCB, due to the sapce I decided to switch to multiple boards.
I mainly have 2 PCBs on top of each other, the first from Top being narrower than the second from Bot.
My 2 PCBs are already routed, I had to modify one and the other according to the changes, especially for the positions in the future box. I am using FreeCad precisely to place my PCBs and this is how I saw the mechanical differences of the holes. I tried to open 2 instances of Kicad each with a PCB, but the standard copy / paste doesn’t work, it’s a shame!
The actual situation :

Copy & Paste between different KiCad instances has been fixed in the nightlies.

To fix your current problem:

  1. Pcbnew / File / Plot / Plot Format DXF (Set Export Units to metric).
  2. In the other project: Import the Edge.Cuts layer you just generated on a graphical layer.
  3. Use it as a guide to re-locate misaligned items.

Possibly you can also fix the changes in FreeCAD, and then import the modified outlines in KiCad, but I do not have much experience in that direction.

How do you manage it in KiCad?
Is each PCB a separate KiCad project?

Do the PCB’s share common coordinates in Pcbnew?
If they share coordinates, the simple method of just copying the text of the X & Y coordinates of some misaligned holes and then placing the holes in that other project on those locations is a simple method.

If the general coordinates are different in those PCB’s, then you can experiment a bit with the context menu that pops up under the right mouse button. Interesting items are: Move Exactly … [Ctrl + M] and Position Relative to … [Ctrl + R].

I once designed a pair of boards to mate using pin header/sockets. Both boards were the same size, and the connectors were aligned to the grid. So it was just a matter of making sure that the connectors were the same distance from the edges in both boards. I checked visually by generating board views at the same magnification as PNGs and then superimposed them using NETPBM tools, setting the opacity of the top board to around half. You can probably modify the procedure to cater for boards of dissimilar size.

Even if you figure out how to copy edge lines I would trust dimensions more than cut and paste.

I approached this issue using the “auxiliary axis origin” and gerber files, I placed the “auxiliary axis origin” the way that was coincident for both board, then I plotted the gerbers using the option “use auxiliary axis as origin” and checked if the aligment was good or not.

kicad StepUp can help in this case:

just align your model and push the right position back to your kicad pcb.

Thanks @paulvdh exporting Edge-Cuts as DXF work fine. But holes are defined on another category Front & Back-Mask. Not easy to export only required !
Thanks !

@paulvdh I create one Kicad .pro for each PCB. Not sure to understand “share common coordinates” Each PCB is defined with its own coordinates (well I think).

@retiredfeline, I use (or try to use) FreeCad for 3D representation, an additional tool StepUp can probably help for that, but I’m not fluent with it.

Hello & thanks @maui, It’s a bit complicated for me, the demo is very good but I don’t yet have enough knowledge of FreeCad and StepUp to do that!

So separate KiCad projects. OK.

What I mean however is to use the same numbers for coordinates in those projects. For example, if you use one reference position of (127, 127) for a hole or a PCB corner in both projects, then you can directly compare coordinates between those projects.

I mean: Yeah sure it is possible to design one of the PCB’s rotated 30 degrees and the other upside down in another KiCad project, but it makes it a lot more complex and you may go mad before your PCB’s are finished.
KiCad is not a mechanical CAD program, and keeping things simple by re-using as many coordinates as possible between those two projects makes it a whole lot easier.

Using 5.1.9

• Three PCB’s in one Project file - Each contains the Same Location for:
Aux Origin, Lower-Left corner of Edge-Cut, a Hole
• Set Aux Origin at the same position for each
(added a Layer Alignment Target only to observe what happens - no affect, as expected)
• Exported Step of #2 and #3
• Made Footprints of #2 and #3 (did NOT change their positions/offsets)

• Loaded #2 & #3 Footprints into PCB #1
** Observations:
• In 3D viewer, #2 and #3 arrived aligned properly with each other but, neither were aligned with #1 PCB in the viewer

• Loaded #1 and #2 and #3 into FreeCAD using StepUp
** Observations:
• All three arrived in correct (X/Y) positions. Only needed to adjust Z, as expected.

Note: FreeCad/StepUp pref’s are set to load using Aux Origin

Thanks @paulvdh, do you mean “Grid Origin”? I have to use it because to export the PCB in .step format as a 3D file for FreeCad, it is necessary. The two PCBs are aligned from the back and stacked on top of each other using spacers. In my case it looks easy, once I place the import of the .dxf file from the first card board, my holes are all with the same edge distances, so easy to reposition.
Trous

Can set the Origin to use in FreeCAD (load StepUp workbench, then go to FreeCad pref’s > PCB Placement

Hi & thanks @BlackCoffee, when you talk about “Aux Origin” you mean :


Grid Origin ?

No. I mean Aux Origin (as seen in Toolbar)

Screen Shot 2021-03-02 at 8.22.07 AM

Ok, sorry this on FreeCad !

Aux Origin set in Kicad

Aux Origin to use (for Placement), set in FreeCad

Thus, FreeCad uses the KiCad Aux origin when it loads a PCB

EDIT: add image showing Top-View of the three PCB’s in FreeCad - the Holes are deadly accurately aligned… View of Wires show Zero offsets

Screen Shot 2021-03-02 at 7.26.08 AM