How can I draw "negative" copper (like tRestrict and bRestrict in Eagle)?

I’m tryin to switch to KiCad 6 from Eagle. I have been using Eagle to generate PCB “negatives” by drawing in Eagle’s tRestrict and bRestrict layers to delineate where copper is removed from a ground fill. I draw lots of line lines and other fairly complex geometry in t-restrict such that drawing with polygons is not workable. These are not electronics PCBs, they are used for a purpose that I can’t disclose. I haven’t yet found a way to do these negative drawings in KiCad. One suggestion was to use the Margin layer, but art in that layer removes copper from both sides, so that’s a no go. Any ideas? I’d really like to dump Eagle at this point. Not because I’m cheap, but KiCad 6 now seems to have a far better UI.

To do this you draw a Rule Area on the layer(s) in question and check the “keep out copper fill” box. The other keepout options can be selected or not as you see fit. You’ll need to refill zones (hotkey B) after adding the area.

Rule Areas used to be called keepouts, but in V6+ you can attach whatever DRC rules you want to them with the custom rule system, so they’re called Rule Areas now. Keepout rules are just the simplest rules available and you can do them through the GUI.

That doesn’t sound like what the OP wants.
If I understand correctly, they want to draw “negative” traces in a copper fill.

You’re right, I didn’t read carefully. Sorry @lens42

I don’t think there’s a direct equivalent to Eagle here.

I was hoping this would be achievable with the custom DRC rules system, attaching a clearance value to shapes on a certain layer, but I don’t think you can do this. You would need a cross-layer clearance rule like what Jeff described here: Add disallow rule token for copper pours (#6966) · Issues · KiCad / KiCad Source Code / kicad · GitLab

If your shapes are closed polygons, you could convert them to rule areas (right click → convert to rule area, then hit delete to get rid of the original shape) and then do what I described above to keep copper fills out. But that won’t work for arbitrary lines and shapes, and is a bit uncomfortable.

Not sure if this works for the application, but you could also draw your design as a positive copper region rather than negative in another tool, like inkscape or a mechanical cad tool. Then you can import that into KiCad as a graphic on a copper layer. It won’t work with copper zones but if it’s truly non electrical than maybe that’s ok.

I remember testing this, and I think it’s doable, but I don’t remember if it was 6.99 and whether I saved it somewhere or not. Sorry. :slight_smile:

I could only get it to work with shapes on edge cuts, which I believe are special-cased to act like they’re on all layers, but that of course has the downside of putting cuts in your FR4 anywhere you want to resist the copper…

maybe @JeffYoung can tell us if there’s a way to accomplish this.

Items on the margin layer are also tested across all layers. But it’s possible they would also have unwanted side-effects.

Perhaps I don’t fully understand what you’re wanting to do.

It seems to me (my interpretation) you want to Draw some Lines, Shapes, etc on a Copper Fill and have them show as Unfilled on Negative output.

Below is simple to do but, perhaps not what you want…

Negative’s (of PDF and SVG) are selected in their Plot Panel (a Checkbox for Negative)

I found an experimentation. Based on that I would say I was wrong: it’s probably not doable. As has been pointed out, it’s not possible to restrict it to some layers only (I used the margin layer).

I have filed this issue longish time ago: Add possibility to "knockout layers" to non-copper zones (#3983) · Issues · KiCad / KiCad Source Code / kicad · GitLab. It’s about non-copper zones, but it could be used for copper zones, too. Whether it would need a specialized UI is another matter. A general solution could be to have a new constraints for the custom DRC, for example

(condition "A.Type=='Zone' && A.Name == 'xxx')
(constraint zone_avoid ('User.1", 0mm))

where User.1 would be the name of the layer to use as a “knockout” and 0mm would be the clearance.

yeah, I think OP just wants to check between two specific layers (a copper layer and some other designated later). Putting things on margin affects all copper layers, which isn’t what OP is looking for.

I was hoping something like this would be possible:

(rule 1mm_copper_clearance_around_user1_graphics
    (condition "A.type=='Zone' && A.layer =='F.Cu' && B.layer=='User.1'")
    (constraint clearance (min 1mm)))

I realize that rule wouldn’t actually work even if the DRC rules do support what I’m trying to do, but hopefully it’s illustrative.

@eelik’s “desired rule” is a nicer approach, though.

Yeah, I think you could do a lot of interesting things with a cross-layer rule. The problem is making it performant…

what if you had to specify which specific layers you cared about? Adapting eelik’s example: (constraint zone_avoid ('<layer_to_avoid>', '<copper_layer>', 0mm))

You could wildcard if you need all layers, performance be damned.

Yeah, it’s just that anything that specific won’t catch all the other cases we haven’t thought of.

Still, we could give the users guidance on how to use the layer spec to reduce the performance impact…

This is interesting if I can get a board house to use that negative file as subtraction from a Copper layer. Though I guess, if they can do that, I might not have to even provide it as a negative. I would love to be able to create these features as regular traces (with the associated tools to extract length, do matching, etc.) but have them carved out as channels in a copper plane. The good thing about Eagle right now, is I don’t have to supply any special instructions to the board house.

KiCad is different from Eagle.

What is the ultimate goal of the use of your “negative copper”?

Why not just set up some rules for a big clearance (for example 8mm for mains related stuff) and then just let KiCad calculate the clearances itself?

1 Like

You may want to use another CAD more suitable for drawing and then import dxf into KiCad.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.