49 largestPhysicalClearance = worstConstraint.
GetValue().
Min();
52 largestPhysicalClearance = std::max( largestPhysicalClearance, worstConstraint.
GetValue().
Min() );
54 std::set<ZONE*> allZones;
58 allZones.insert( zone );
60 if( !zone->GetIsRuleArea() )
64 if( ( zone->GetLayerSet() & boardCopperLayers ).any() )
73 for(
ZONE* zone : footprint->Zones() )
75 allZones.insert( zone );
77 if( !zone->GetIsRuleArea() )
81 if( ( zone->GetLayerSet() & boardCopperLayers ).any() )
88 std::atomic<size_t> done( 1 );
97 auto addToCopperTree =
103 LSET copperLayers = item->GetLayerSet() & boardCopperLayers;
111 copperLayers = boardCopperLayers;
127 static const std::vector<KICAD_T> itemTypes = {
137 std::future<void> retn =
tp.submit(
148 std::future_status status = retn.wait_for( std::chrono::milliseconds( 250 ) );
150 while( status != std::future_status::ready )
153 status = retn.wait_for( std::chrono::milliseconds( 250 ) );
156 if( !
reportPhase(
_(
"Tessellating copper zones..." ) ) )
164 footprint->BuildCourtyardCaches();
165 footprint->BuildNetTieCache();
168 std::vector<std::future<size_t>> returns;
170 returns.reserve( allZones.size() );
173 [
this, &done](
ZONE* aZone ) ->
size_t
178 aZone->CacheBoundingBox();
179 aZone->CacheTriangulation();
181 if( !aZone->GetIsRuleArea() && aZone->IsOnCopperLayer() )
183 std::unique_ptr<DRC_RTREE> rtree = std::make_unique<DRC_RTREE>();
185 aZone->GetLayerSet().RunOnLayers(
189 rtree->Insert( aZone, layer );
203 for(
ZONE* zone : allZones )
204 returns.emplace_back(
tp.submit( cache_zones, zone ) );
208 for(
const std::future<size_t>& ret : returns )
210 status = ret.wait_for( std::chrono::milliseconds( 250 ) );
212 while( status != std::future_status::ready )
215 status = ret.wait_for( std::chrono::milliseconds( 250 ) );
223 if( !zone->GetIsRuleArea() && !zone->IsTeardropArea() )
225 zone->GetLayerSet().RunOnLayers(
235 connectivity->ClearRatsnest();
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
std::map< ZONE *, std::map< PCB_LAYER_ID, ISOLATED_ISLANDS > > m_ZoneIsolatedIslandsMap
std::vector< ZONE * > m_DRCCopperZones
const ZONES & Zones() const
int GetMaxClearanceValue() const
Returns the maximum clearance value for any object on the board.
int GetCopperLayerCount() const
const FOOTPRINTS & Footprints() const
int m_DRCMaxPhysicalClearance
std::shared_ptr< DRC_RTREE > m_CopperItemRTreeCache
std::unordered_map< ZONE *, std::unique_ptr< DRC_RTREE > > m_CopperZoneRTreeCache
std::vector< ZONE * > m_DRCZones
std::shared_mutex m_CachesMutex
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
const MINOPTMAX< int > & GetValue() const
PROGRESS_REPORTER * GetProgressReporter() const
bool QueryWorstConstraint(DRC_CONSTRAINT_T aRuleId, DRC_CONSTRAINT &aConstraint)
virtual bool reportPhase(const wxString &aStageName)
int forEachGeometryItem(const std::vector< KICAD_T > &aTypes, LSET aLayers, const std::function< bool(BOARD_ITEM *)> &aFunc)
virtual bool reportProgress(size_t aCount, size_t aSize, size_t aDelta=1)
LSET is a set of PCB_LAYER_IDs.
void RunOnLayers(const std::function< void(PCB_LAYER_ID)> &aFunction) const
Execute a function on each layer of the LSET.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Handle a list of polygons defining a copper zone.
@ PHYSICAL_HOLE_CLEARANCE_CONSTRAINT
@ PHYSICAL_CLEARANCE_CONSTRAINT
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
A struct recording the isolated and single-pad islands within a zone.
BS::thread_pool thread_pool
thread_pool & GetKiCadThreadPool()
Get a reference to the current thread pool.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)