Soldermask layers not WYSIWYG

Bug #1812096 reported by Tomasz Wlostowski on 2019-01-16
This bug affects 10 people
Affects Status Importance Assigned to Milestone

Bug Description

Kicad V5+.

Soldermask screen rendering should IMHO take the min solder mask width parameter to match what goes to the gerber files. Story of a confused user and more info here:


Seth Hillbrand (sethh) wrote :

What is particularly interesting here is that the soldermask behaves as expected (confined to the footprint) until the minimum width gets to be at least the distance to the next footprint. At which point, there is interference. The user's example file shows this at about 57mm, but with closer footprint spacing, we would see this at more rational values as well.

Jeff Young (jeyjey) on 2019-03-05
Changed in kicad:
importance: Undecided → Medium
Andrey Shmakov (akshmakov) wrote :
Download full text (3.4 KiB)

This came up in another thread when a user was confused about why the plotted output didn't match the previews

This bugged me a bit so I did a little digging. Probably not a complete picture but gives some scope to what is involved.

The challenge is that pullback/margin preview that one sees in pcbnew is applied by the pad geometrically, specifically in PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) defined in pcb_painter.cpp which gets the margin setting from D_PAD::GetSolderMaskMargin defined in class_pad.cpp , for custom pads a geometric inflate is applied. There is also a related drawing function D_PAD::Draw defined in pad_draw_functions.cpp with largely the same logic, but it is not clear to me when that drawing code is used.

This is straight forward as this applies the margin to the mask feature defined by the pad itself, note that a side effect of this is the clearance option will not automatically pull back solid mask regions (such as when one wants to leave a region of board unmasked) outside of a pad. Although, perhaps I missed that code somewhere else.

On the other side of this: the minimum mask width (minimum sliver) setting is computed purely graphically during the plotting step. PlotSolderMaskLayers in plot_board_layers.cpp

There a code comment reads

/* Plot a solder mask layer.
 * Solder mask layers have a minimum thickness value and cannot be drawn like standard layers,
 * unless the minimum thickness is 0.
 * Currently the algo is:
 * 1 - build all pad shapes as polygons with a size inflated by
 * mask clearance + (min width solder mask /2)
 * 2 - Merge shapes
 * 3 - deflate result by (min width solder mask /2)
 * 4 - ORing result by all pad shapes as polygons with a size inflated by
 * mask clearance only (because deflate sometimes creates shape artifacts)
 * 5 - draw result as polygons ...


Changed in kicad:
status: New → Triaged
tags: added: pcbnew
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers