Can I convert a board outline to a rule area?

I have a KiCad project consisting of two boards that will be placed on top of each other. One is just a spacer while the other contains components that must avoid interfering with the spacer.

I’d like to convert the outline of the spacer pcb into a rule area on the component pcb so I don’t place components where they would interfere.

I can just cut and paste the outline of the spacer pcb onto the component pcb in a separate layer. That works, but it would be better if I could convert the entire spacer pcb outline into a rule area.

Here is a screenshot of the spacer pcb:

I can import it into FreeCAD:

But I don’t see a way to import it back into KiCad as a rule area.

Have you tried selecting this and creating a rule area from that selection ?

This is Ver 9.0.2 what version are you using ? you didn’t say . . .

I don’t know if rule area can have holes in it.

Yes it can, it’s like a zone, context menu Zones → Add a zone cutout.

I am using 9.0.2 (actually from the testing builds).

I’ve tried converting to a rule area via “Create from Selection” but KiCad seems to get confused. It deletes part of the selection, and doesn’t seem to know what is the inside and what is the outside.

It may be that the selection has some small gaps. I’ll play with it some more, but I think I’ll move on to other tasks.

Thanks all for the help.

I know you’ve moved on, but you could also try the heal shapes tool before running create from selection. That might heal any discontinuities, if that’s the problem.

Thanks @gkeeth but heal shapes doesn’t appear to help.

I’ll open an issue in case anyone wants to look at it further.

Are you able to post the zipped Project here for others to look at ?

Actually, I just got it to work! The key was to select “Create bounding hull” rather than “Use centerlines”.

The project is too large to upload here, but I put a copy as a tar file on dropbox:

https://www.dropbox.com/scl/fi/r9ssknxgciol7yuun2wbk/project.tar.gz?rlkey=hm5uxmg99l642d96kff5l15sb&st=c858xl7v&dl=0

If you open Hardware/PCBs/Main/main.kicad_pcb, on the left you will see the main circuit board and on the right is the outline that I want to convert to a rule area. The outline originated from the Hardware/PCBs/Spacer1/Spacer1_assembly.kicad_pcb file.

If I try to create the rule area with “Use centerlines” it doesn’t work, but if I choose “Create bounding hull” then it does work.

Thanks again to all who offered help. I appreciate it.

1 Like