Soldermask layers not WYSIWYG

Bug #1812096 reported by Tomasz Wlostowski
26
This bug affects 10 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Unknown

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:

https://forum.kicad.info/t/mask-layer-gerber-completely-wrong/14720/18

Tom

Tags: pcbnew
Revision history for this message
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.

Revision history for this message
Frank Severinsen (shack) wrote :
Jeff Young (jeyjey)
Changed in kicad:
importance: Undecided → Medium
Revision history for this message
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

https://forum.kicad.info/t/soldermask-missing-between-pads/13792

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 ...

Read more...

Changed in kicad:
status: New → Triaged
tags: added: pcbnew
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

KiCad bug tracker has moved to Gitlab. This report is now available here: https://gitlab.com/kicad/code/kicad/-/issues/1792

Changed in kicad:
status: Triaged → Expired
Changed in kicad:
importance: Medium → Unknown
status: Expired → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.