Filled zone cuts corner of mask on square pads


Why would that be done?
Even if KiCad solder mask outline followed the zone fill, it would leave exposed board material.


No it would not. The mask clearance is still smaller than the net clearance! Read my full post not just part of the last one (and then quote it wrong as well)

Just do the experiment and see for your self. I doubt there will be a setting that does not create any problem at all. (The clearance between mask and copper will always be different around the corners compared to the rest of the pad unless you really set it to exactly 0.)


Under settings, change the soldermask “Pads Mask Clearance” to zero.

OK I hadn’t seen this setting. I’ve set it to 1.5mm as a workaround and it looks OK:

I checked with OSHPark and Seeedstudio and they specify 0.4mm and 0.0508mm respectively.

But what is the expected behaviour here? It seems odd that the solder mask of the pad is square to match the pad but the thin yellow outline of the pad that the fill uses has rounded corners? I think they should both have corners to match the pad itself, right?


Well if the mask alignment is just slightly wrong you will still run into trouble. (There is just not really much clearance between the mask and the copper of the zone) You might really need to increase the net clearance for the pad as well as decreasing the mask clearance

I just found there is already a bug report for this (but might also be the wrong side of things as this seems to be between the mask and the pad it self not to other things):


This is what the solder mask is doing:

What is presented currently, creates a NSMD pad on the fabricated pcb.


I think you misunderstand the whole post.

There is a problem with how kicad currently handles the soldermask and copper clearances. (They are handled differently at the corners creating the danger of exposed copper from a different net there.)
We know that there will be exposed pcb material. The problem is that the copper zone is exposed at the corner and the reason for this is the explaind wrong handling of the two clearances.

Two solutions to the problem are shown in this screenshot.

  • Option 1 (cyan) Use the same center point for the mask rounding as for the copper pad rounding. This would be how the copper clearance is calculated right now.
  • Option 2 (red) Use the mask rounding center as the center for the copper clearance as well.

I think option 1 would be the correct solution.


I actually had this conversation with JP sometime back and he convinced me #1 was not the right solution.

The reason is that the clearances have different purposes. The copper-to-copper clearance is for electrical isolation, so the corner of the zone can be radiused so that the clearance distance is kept constant.

The mask-to-pad margin is to allow for registration errors. Since they occur along either the X or Y axis, you cannot round the corner and still have the same error tolerance.

#2, I believe, is still a runner…


If you look from the pad perspective then maybe #1 is not quite right (at least with the explanation by jp.)
I am not so sure about that. A clearance of 0.1 mm does not mean you can have 0.1mm alignment offset in both x and y direction at the same time. IPC defines it as 0.1mm in any direction (For example 0.1mm at an angle of 45° would be the maximum where both x and y direction are misaligned by the same value. This is less than 0.1mm in both x and y direction)

What is certain is that the current way of doing it is definetely wrong. (The two clearances must use the same way of being calculated!)


@Rene_Poschl Please look at my post, my reply was not to you, but was directed towards the OP. It remains my opinion that, in this case with a through hole part, there is no apparent reason to use a positive solder mask clearance for this pad.

I’ve had ~6 different boards fabbed by the purple board source without any issue with the settings that I have used; but have always hand soldered the parts to the boards.

One important thing you have not mentioned is the different zone settings also need to be “set” to the rules that the board house can manufacture.

This image shows that the zone settings can be set with more clearance than the required distance between the nets.


What I did was to change the zone clearance settings beyond normal, and also changed the global mask setting to a negative value.
This is what it looks like in PcbNew:

The mask layer is a “negative layer”; it shows where the Solder Mask will “not” be applied. This effect can be seen in the 3D viewer:

An advantage to the negative mask (Solder Mask Defined pad) is that the Solder Mask layer is a form of epoxy and can help keep the pads from lifting off the base pcb material.

Note: The Solder Mask should probably remain square in every case as this typically gives a visual indicator of the location of pin 1 on the device.


Well… it also comes down to approach…
The Fill area is etched, so you do not really want a sharp corner there, plus that corner exceeds the clearance so it is excessively conservative. That makes a radius logical.

The Mask area is usually simply a flashed larger pad, so until there was a rounded corner pad, making a rounded corner mask would have been hard to do. Which explains the square corners…

Because the mask-allowance is usually rather smaller than the fill clearance, this subtle corner effect is not usually noticed.
Here, we usually set the fill clearance a notch above the PCB quoted rules minimum, otherwise you create a whole-board expanse of minimums, which is tougher on the PCB FAB, than ‘a few traces pushing clearances’.


I’m not sure the strength edge-on of that epoxy ink counts for much… ?
That said, we have used larger copper areas specifically for adhesion/strength reasons, but there it’s the bigger copper that is what’s helping adhesion, not the thin epoxy ink.


I have run into this issue also, but I do not anymore since following the advice on (Kicad default mask expansion is 7.8 mils, on recent Kicad the menu item is Setup > Pads to Mask Clearance)

Setting Mask Expansion

By default, KiCad sets a very large mask expansion, which can allow solder shorts to be added during board assembly. See our Stop Mask Expansion page for a more detailed explanation of the problem.

The mask expansion setting can be adjusted under the menu option Dimensions > Mask Pads Clearance, and then setting the Solder Mask Clearance box. We typically recommend a value of 0.002in (0.0508mm), although the optimal value depends slightly on the design itself.


I find it really really strange that Mask clearance defaults to the same value as Copper clearance.

This means, even without a filled zone, that a 45 degree copper trace near an SMD pad will get exposed even without any registration error (mask offset wrt copper). See below.


I’d suggest at the very least to make Mask clearance default to half the Copper clearance. (Or even taking the rounded copper clearance into account, so that the default Mask clearance=Copper clearance/sqrt5 [~0.09mm], allowing the registration error to be equal in both x and y, and also both positive and negative.)


Will not help much if you consider that the mask clearance is there to protect the pad from misalignment of the mask layer. So lets say you expect worst case 0.1mm misalignment and set the mask clearance to 0.1mm for this reason.
Now with your solution you would use 0.2mm copper clearance. One would expect that no matter what direction the misalignment is that way, nearby copper will always be covered. (Yes to ensure it you would need a bit more than 0.2mm copper clearance but lets ignore that for easier calculations)

With the current way of calculating things you will run into trouble even with this solution:


That is why I suggested Copper clearance/sqrt5. This would of course only be adapted to x/y direction misalignment.

Anyhow, I would expect the default to be such that nothing is wrongly exposed in the case of no misalignment.


even 1/sqrt(5) reduction will still yield in free copper at worst case misalignment :wink:


Well if that can happen, use Copper clearance/sqrt8, default ~0.07 mm :sunglasses:

That is just above the purple recommendation of ~0.05 mm


Goodbye high density boards (The mask clearance is fixed by the fab. So in reality this means that if you are at the minimum there you would unnecessarily need to increase copper clearance just for this bug.)


I do not mean to use a fixed ratio. I am just talking about the default value.