Browse Source

Force PTH pads to exist on all layers

By definition the PTH will exist on all layers at the moment but some
corner case allowed the NPTH layer set to be saved in the layerset,
after which it was hard to reset

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20980
9.0
Seth Hillbrand 5 months ago
parent
commit
846425c638
  1. 11
      pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp

11
pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp

@ -5163,6 +5163,15 @@ PAD* PCB_IO_KICAD_SEXPR_PARSER::parsePAD( FOOTPRINT* aParent )
case T_layers:
{
LSET layerMask = parseBoardItemLayersAsMask();
// We force this mask to include all copper layers if the pad is a PTH pad.
// This is because PTH pads are always drawn on all copper layers, even if the
// padstack has inner layers that are smaller than the hole. There was a corner
// case in the past where a PTH pad was defined with NPTH layer set (F&B.Cu) and
// could not be reset without effort
if( pad->GetAttribute() == PAD_ATTRIB::PTH && m_board )
layerMask |= LSET::AllCuMask( m_board->GetCopperLayerCount() );
pad->SetLayerSet( layerMask );
break;
}
@ -5922,7 +5931,7 @@ void PCB_IO_KICAD_SEXPR_PARSER::parsePadstack( PAD* aPad )
{
PCB_SHAPE* spokeTemplate = parsePCB_SHAPE( nullptr );
spokeTemplate->SetIsProxyItem();
padstack.AddPrimitive( spokeTemplate, curLayer );
padstack.AddPrimitive( spokeTemplate, curLayer );
break;
}

Loading…
Cancel
Save