Use full start / end copper layer heights in length calculations

Previously we halved the start / end copper layer heights, which is
not in line with how other EDA tools behave. This was also inconsistent
with adding pad-to-die lengths as we did not add back in the missing
half.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21365
This commit is contained in:
JamesJCode
2025-08-06 20:30:13 +01:00
parent 7dc83fbffd
commit b87a050bd8
6 changed files with 24 additions and 34 deletions
+1 -12
View File
@@ -840,7 +840,6 @@ int BOARD_STACKUP::GetLayerDistance( PCB_LAYER_ID aFirstLayer, PCB_LAYER_ID aSec
int total = 0;
bool start = false;
bool half = false;
for( BOARD_STACKUP_ITEM* item : m_list )
{
@@ -852,25 +851,15 @@ int BOARD_STACKUP::GetLayerDistance( PCB_LAYER_ID aFirstLayer, PCB_LAYER_ID aSec
// Reached the start copper layer? Start counting the next dielectric after it
if( !start && ( layer != UNDEFINED_LAYER && layer == aFirstLayer ) )
{
start = true;
half = true;
}
else if( !start )
continue;
// Reached the stop copper layer? we're done
if( start && ( layer != UNDEFINED_LAYER && layer == aSecondLayer ) )
half = true;
for( int sublayer = 0; sublayer < item->GetSublayersCount(); sublayer++ )
{
int subThickness = item->GetThickness( sublayer );
total += half ? ( subThickness / 2 ) : subThickness;
total += item->GetThickness( sublayer );
}
half = false;
if( layer != UNDEFINED_LAYER && layer == aSecondLayer )
break;
}