Don't try and shrink shapes generated from pads.

It ends up being different from shrinking the final outline.
This commit is contained in:
Jeff Young 2020-08-28 20:27:44 +01:00
parent 691c33e003
commit 56a531109a
2 changed files with 13 additions and 12 deletions

View File

@ -319,13 +319,15 @@ void BOARD_ADAPTER::createNewPadWithClearance( const D_PAD* aPad,
{ {
SHAPE_POLY_SET poly; SHAPE_POLY_SET poly;
// Our shape-based builder can't handle differing x:y clearance values (which get generated // Our shape-based builder can't handle negative or differing x:y clearance values (the
// when a relative paste margin is used with an oblong pad). So we apply this huge hack and // former are common for solder paste whiel the later get generated when a relative paste
// fake a larger pad to run the general-purpose polygon builder on. // margin is used with an oblong pad). So we apply this huge hack and fake a larger pad to
// run the general-purpose polygon builder on.
// Of course being a hack it falls down when dealing with custom shape pads (where the size // Of course being a hack it falls down when dealing with custom shape pads (where the size
// is only the size of the anchor), so for those we punt and just use aClearanceValue.x. // is only the size of the anchor), so for those we punt and just use aClearanceValue.x.
if( aClearanceValue.x != aClearanceValue.y && aPad->GetShape() != PAD_SHAPE_CUSTOM ) if( ( aClearanceValue.x < 0 || aClearanceValue.x != aClearanceValue.y )
&& aPad->GetShape() != PAD_SHAPE_CUSTOM )
{ {
D_PAD dummy( *aPad ); D_PAD dummy( *aPad );
dummy.SetSize( aPad->GetSize() + aClearanceValue + aClearanceValue ); dummy.SetSize( aPad->GetSize() + aClearanceValue + aClearanceValue );
@ -459,8 +461,6 @@ void BOARD_ADAPTER::AddPadsShapesWithClearanceToContainer( const MODULE* aModule
int aInflateValue, int aInflateValue,
bool aSkipNPTHPadsWihNoCopper ) bool aSkipNPTHPadsWihNoCopper )
{ {
wxSize margin;
for( D_PAD* pad : aModule->Pads() ) for( D_PAD* pad : aModule->Pads() )
{ {
if( !pad->IsOnLayer( aLayerId ) ) if( !pad->IsOnLayer( aLayerId ) )
@ -495,22 +495,22 @@ void BOARD_ADAPTER::AddPadsShapesWithClearanceToContainer( const MODULE* aModule
} }
} }
wxSize margin( aInflateValue, aInflateValue );
switch( aLayerId ) switch( aLayerId )
{ {
case F_Mask: case F_Mask:
case B_Mask: case B_Mask:
margin.x = margin.y = pad->GetSolderMaskMargin() + aInflateValue; margin.x += pad->GetSolderMaskMargin();
margin.y += pad->GetSolderMaskMargin();
break; break;
case F_Paste: case F_Paste:
case B_Paste: case B_Paste:
margin = pad->GetSolderPasteMargin(); margin += pad->GetSolderPasteMargin();
margin.x += aInflateValue;
margin.y += aInflateValue;
break; break;
default: default:
margin.x = margin.y = aInflateValue;
break; break;
} }

View File

@ -178,7 +178,8 @@ void MODULE::TransformPadsShapesWithClearanceToPolygon( PCB_LAYER_ID aLayer,
// Of course being a hack it falls down when dealing with custom shape pads (where the // Of course being a hack it falls down when dealing with custom shape pads (where the
// size is only the size of the anchor), so for those we punt and just use clearance.x. // size is only the size of the anchor), so for those we punt and just use clearance.x.
if( clearance.x != clearance.y && pad->GetShape() != PAD_SHAPE_CUSTOM ) if( ( clearance.x < 0 || clearance.x != clearance.y )
&& pad->GetShape() != PAD_SHAPE_CUSTOM )
{ {
D_PAD dummy( *pad ); D_PAD dummy( *pad );
dummy.SetSize( pad->GetSize() + clearance + clearance ); dummy.SetSize( pad->GetSize() + clearance + clearance );