44 m_largestClearance = worstConstraint.
GetValue().
Min();
47 m_largestClearance = std::max( m_largestClearance, worstConstraint.
GetValue().
Min() );
50 m_largestPhysicalClearance = worstConstraint.
GetValue().
Min();
53 m_largestPhysicalClearance = std::max( m_largestPhysicalClearance, worstConstraint.
GetValue().
Min() );
55 std::set<ZONE*> allZones;
59 allZones.insert( zone );
61 if( !zone->GetIsRuleArea() )
65 if( ( zone->GetLayerSet() & boardCopperLayers ).any() )
68 m_largestClearance = std::max( m_largestClearance, zone->GetLocalClearance() );
75 for(
PAD*
pad : footprint->Pads() )
76 m_largestClearance = std::max( m_largestClearance,
pad->GetLocalClearance() );
78 for(
ZONE* zone : footprint->Zones() )
80 allZones.insert( zone );
82 if( !zone->GetIsRuleArea() )
86 if( ( zone->GetLayerSet() & boardCopperLayers ).any() )
89 m_largestClearance = std::max( m_largestClearance, zone->GetLocalClearance() );
96 size_t progressDelta = 200;
107 auto addToCopperTree =
113 LSET copperLayers = item->GetLayerSet() & boardCopperLayers;
121 copperLayers = boardCopperLayers;
136 static const std::vector<KICAD_T> itemTypes = {
155 if( !
reportPhase(
_(
"Tessellating copper zones..." ) ) )
162 footprint->BuildCourtyardCaches();
165 std::vector<std::future<size_t>> returns;
166 std::atomic<size_t> done( 1 );
168 returns.reserve( allZones.size() );
171 [
this, &done](
ZONE* aZone ) ->
size_t
176 aZone->CacheBoundingBox();
177 aZone->CacheTriangulation();
179 if( !aZone->GetIsRuleArea() && aZone->IsOnCopperLayer() )
181 std::unique_ptr<DRC_RTREE> rtree = std::make_unique<DRC_RTREE>();
186 rtree->Insert( aZone, layer );
198 for(
ZONE* zone : allZones )
199 returns.emplace_back(
tp.submit( cache_zones, zone ) );
201 for(
const std::future<size_t>& ret : returns )
203 std::future_status status = ret.wait_for( std::chrono::milliseconds( 250 ) );
205 while( status != std::future_status::ready )
208 status = ret.wait_for( std::chrono::milliseconds( 250 ) );
216 if( !zone->GetIsRuleArea() && !zone->IsTeardropArea() )
225 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
FOOTPRINTS & Footprints()
int GetCopperLayerCount() 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_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
bool ReportProgress(double aProgress)
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(int aCount, int aSize, int aDelta)
LSET is a set of PCB_LAYER_IDs.
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
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
@ 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.
thread_pool & GetKiCadThreadPool()
Get a reference to the current thread pool.
BS::thread_pool 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_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)