Separate clearance parameter for outside of zone

I’m going to create a higher priority zone into the main GND zone, because without making really separated zones with specified distance to each boundaries is quite tedious work. I have a GND plane zone defined across the whole board.

Now I’m getting aware that the zone clearance setting applies to all filled copper area to copper elements within the zone area and outside of the zone area. But the outside should become a greater clearance. That could be solved by means of creation of an extra copper zone out of the actual one with lower priority and an outline hull.

But… the clearance to the outside only is effective when copper is generated by the zone algorithm just within the border of any zone. Next screenshot with this arrangement clarifies this.

The outer zone shows clearance outside of the zone but also inside. If I would increase the clearance of the outer zone, it would not be sufficient to leave a small copper ‘line’ on the inside of the outer zone, and hence, the whole clearance on the outline disappears. But also on the inside. As such, only the clearance of the inner zone is present…

You can see this effect also on a corner of the POE+ net!

Finally it seems that no simple solution is possible.

Try: PCB Editor / File / Board Setup / Design Rules / Constraints / Copper to edge clearance

I tried it, but it only affects the copper distance to Edge.Cuts.

(edit) After I have dragged that POE+ track segment a bit (using ‘d’), the main GND leakage incursion is no longer existent. I was curious whether in gerber output lines thinner than minimum track width is ignored. But until prototyping I can live with this. The CAM employees of the PCB manufacturer could remove them.

I thought that was your intention. :slight_smile:

But now I think you want to use different clearance distances between:

  • A: The zone and tracks inside the zone.
  • B: The zone boundary and things outside of the zone.

You can draw graphic objects (lines, polygons etc) on the margin layer. KiCad keeps a copper clearance from any graphic objects drawn on the margin layer. (It uses the copper to edge clearance for this.)

Another option is to write a custom rule. If you give names to specific zones, then you can use those names in a custom rule to define a clearance between those specific zones (or other objects). Custom rules are powerful, but you need some time and effort to study how they work.

A third option is to:

  • Select the zone.
  • Right mouse button, and from the context menu: Create from Selection / Create Polygon from Selection.
  • and then:
    • Create bounding hull.
    • Set your gap width.
    • Do not delete source objects after conversion.

After this you can modify the polygon and create another zone from it.

I actually just realized it using the third option! It shows me that my description in my entry post has flaws…
Please be aware of the weird behavior in the circle area (part of my description above).

I’ll do it with rules. I studied these as they were introduced. And now, according to that what you write, I remember that this allows specification of minimal net distances - a very important for engineers who design with insulation barriers as in SMPS.
Thanks for your hint!

My intention with this third option (Bounding hull) was to use only a portion of the created polygon. Sort of:

  1. Create bounding hull polygon from the zone.
  2. Create lines from the bounding hull.
  3. Remove most lines, keep only the section where the zones meet.
  4. Add lines on the “other side” where you want the other zone.
  5. Create a zone again from those lines.

It’s a bit complicated, and I have not tested it myself.

It’s not really weird behavior when you look at it. It’s a result of zone priorities and KiCad keeping a clearance from the actual copper instead of the zone boundary, and this looks “as designed”.

Just did a short test and weird things happen.
In step 5), when I create the zone from the lines again, KiCad does the bounding hull thing again (With apparently twice the distance, this looks like a bug, but I’m not in the mood at the moment to investigate further.

Well, with following rule I get it done, without referring to another zone, which makes things a bit simpler in everyday usage:

(rule "Clearance outside of 'local' zone areas"
    (constraint clearance (min 1.0mm))
    (condition "!A.intersectsArea('zPGND') && B.Name=='zPGND'"))

But still the ‘leakage’ occur where the POE+ track reaches to the outline of the zone itself.
But indeed, this is according to the description of intersectsArea():
the function tests if the given object is inside any of the filled copper regions of the zone, not if the object is inside the zone’s outline.

I want to include tracks within also as incorporated in the condition as the B.-object. Any suggestion is highly appreciated.

1 Like