46 largestPhysicalClearance = worstConstraint.
GetValue().
Min();
49 largestPhysicalClearance = std::max( largestPhysicalClearance, worstConstraint.
GetValue().
Min() );
51 std::set<ZONE*> allZones;
55 allZones.insert( zone );
57 if( !zone->GetIsRuleArea() )
61 if( ( zone->GetLayerSet() & boardCopperLayers ).any() )
70 for(
ZONE* zone : footprint->Zones() )
72 allZones.insert( zone );
74 if( !zone->GetIsRuleArea() )
78 if( ( zone->GetLayerSet() & boardCopperLayers ).any() )
85 size_t progressDelta = 200;
96 auto addToCopperTree =
102 LSET copperLayers = item->GetLayerSet() & boardCopperLayers;
110 copperLayers = boardCopperLayers;
125 static const std::vector<KICAD_T> itemTypes = {
144 if( !
reportPhase(
_(
"Tessellating copper zones..." ) ) )
151 footprint->BuildCourtyardCaches();
154 std::vector<std::future<size_t>> returns;
155 std::atomic<size_t> done( 1 );
157 returns.reserve( allZones.size() );
160 [
this, &done](
ZONE* aZone ) ->
size_t
165 aZone->CacheBoundingBox();
166 aZone->CacheTriangulation();
168 if( !aZone->GetIsRuleArea() && aZone->IsOnCopperLayer() )
170 std::unique_ptr<DRC_RTREE> rtree = std::make_unique<DRC_RTREE>();
175 rtree->Insert( aZone, layer );
187 for(
ZONE* zone : allZones )
188 returns.emplace_back(
tp.submit( cache_zones, zone ) );
190 for(
const std::future<size_t>& ret : returns )
192 std::future_status status = ret.wait_for( std::chrono::milliseconds( 250 ) );
194 while( status != std::future_status::ready )
197 status = ret.wait_for( std::chrono::milliseconds( 250 ) );
205 if( !zone->GetIsRuleArea() && !zone->IsTeardropArea() )
214 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
int GetMaxClearanceValue() const
Returns the maximum clearance value for any object on the board.
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
@ 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)