25#include <math_for_graphics.h>
74 virtual bool Run()
override;
76 virtual const wxString
GetName()
const override
78 return wxT(
"clearance" );
83 return wxT(
"Tests copper item clearance" );
135 reportAux( wxT(
"No Clearance constraints found. Tests not run." ) );
143 if( !
reportPhase(
_(
"Checking track & via clearances..." ) ) )
150 if( !
reportPhase(
_(
"Checking hole clearances..." ) ) )
174 if( !
reportPhase(
_(
"Checking copper graphic clearances..." ) ) )
182 if( !
reportPhase(
_(
"Checking copper zone clearances..." ) ) )
213 bool has_error =
false;
218 net = connectedItem->GetNet();
223 otherNet = connectedItem->GetNet();
226 SHAPE* otherShape = otherShapeStorage.get();
232 if(
pad->GetAttribute() == PAD_ATTRIB::NPTH && !
pad->FlashLayer( layer ) )
233 testClearance = testShorting =
false;
236 if( testClearance || testShorting )
248 std::swap( item, other );
249 std::swap( itemShape, otherShape );
250 std::swap( net, otherNet );
265 drcItem->SetItems( item, other );
281 else if( actual == 0 && otherNet && testShorting )
288 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) + msg );
289 drce->SetItems( item, other );
297 else if( testClearance )
300 wxString msg =
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
305 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) + msg );
306 drce->SetItems( item, other );
320 std::array<BOARD_ITEM*, 2> a{ item, other };
321 std::array<BOARD_ITEM*, 2> b{ other, item };
322 std::array<SHAPE*, 2> a_shape{ itemShape, otherShape };
324 for(
size_t ii = 0; ii < 2; ++ii )
326 std::shared_ptr<SHAPE_SEGMENT> holeShape;
330 if( !(
dynamic_cast<PCB_TRACK*
>( a[ii] ) ) || !b[ii]->HasHole() )
337 if( b[ii]->GetLayerSet().Contains( layer ) )
338 holeShape = b[ii]->GetEffectiveHoleShape();
342 holeShape = b[ii]->GetEffectiveHoleShape();
356 wxString msg =
formatMsg( clearance ?
_(
"(%s clearance %s; actual %s)" )
357 :
_(
"(%s clearance %s; actual < 0)" ),
362 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) + msg );
363 drce->SetItems( a[ii], b[ii] );
390 BOX2I worstCaseBBox = itemBBox;
402 std::set<PAD*> allowedNetTiePads;
408 if(
pad->IsOnLayer( aLayer ) )
409 allowedNetTiePads.insert(
pad );
413 if( other->IsOnLayer( aLayer ) )
414 allowedNetTiePads.insert( other );
419 if( !allowedNetTiePads.empty() )
423 for(
PAD*
pad : allowedNetTiePads )
425 if(
pad->GetBoundingBox().Intersects( itemBBox )
426 &&
pad->GetEffectiveShape( aLayer )->Collide( itemShape.get() ) )
437 if( !testClearance && !testHoles )
453 bool flashedPad =
pad->FlashLayer( aLayer );
454 bool platedHole =
pad->HasHole() &&
pad->GetAttribute() == PAD_ATTRIB::PTH;
456 if( !flashedPad && !platedHole )
457 testClearance =
false;
468 std::shared_ptr<SHAPE> itemShape = aItem->
GetEffectiveShape( aLayer, FLASHING::DEFAULT );
471 std::max( 0, clearance -
m_drcEpsilon ), &actual, &pos ) )
474 wxString msg =
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
479 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) + msg );
480 drce->SetItems( aItem, aZone );
486 if( testHoles && aItem->
HasHole() )
488 std::shared_ptr<SHAPE_SEGMENT> holeShape;
512 wxString msg =
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
517 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) + msg );
518 drce->SetItems( aItem, aZone );
540 if( !testClearance && !testShorts )
549 BOX2I worstCaseBBox = itemBBox;
561 std::shared_ptr<SHAPE> itemShape = aText->
GetEffectiveShape( layer, FLASHING::DEFAULT );
563 if( *aInheritedNet ==
nullptr )
565 if( zoneTree->
QueryColliding( itemBBox, itemShape.get(), layer ) )
566 *aInheritedNet = aZone->
GetNet();
569 if( *aInheritedNet == aZone->
GetNet() )
580 std::max( 0, clearance -
m_drcEpsilon ), &actual, &pos ) )
582 std::shared_ptr<DRC_ITEM> drce;
585 if( testShorts && actual == 0 && *aInheritedNet )
588 msg.Printf(
_(
"(nets %s and %s)" ),
589 ( *aInheritedNet )->GetNetname(),
595 msg =
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
601 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) + msg );
602 drce->SetItems( aText, aZone );
612 std::map<BOARD_ITEM*, int> freePadsUsageMap;
613 std::unordered_map<PTR_PTR_CACHE_KEY, layers_checked> checkedPairs;
614 std::mutex checkedPairsMutex;
615 std::mutex freePadsUsageMapMutex;
616 std::atomic<size_t> done( 0 );
619 reportAux( wxT(
"Testing %d tracks & vias..." ), count );
623 auto testTrack = [&](
const int start_idx,
const int end_idx )
625 for(
int trackIdx = start_idx; trackIdx < end_idx; ++trackIdx )
639 if( otherCItem && otherCItem->GetNetCode() == track->
GetNetCode() )
647 if(
static_cast<void*
>( a ) >
static_cast<void*
>( b ) )
650 std::lock_guard<std::mutex> lock( checkedPairsMutex );
651 auto it = checkedPairs.find( { a, b } );
653 if( it != checkedPairs.end() && ( it->second.layers.test( layer )
660 checkedPairs[ { a, b } ].layers.set( layer );
674 std::lock_guard<std::mutex> lock( freePadsUsageMapMutex );
675 auto it = freePadsUsageMap.find( other );
677 if( it == freePadsUsageMap.end() )
679 freePadsUsageMap[ other ] = track->
GetNetCode();
694 if(
static_cast<void*
>( a ) >
static_cast<void*
>( b ) )
700 std::lock_guard<std::mutex> lock( checkedPairsMutex );
701 auto it = checkedPairs.find( { a, b } );
703 if( it != checkedPairs.end() )
704 it->second.has_error =
true;
731 while( done < count )
741 std::this_thread::sleep_for( std::chrono::milliseconds( 250 ) );
759 int padGroupIdx = padToNetTieGroupMap[
pad->GetNumber() ];
763 PAD* otherPad =
static_cast<PAD*
>( other );
765 if( padGroupIdx >= 0 && padGroupIdx == padToNetTieGroupMap[ otherPad->
GetNumber() ] )
766 testClearance = testShorting =
false;
768 if(
pad->SameLogicalPadAs( otherPad ) )
773 testClearance = testShorting =
false;
776 PAD* otherPad =
nullptr;
780 otherPad =
static_cast<PAD*
>( other );
783 otherVia =
static_cast<PCB_VIA*
>( other );
786 testClearance = testShorting =
false;
789 if(
pad->GetAttribute() == PAD_ATTRIB::NPTH && !
pad->FlashLayer( aLayer ) )
790 testClearance = testShorting =
false;
793 testClearance = testShorting =
false;
797 testClearance = testShorting =
false;
799 int padNet =
pad->GetNetCode();
803 otherNet = connectedItem->GetNetCode();
806 if( otherNet && otherNet == padNet )
808 testClearance = testShorting =
false;
812 if( !(
pad->GetDrillSize().x > 0 )
814 && !( otherVia && otherVia->
GetDrill() > 0 ) )
819 if( !testClearance && !testShorting && !testHoles )
828 if( otherPad &&
pad->SameLogicalPadAs( otherPad ) )
838 if(
pad->GetShortNetname().StartsWith( wxS(
"unconnected-(" ) )
847 msg.Printf(
_(
"(nets %s and %s)" ),
851 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) + msg );
852 drce->SetItems(
pad, otherPad );
860 if( testClearance || testShorting )
875 else if( actual == 0 && otherNet && testShorting )
880 msg.Printf(
_(
"(nets %s and %s)" ),
884 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) + msg );
885 drce->SetItems(
pad, other );
890 else if( testClearance )
893 wxString msg =
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
898 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) + msg );
899 drce->SetItems(
pad, other );
917 if( testHoles && otherPad &&
pad->FlashLayer( aLayer ) && otherPad->
HasHole() )
924 wxString msg =
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
929 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) + msg );
930 drce->SetItems(
pad, other );
937 if( testHoles && otherPad && otherPad->
FlashLayer( aLayer ) &&
pad->HasHole() )
939 if( clearance > 0 && otherShape->Collide(
pad->GetEffectiveHoleShape().get(),
944 wxString msg =
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
949 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) + msg );
950 drce->SetItems(
pad, other );
958 if( testHoles && otherVia && otherVia->
IsOnLayer( aLayer ) )
965 wxString msg =
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
970 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) + msg );
971 drce->SetItems(
pad, otherVia );
983 std::atomic<size_t> done( 1 );
986 count += footprint->Pads().size();
988 reportAux( wxT(
"Testing %d pads..." ), count );
990 std::unordered_map<PTR_PTR_CACHE_KEY, int> checkedPairs;
994 std::future<void> retn =
tp.submit(
999 for( PAD* pad : footprint->Pads() )
1001 for( PCB_LAYER_ID layer : LSET( pad->GetLayerSet() & boardCopperLayers ).Seq() )
1003 if( m_drcEngine->IsCancelled() )
1006 std::shared_ptr<SHAPE> padShape = pad->GetEffectiveShape( layer );
1008 m_board->m_CopperItemRTreeCache->QueryColliding( pad, layer, layer,
1010 [&]( BOARD_ITEM* other ) -> bool
1012 BOARD_ITEM* a = pad;
1013 BOARD_ITEM* b = other;
1017 if( static_cast<void*>( a ) > static_cast<void*>( b ) )
1020 if( checkedPairs.find( { a, b } ) != checkedPairs.end() )
1026 checkedPairs[ { a, b } ] = 1;
1031 [&]( BOARD_ITEM* other ) -> bool
1033 testPadAgainstItem( pad, padShape.get(), layer, other );
1035 return !m_drcEngine->IsCancelled();
1037 m_board->m_DRCMaxClearance );
1039 for( ZONE* zone : m_board->m_DRCCopperZones )
1041 testItemAgainstZone( pad, zone, layer );
1043 if( m_drcEngine->IsCancelled() )
1048 done.fetch_add( 1 );
1053 std::future_status status = retn.wait_for( std::chrono::milliseconds( 250 ) );
1055 while( status != std::future_status::ready )
1057 reportProgress( done, count );
1058 status = retn.wait_for( std::chrono::milliseconds( 250 ) );
1067 std::atomic<size_t> done( 1 );
1070 count += footprint->GraphicalItems().size();
1072 reportAux( wxT(
"Testing %d graphics..." ), count );
1074 auto isKnockoutText =
1080 auto testGraphicAgainstZone =
1096 if( isKnockoutText( item ) )
1106 std::unordered_map<PTR_PTR_CACHE_KEY, layers_checked> checkedPairs;
1108 auto testCopperGraphic =
1119 if( otherCItem && otherCItem->GetNetCode() == aShape->GetNetCode() )
1134 if(
static_cast<void*
>( a ) >
static_cast<void*
>( b ) )
1137 auto it = checkedPairs.find( { a, b } );
1139 if( it != checkedPairs.end() && it->second.layers.test( layer ) )
1145 checkedPairs[ { a, b } ].layers.set( layer );
1157 if(
static_cast<void*
>( a ) >
static_cast<void*
>( b ) )
1160 auto it = checkedPairs.find( { a, b } );
1163 aShape->GetEffectiveShape().get(),
1166 if( it != checkedPairs.end() )
1167 it->second.has_error =
true;
1175 std::future<void> retn =
tp.submit(
1180 testGraphicAgainstZone( item );
1182 if( item->Type() ==
PCB_SHAPE_T && item->IsOnCopperLayer() )
1183 testCopperGraphic(
static_cast<PCB_SHAPE*
>( item ) );
1185 done.fetch_add( 1 );
1193 for(
BOARD_ITEM* item : footprint->GraphicalItems() )
1195 testGraphicAgainstZone( item );
1197 done.fetch_add( 1 );
1205 std::future_status status = retn.wait_for( std::chrono::milliseconds( 250 ) );
1207 while( status != std::future_status::ready )
1210 status = retn.wait_for( std::chrono::milliseconds( 250 ) );
1221 std::vector<std::map<PCB_LAYER_ID, std::vector<SEG>>> poly_segments;
1226 using report_data = std::tuple<int, int, VECTOR2I, int, int, PCB_LAYER_ID>;
1228 std::vector<std::future<report_data>> futures;
1230 std::atomic<size_t> done( 1 );
1233 [
this, testClearance, testIntersects, &poly_segments, &done]
1234 (
int zoneA,
int zoneB,
int clearance,
PCB_LAYER_ID layer ) -> report_data
1237 std::map<VECTOR2I, int> conflictPoints;
1239 std::vector<SEG>& refSegments = poly_segments[zoneA][layer];
1240 std::vector<SEG>& testSegments = poly_segments[zoneB][layer];
1241 bool reported =
false;
1242 auto invalid_result = std::make_tuple( -1, -1,
VECTOR2I(), 0, 0,
F_Cu );
1244 for(
SEG& refSegment : refSegments )
1246 int ax1 = refSegment.A.x;
1247 int ay1 = refSegment.A.y;
1248 int ax2 = refSegment.B.x;
1249 int ay2 = refSegment.B.y;
1252 for(
SEG& testSegment : testSegments )
1257 int bx1 = testSegment.A.
x;
1258 int by1 = testSegment.A.y;
1259 int bx2 = testSegment.B.x;
1260 int by2 = testSegment.B.y;
1268 int d = GetClearanceBetweenSegments( bx1, by1, bx2, by2, 0,
1269 ax1, ay1, ax2, ay2, 0,
1270 clearance, &pt.
x, &pt.
y );
1274 if( d == 0 && testIntersects )
1276 else if( testClearance )
1281 done.fetch_add( 1 );
1282 return std::make_tuple( zoneA, zoneB, pt, d, clearance, layer );
1287 return invalid_result;
1291 done.fetch_add( 1 );
1292 return invalid_result;
1298 int zone2zoneClearance;
1309 std::vector<SEG>& zone_layer_poly_segs = poly_segments[ii][layer];
1318 if( seg.
A.
x > seg.
B.
x )
1321 zone_layer_poly_segs.push_back( seg );
1324 std::sort( zone_layer_poly_segs.begin(), zone_layer_poly_segs.end() );
1328 std::vector<std::pair<int, int>> zonePairs;
1367 futures.push_back(
tp.submit( checkZones, ia, ia2, zone2zoneClearance, layer ) );
1372 size_t count = futures.size();
1374 for(
auto& task : futures )
1379 std::future_status result;
1383 result = task.wait_for( std::chrono::milliseconds( 250 ) );
1390 if( result == std::future_status::ready )
1392 report_data data = task.get();
1393 int zoneA_idx = std::get<0>( data );
1394 int zoneB_idx = std::get<1>( data );
1396 int actual = std::get<3>( data );
1397 int required = std::get<4>( data );
1400 if( zoneA_idx >= 0 )
1406 std::shared_ptr<DRC_ITEM> drce;
1408 if( actual <= 0 && testIntersects )
1412 else if( testClearance )
1415 wxString msg =
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
1418 std::max( actual, 0 ) );
1420 drce->SetErrorMessage( drce->GetErrorText() + wxS(
" " ) + msg );
1425 drce->SetItems( zoneA, zoneB );
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
wxString GetNetname() const
NETINFO_ITEM * GetNet() const
Return #NET_INFO object for a given item.
const wxString & GetShortNetname() const
int GetDRCEpsilon() const
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual bool IsConnected() const
Returns information if the object is derived from BOARD_CONNECTED_ITEM.
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
FOOTPRINT * GetParentFootprint() const
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
BOARD_ITEM_CONTAINER * GetParent() const
virtual std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const
virtual bool HasHole() const
std::vector< ZONE * > m_DRCCopperZones
bool IsLayerEnabled(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
int GetCopperLayerCount() const
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
std::shared_ptr< DRC_RTREE > m_CopperItemRTreeCache
std::unordered_map< ZONE *, std::unique_ptr< DRC_RTREE > > m_CopperZoneRTreeCache
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
const DRAWINGS & Drawings() const
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr bool Intersects(const BOX2< Vec > &aRect) const
SEVERITY GetSeverity() const
const MINOPTMAX< int > & GetValue() const
DRC_RULE * GetParentRule() const
bool GetReportAllTrackErrors() const
bool IsErrorLimitExceeded(int error_code)
DRC_CONSTRAINT EvalRules(DRC_CONSTRAINT_T aConstraintType, const BOARD_ITEM *a, const BOARD_ITEM *b, PCB_LAYER_ID aLayer, REPORTER *aReporter=nullptr)
bool IsNetTieExclusion(int aTrackNetCode, PCB_LAYER_ID aTrackLayer, const VECTOR2I &aCollisionPos, BOARD_ITEM *aCollidingItem)
Check if the given collision between a track and another item occurs during the track's entry into a ...
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
Implement an R-tree for fast spatial and layer indexing of connectable items.
int QueryColliding(BOARD_ITEM *aRefItem, PCB_LAYER_ID aRefLayer, PCB_LAYER_ID aTargetLayer, std::function< bool(BOARD_ITEM *)> aFilter=nullptr, std::function< bool(BOARD_ITEM *)> aVisitor=nullptr, int aClearance=0) const
This is a fast test which essentially does bounding-box overlap given a worst-case clearance.
void ReportAndShowPathCuToCu(std::shared_ptr< DRC_ITEM > &aDrce, const VECTOR2I &aMarkerPos, int aMarkerLayer, const BOARD_ITEM *aItem1, const BOARD_ITEM *aItem2, PCB_LAYER_ID layer, int aDistance)
void testPadAgainstItem(PAD *pad, SHAPE *padShape, PCB_LAYER_ID layer, BOARD_ITEM *other)
struct DRC_TEST_PROVIDER_COPPER_CLEARANCE::checked layers_checked
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
DRC_TEST_PROVIDER_COPPER_CLEARANCE()
bool testSingleLayerItemAgainstItem(BOARD_ITEM *item, SHAPE *itemShape, PCB_LAYER_ID layer, BOARD_ITEM *other)
Checks for track/via/hole <-> clearance.
void testItemAgainstZone(BOARD_ITEM *aItem, ZONE *aZone, PCB_LAYER_ID aLayer)
void testGraphicClearances()
void testTrackClearances()
virtual ~DRC_TEST_PROVIDER_COPPER_CLEARANCE()
virtual const wxString GetDescription() const override
virtual const wxString GetName() const override
void testKnockoutTextAgainstZone(BOARD_ITEM *aText, NETINFO_ITEM **aInheritedNet, ZONE *aZone)
wxString formatMsg(const wxString &aFormatString, const wxString &aSource, double aConstraint, double aActual)
virtual bool reportPhase(const wxString &aStageName)
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer)
void reportAux(const wxString &aMsg)
virtual void reportRuleStatistics()
virtual bool reportProgress(size_t aCount, size_t aSize, size_t aDelta=1)
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
KICAD_T Type() const
Returns the type of object.
LSET is a set of PCB_LAYER_IDs.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
Handle the data for a net.
const wxString & GetNetname() const
bool FlashLayer(int aLayer, bool aOnlyCheckIfPermitted=false) const
Check to see whether the pad should be flashed on the specific layer.
const VECTOR2I & GetDrillSize() const
PAD_ATTRIB GetAttribute() const
const wxString & GetNumber() const
VECTOR2I GetPosition() const override
bool HasHole() const override
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const override
Return a SHAPE_SEGMENT object representing the pad's hole.
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
const VECTOR2I & GetStart() const
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
const VECTOR2I & GetEnd() const
int GetDrill() const
Return the local drill setting for this PCB_VIA.
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const override
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
OPT_VECTOR2I Intersect(const SEG &aSeg, bool aIgnoreEndpoints=false, bool aLines=false) const
Compute intersection point of segment (this) with segment aSeg.
Represent a set of closed polygons.
int FullPointCount() const
Return the number of points in the shape poly set.
void BuildBBoxCaches() const
Construct BBoxCaches for Contains(), below.
SEGMENT_ITERATOR IterateSegmentsWithHoles()
Returns an iterator object, for all outlines in the set (with holes)
const BOX2I BBoxFromCaches() const
An abstract shape on 2D plane.
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const
Check if the boundary of shape (this) lies closer to the point aP than aClearance,...
Handle a list of polygons defining a copper zone.
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
const BOX2I GetBoundingBox() const override
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Test to see if this object is on the given layer.
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
@ HOLE_CLEARANCE_CONSTRAINT
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_ANNULAR_WIDTH > dummy
std::optional< VECTOR2I > OPT_VECTOR2I
static bool Collide(const SHAPE_CIRCLE &aA, const SHAPE_CIRCLE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
checked(PCB_LAYER_ID aLayer)
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_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap 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_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
VECTOR2< int32_t > VECTOR2I