Don't let zone cutout on different layer confuse us about intersections.
Fixes https://gitlab.com/kicad/code/kicad/issues/10583
This commit is contained in:
parent
091055fa1d
commit
3c5ae6d317
|
@ -106,16 +106,21 @@ bool DRC_TEST_PROVIDER_ZONE_CONNECTIONS::Run()
|
||||||
if( m_drcEngine->IsErrorLimitExceeded( DRCE_STARVED_THERMAL ) )
|
if( m_drcEngine->IsErrorLimitExceeded( DRCE_STARVED_THERMAL ) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Quick test for "connected":
|
// Quick tests for "connected":
|
||||||
|
//
|
||||||
|
if( !pad->FlashLayer( layer ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
if( pad->GetNetCode() != zone->GetNetCode() || pad->GetNetCode() <= 0 )
|
if( pad->GetNetCode() != zone->GetNetCode() || pad->GetNetCode() <= 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// More thorough test for "connected", but still not layer-specific:
|
EDA_RECT item_boundingbox = pad->GetBoundingBox();
|
||||||
const KICAD_T type_zone[] = { PCB_ZONE_T, EOT };
|
|
||||||
|
|
||||||
if( !alg::contains( connectivity->GetConnectedItems( pad, type_zone ), zone ) )
|
if( !item_boundingbox.Intersects( zone->GetCachedBoundingBox() ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// If those passed, do a thorough test:
|
||||||
|
//
|
||||||
constraint = bds.m_DRCEngine->EvalZoneConnection( pad, zone, layer );
|
constraint = bds.m_DRCEngine->EvalZoneConnection( pad, zone, layer );
|
||||||
ZONE_CONNECTION conn = constraint.m_ZoneConnection;
|
ZONE_CONNECTION conn = constraint.m_ZoneConnection;
|
||||||
|
|
||||||
|
@ -142,10 +147,12 @@ bool DRC_TEST_PROVIDER_ZONE_CONNECTIONS::Run()
|
||||||
|
|
||||||
spokes += intersections.size() / 2;
|
spokes += intersections.size() / 2;
|
||||||
|
|
||||||
// This is our final "connected" test.
|
|
||||||
if( spokes <= 0 )
|
if( spokes <= 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Now we know we're connected, so see if there are any other manual spokes
|
||||||
|
// added:
|
||||||
|
//
|
||||||
for( PCB_TRACK* track : connectivity->GetConnectedTracks( pad ) )
|
for( PCB_TRACK* track : connectivity->GetConnectedTracks( pad ) )
|
||||||
{
|
{
|
||||||
if( padOutline.PointInside( track->GetStart() ) )
|
if( padOutline.PointInside( track->GetStart() ) )
|
||||||
|
@ -160,6 +167,8 @@ bool DRC_TEST_PROVIDER_ZONE_CONNECTIONS::Run()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// And finally report it if there aren't enough:
|
||||||
|
//
|
||||||
if( spokes < minCount )
|
if( spokes < minCount )
|
||||||
{
|
{
|
||||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_STARVED_THERMAL );
|
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_STARVED_THERMAL );
|
||||||
|
|
Loading…
Reference in New Issue