48 largestPhysicalClearance = worstConstraint.
GetValue().
Min();
51 largestPhysicalClearance = std::max( largestPhysicalClearance, worstConstraint.
GetValue().
Min() );
54 largestClearance = std::min( largestClearance, INT_MAX / 3 );
55 largestPhysicalClearance = std::min( largestPhysicalClearance, INT_MAX / 3 );
57 std::set<ZONE*> allZones;
60 [](
ZONE* zone,
const LSET& copperLayers )
67 fill->BuildBBoxCaches();
73 allZones.insert( zone );
81 if( zoneCopperLayers.any() )
83 cacheBBoxes( zone, zoneCopperLayers );
91 for(
ZONE* zone : footprint->Zones() )
93 allZones.insert( zone );
101 if( zoneCopperLayers.any() )
103 cacheBBoxes( zone, zoneCopperLayers );
111 std::atomic<size_t> done( 1 );
120 auto addToCopperTree =
126 LSET copperLayers = item->GetLayerSet() & boardCopperLayers;
134 copperLayers = boardCopperLayers;
150 static const std::vector<KICAD_T> itemTypes = {
161 std::future<void> retn =
tp.submit(
172 std::future_status status = retn.wait_for( std::chrono::milliseconds( 250 ) );
174 while( status != std::future_status::ready )
177 status = retn.wait_for( std::chrono::milliseconds( 250 ) );
180 if( !
reportPhase(
_(
"Tessellating copper zones..." ) ) )
188 footprint->BuildCourtyardCaches();
189 footprint->BuildNetTieCache();
192 std::vector<std::future<size_t>> returns;
194 returns.reserve( allZones.size() );
197 [
this, &done](
ZONE* aZone ) ->
size_t
202 aZone->CacheBoundingBox();
203 aZone->CacheTriangulation();
205 if( !aZone->GetIsRuleArea() && aZone->IsOnCopperLayer() )
207 std::unique_ptr<DRC_RTREE> rtree = std::make_unique<DRC_RTREE>();
209 aZone->GetLayerSet().RunOnLayers(
213 rtree->Insert( aZone, layer );
227 for(
ZONE* zone : allZones )
228 returns.emplace_back(
tp.submit( cache_zones, zone ) );
232 for(
const std::future<size_t>& ret : returns )
234 status = ret.wait_for( std::chrono::milliseconds( 250 ) );
236 while( status != std::future_status::ready )
239 status = ret.wait_for( std::chrono::milliseconds( 250 ) );
259 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, const 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()
return AllCuMask( MAX_CU_LAYERS );
Represent a set of closed polygons.
void BuildBBoxCaches() const
Construct BBoxCaches for Contains(), below.
Handle a list of polygons defining a copper zone.
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
SHAPE_POLY_SET * Outline()
SHAPE_POLY_SET * GetFill(PCB_LAYER_ID aLayer)
bool IsTeardropArea() const
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
@ PHYSICAL_HOLE_CLEARANCE_CONSTRAINT
@ PHYSICAL_CLEARANCE_CONSTRAINT
bool IsCopperLayer(int aLayerId)
Test 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_FIELD_T
class PCB_FIELD, text associated with a footprint property
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
@ 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_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)