Honour m_placingVia when avoiding collisions.
Fixes https://gitlab.com/kicad/code/kicad/issues/3773
This commit is contained in:
parent
e8f38e3c18
commit
cd162a8f58
|
@ -233,7 +233,7 @@ bool PNS_PCBNEW_RULE_RESOLVER::QueryConstraint( PNS::CONSTRAINT_TYPE aType,
|
|||
if( parentA )
|
||||
{
|
||||
parentA->SetLayer( (PCB_LAYER_ID) aLayer );
|
||||
static_cast<BOARD_CONNECTED_ITEM*>( parentA )->SetNetCode( aItemA->Net() );
|
||||
static_cast<BOARD_CONNECTED_ITEM*>( parentA )->SetNetCode( aItemA->Net(), true );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ bool PNS_PCBNEW_RULE_RESOLVER::QueryConstraint( PNS::CONSTRAINT_TYPE aType,
|
|||
if( parentB )
|
||||
{
|
||||
parentB->SetLayer( (PCB_LAYER_ID) aLayer );
|
||||
static_cast<BOARD_CONNECTED_ITEM*>( parentB )->SetNetCode( aItemB->Net() );
|
||||
static_cast<BOARD_CONNECTED_ITEM*>( parentB )->SetNetCode( aItemB->Net(), true );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -490,15 +490,23 @@ bool LINE_PLACER::rhMarkObstacles( const VECTOR2I& aP, LINE& aNewHead )
|
|||
// If we are allowing DRC violations, we don't push back to the hull
|
||||
if( !Settings().CanViolateDRC() )
|
||||
{
|
||||
int layer = m_head.Layer();
|
||||
int lineWidth = m_placingVia ? m_head.Via().Diameter() : m_head.Width();
|
||||
int clearance;
|
||||
|
||||
for( OBSTACLE& obs : obstacles )
|
||||
{
|
||||
int cl = m_currentNode->GetClearance( obs.m_item, &newHead );
|
||||
const SHAPE_LINE_CHAIN hull = obs.m_item->Hull( cl, newHead.Width(), newHead.Layer() );
|
||||
if( m_placingVia )
|
||||
clearance = m_currentNode->GetClearance( obs.m_item, &m_head.Via() );
|
||||
else
|
||||
clearance = m_currentNode->GetClearance( obs.m_item, &m_head );
|
||||
|
||||
const SHAPE_LINE_CHAIN hull = obs.m_item->Hull( clearance, lineWidth, layer );
|
||||
VECTOR2I nearest = hull.NearestPoint( aP );
|
||||
|
||||
VECTOR2I nearest = hull.NearestPoint( aP );
|
||||
Dbg()->AddLine( hull, 2, 10000 );
|
||||
|
||||
if( ( nearest - aP ).EuclideanNorm() < newHead.Width() + cl )
|
||||
if( ( nearest - aP ).EuclideanNorm() < lineWidth + clearance )
|
||||
{
|
||||
buildInitialLine( nearest, newHead );
|
||||
|
||||
|
|
Loading…
Reference in New Issue