PNS: Don't clip tuning paths to pads on other layers

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8504
This commit is contained in:
Jon Evans 2021-05-29 15:52:44 -04:00
parent f6d6b7d263
commit 3eb5a484e1
1 changed files with 11 additions and 3 deletions

View File

@ -384,7 +384,7 @@ const ITEM_SET TOPOLOGY::AssembleTuningPath( ITEM* aStart, SOLID** aStartPad, SO
};
auto processPad =
[&]( PAD* aPad )
[&]( JOINT* aJoint, PAD* aPad )
{
const std::shared_ptr<SHAPE_POLY_SET>& shape = aPad->GetEffectivePolygon();
@ -395,6 +395,14 @@ const ITEM_SET TOPOLOGY::AssembleTuningPath( ITEM* aStart, SOLID** aStartPad, SO
LINE* line = static_cast<LINE*>( initialPath[idx] );
if( !aPad->FlashLayer( line->Layer() ) )
continue;
const std::vector<VECTOR2I>& points = line->CLine().CPoints();
if( points.front() != aJoint->Pos() && points.back() != aJoint->Pos() )
continue;
SHAPE_LINE_CHAIN& slc = line->Line();
if( shape->Contains( slc.CPoint( 0 ) ) )
@ -405,10 +413,10 @@ const ITEM_SET TOPOLOGY::AssembleTuningPath( ITEM* aStart, SOLID** aStartPad, SO
};
if( padA )
processPad( padA );
processPad( joints.first, padA );
if( padB )
processPad( padB );
processPad( joints.second, padB );
return initialPath;
}