From f87cb64d650827cfc6ffdf95a163c209b7c59008 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 10 Jul 2018 12:22:36 -0700 Subject: [PATCH] pcbnew: Ensure connectivity layers are respected This prevents non-copper layers from being included in the connectivity search. It also limits the layer search in the connectivity RTree to just the copper layer range. --- pcbnew/connectivity_algo.cpp | 3 +++ pcbnew/connectivity_algo.h | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pcbnew/connectivity_algo.cpp b/pcbnew/connectivity_algo.cpp index 00ed1b1011..3a3bde78f5 100644 --- a/pcbnew/connectivity_algo.cpp +++ b/pcbnew/connectivity_algo.cpp @@ -233,6 +233,9 @@ void CN_CONNECTIVITY_ALGO::markItemNetAsDirty( const BOARD_ITEM* aItem ) bool CN_CONNECTIVITY_ALGO::Add( BOARD_ITEM* aItem ) { + if( !IsCopperLayer( aItem->GetLayer() ) ) + return false; + markItemNetAsDirty ( aItem ); switch( aItem->Type() ) diff --git a/pcbnew/connectivity_algo.h b/pcbnew/connectivity_algo.h index f8051d5b1a..2e54b0474a 100644 --- a/pcbnew/connectivity_algo.h +++ b/pcbnew/connectivity_algo.h @@ -555,7 +555,7 @@ public: { auto item = new CN_ITEM( pad, false, 1 ); item->AddAnchor( pad->ShapePos() ); - item->SetLayers( LAYER_RANGE( 0, PCB_LAYER_ID_COUNT ) ); + item->SetLayers( LAYER_RANGE( F_Cu, B_Cu ) ); switch( pad->GetAttribute() ) { @@ -573,6 +573,7 @@ public: break; } } + break; } default: break; @@ -602,7 +603,7 @@ public: m_items.push_back( item ); item->AddAnchor( via->GetStart() ); - item->SetLayers( LAYER_RANGE( 0, PCB_LAYER_ID_COUNT ) ); + item->SetLayers( LAYER_RANGE( F_Cu, B_Cu ) ); addItemtoTree( item ); SetDirty(); return item;