From c9f11827a7a093b60c71716bd9d3713ea0d4e8a6 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 11 Oct 2022 15:02:22 -0700 Subject: [PATCH] Don't connect disparate nets Only some elements get their nets assigned based on connectivity. Other elements should be keps in different clusters for connection Fixes https://gitlab.com/kicad/code/kicad/issues/12622 --- pcbnew/connectivity/connectivity_algo.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pcbnew/connectivity/connectivity_algo.cpp b/pcbnew/connectivity/connectivity_algo.cpp index eb93375468..c68037d3b8 100644 --- a/pcbnew/connectivity/connectivity_algo.cpp +++ b/pcbnew/connectivity/connectivity_algo.cpp @@ -745,9 +745,6 @@ void CN_CONNECTIVITY_ALGO::MarkNetAsDirty( int aNet ) void CN_VISITOR::checkZoneItemConnection( CN_ZONE_LAYER* aZoneLayer, CN_ITEM* aItem ) { - if( aZoneLayer->Net() != aItem->Net() && !aItem->CanChangeNet() ) - return; - PCB_LAYER_ID layer = aZoneLayer->GetLayer(); if( !aItem->Parent()->IsOnLayer( layer ) ) @@ -789,9 +786,6 @@ void CN_VISITOR::checkZoneZoneConnection( CN_ZONE_LAYER* aZoneLayerA, CN_ZONE_LA const ZONE* zoneA = static_cast( aZoneLayerA->Parent() ); const ZONE* zoneB = static_cast( aZoneLayerB->Parent() ); - if( aZoneLayerB->Net() != aZoneLayerA->Net() ) - return; // we only test zones belonging to the same net - const BOX2I& boxA = aZoneLayerA->BBox(); const BOX2I& boxB = aZoneLayerB->BBox(); @@ -848,6 +842,10 @@ bool CN_VISITOR::operator()( CN_ITEM* aCandidate ) if( parentA == parentB ) return true; + // Don't connect items in different nets that can't be changed + if( !aCandidate->CanChangeNet() && !m_item->CanChangeNet() && aCandidate->Net() != m_item->Net() ) + return true; + // If both m_item and aCandidate are marked dirty, they will both be searched // Since we are reciprocal in our connection, we arbitrarily pick one of the connections // to conduct the expensive search