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 )
|
if( parentA )
|
||||||
{
|
{
|
||||||
parentA->SetLayer( (PCB_LAYER_ID) aLayer );
|
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 )
|
if( parentB )
|
||||||
{
|
{
|
||||||
parentB->SetLayer( (PCB_LAYER_ID) aLayer );
|
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 we are allowing DRC violations, we don't push back to the hull
|
||||||
if( !Settings().CanViolateDRC() )
|
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 )
|
for( OBSTACLE& obs : obstacles )
|
||||||
{
|
{
|
||||||
int cl = m_currentNode->GetClearance( obs.m_item, &newHead );
|
if( m_placingVia )
|
||||||
const SHAPE_LINE_CHAIN hull = obs.m_item->Hull( cl, newHead.Width(), newHead.Layer() );
|
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 );
|
Dbg()->AddLine( hull, 2, 10000 );
|
||||||
|
|
||||||
if( ( nearest - aP ).EuclideanNorm() < newHead.Width() + cl )
|
if( ( nearest - aP ).EuclideanNorm() < lineWidth + clearance )
|
||||||
{
|
{
|
||||||
buildInitialLine( nearest, newHead );
|
buildInitialLine( nearest, newHead );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue