Only clean up tracks completely inside pads.

Fixes https://gitlab.com/kicad/code/kicad/issues/5093
This commit is contained in:
Jeff Young 2020-08-06 21:52:24 +01:00
parent 76bd344730
commit ea1be41ff0
1 changed files with 12 additions and 4 deletions

View File

@ -329,6 +329,13 @@ void TRACKS_CLEANER::deleteTracksInPads()
for( D_PAD* pad : connectivity->GetConnectedPads( track ) )
{
if( pad->HitTest( track->GetStart() ) && pad->HitTest( track->GetEnd() ) )
{
SHAPE_POLY_SET poly;
track->TransformShapeWithClearanceToPolygon( poly, 0 );
poly.BooleanSubtract( *pad->GetEffectivePolygon(), SHAPE_POLY_SET::PM_FAST );
if( poly.IsEmpty() )
{
CLEANUP_ITEM* item = new CLEANUP_ITEM( CLEANUP_TRACK_IN_PAD );
item->SetItems( track );
@ -338,6 +345,7 @@ void TRACKS_CLEANER::deleteTracksInPads()
}
}
}
}
if( !m_dryRun )
removeItems( toRemove );