Process clearance rules for plated holes in router.
Also makes sure the clearance is shown for a collision, even if the preference for showing clearances is off. Fixes https://gitlab.com/kicad/code/kicad/-/issues/18078
This commit is contained in:
parent
81efc7778a
commit
d5c3a4036c
|
@ -536,7 +536,9 @@ int PNS_PCBNEW_RULE_RESOLVER::Clearance( const PNS::ITEM* aA, const PNS::ITEM* a
|
||||||
rv = constraint.m_Value.Min();
|
rv = constraint.m_Value.Min();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( isCopper( aA ) && ( !aB || isCopper( aB ) ) )
|
|
||||||
|
// No 'else'; plated holes get both HOLE_CLEARANCE and CLEARANCE
|
||||||
|
if( isCopper( aA ) && ( !aB || isCopper( aB ) ) )
|
||||||
{
|
{
|
||||||
if( QueryConstraint( PNS::CONSTRAINT_TYPE::CT_CLEARANCE, aA, aB, layer, &constraint ) )
|
if( QueryConstraint( PNS::CONSTRAINT_TYPE::CT_CLEARANCE, aA, aB, layer, &constraint ) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,6 +256,7 @@ void ROUTER_PREVIEW_ITEM::drawLineChain( const SHAPE_LINE_CHAIN_BASE* aL, KIGFX:
|
||||||
void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) const
|
void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) const
|
||||||
{
|
{
|
||||||
bool holeDrawn = false;
|
bool holeDrawn = false;
|
||||||
|
bool showClearance = m_showClearance || ( m_flags | PNS_COLLISION ) > 0;
|
||||||
|
|
||||||
switch( aShape->Type() )
|
switch( aShape->Type() )
|
||||||
{
|
{
|
||||||
|
@ -263,7 +264,7 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons
|
||||||
{
|
{
|
||||||
const SHAPE_LINE_CHAIN_BASE* l = (const SHAPE_LINE_CHAIN_BASE*) aShape;
|
const SHAPE_LINE_CHAIN_BASE* l = (const SHAPE_LINE_CHAIN_BASE*) aShape;
|
||||||
|
|
||||||
if( m_showClearance && m_clearance > 0 )
|
if( showClearance && m_clearance > 0 )
|
||||||
{
|
{
|
||||||
gal->SetLineWidth( m_width + 2 * m_clearance );
|
gal->SetLineWidth( m_width + 2 * m_clearance );
|
||||||
drawLineChain( l, gal );
|
drawLineChain( l, gal );
|
||||||
|
@ -282,7 +283,7 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons
|
||||||
const SHAPE_LINE_CHAIN* l = (const SHAPE_LINE_CHAIN*) aShape;
|
const SHAPE_LINE_CHAIN* l = (const SHAPE_LINE_CHAIN*) aShape;
|
||||||
const int w = m_width;
|
const int w = m_width;
|
||||||
|
|
||||||
if( m_showClearance && m_clearance > 0 )
|
if( showClearance && m_clearance > 0 )
|
||||||
{
|
{
|
||||||
gal->SetLineWidth( w + 2 * m_clearance );
|
gal->SetLineWidth( w + 2 * m_clearance );
|
||||||
drawLineChain( l, gal );
|
drawLineChain( l, gal );
|
||||||
|
@ -303,7 +304,7 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons
|
||||||
|
|
||||||
gal->SetIsStroke( false );
|
gal->SetIsStroke( false );
|
||||||
|
|
||||||
if( m_showClearance && m_clearance > 0 )
|
if( showClearance && m_clearance > 0 )
|
||||||
{
|
{
|
||||||
gal->SetLineWidth( w + 2 * m_clearance );
|
gal->SetLineWidth( w + 2 * m_clearance );
|
||||||
gal->DrawSegment( s->GetSeg().A, s->GetSeg().B, s->GetWidth() + 2 * m_clearance );
|
gal->DrawSegment( s->GetSeg().A, s->GetSeg().B, s->GetWidth() + 2 * m_clearance );
|
||||||
|
@ -321,7 +322,7 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons
|
||||||
const SHAPE_CIRCLE* c = static_cast<const SHAPE_CIRCLE*>( aShape );
|
const SHAPE_CIRCLE* c = static_cast<const SHAPE_CIRCLE*>( aShape );
|
||||||
gal->SetStrokeColor( m_color );
|
gal->SetStrokeColor( m_color );
|
||||||
|
|
||||||
if( m_showClearance && m_clearance > 0 )
|
if( showClearance && m_clearance > 0 )
|
||||||
{
|
{
|
||||||
gal->SetIsStroke( false );
|
gal->SetIsStroke( false );
|
||||||
gal->DrawCircle( c->GetCenter(), c->GetRadius() + m_clearance );
|
gal->DrawCircle( c->GetCenter(), c->GetRadius() + m_clearance );
|
||||||
|
@ -357,7 +358,7 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons
|
||||||
const SHAPE_RECT* r = (const SHAPE_RECT*) aShape;
|
const SHAPE_RECT* r = (const SHAPE_RECT*) aShape;
|
||||||
gal->SetFillColor( m_color );
|
gal->SetFillColor( m_color );
|
||||||
|
|
||||||
if( m_showClearance && m_clearance > 0 )
|
if( showClearance && m_clearance > 0 )
|
||||||
{
|
{
|
||||||
VECTOR2I p0( r->GetPosition() ), s( r->GetSize() );
|
VECTOR2I p0( r->GetPosition() ), s( r->GetSize() );
|
||||||
gal->SetIsStroke( true );
|
gal->SetIsStroke( true );
|
||||||
|
@ -389,7 +390,7 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons
|
||||||
|
|
||||||
gal->SetFillColor( m_color );
|
gal->SetFillColor( m_color );
|
||||||
|
|
||||||
if( m_showClearance && m_clearance > 0 )
|
if( showClearance && m_clearance > 0 )
|
||||||
{
|
{
|
||||||
gal->SetIsStroke( true );
|
gal->SetIsStroke( true );
|
||||||
gal->SetLineWidth( 2 * m_clearance );
|
gal->SetLineWidth( 2 * m_clearance );
|
||||||
|
@ -417,7 +418,7 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons
|
||||||
gal->SetIsFill( false );
|
gal->SetIsFill( false );
|
||||||
gal->SetIsStroke( true );
|
gal->SetIsStroke( true );
|
||||||
|
|
||||||
if( m_showClearance && m_clearance > 0 )
|
if( showClearance && m_clearance > 0 )
|
||||||
{
|
{
|
||||||
gal->SetLineWidth( w + 2 * m_clearance );
|
gal->SetLineWidth( w + 2 * m_clearance );
|
||||||
gal->DrawArc( arc->GetCenter(), arc->GetRadius(), start_angle, angle );
|
gal->DrawArc( arc->GetCenter(), arc->GetRadius(), start_angle, angle );
|
||||||
|
|
Loading…
Reference in New Issue