66 virtual bool Run()
override;
68 virtual const wxString
GetName()
const override {
return wxT(
"clearance" ); };
111 if(
m_board->m_DRCMaxClearance <= 0 )
113 REPORT_AUX( wxT(
"No Clearance constraints found. Tests not run." ) );
121 if( !
reportPhase(
_(
"Checking track & via clearances..." ) ) )
128 if( !
reportPhase(
_(
"Checking hole clearances..." ) ) )
152 if( !
reportPhase(
_(
"Checking copper graphic clearances..." ) ) )
159 if( !
reportPhase(
_(
"Checking copper graphic hole clearances..." ) ) )
167 if( !
reportPhase(
_(
"Checking copper zone clearances..." ) ) )
172 if( !
reportPhase(
_(
"Checking teardrop clearances..." ) ) )
192 bool has_error =
false;
202 if( itemNet == otherNet )
203 testClearance = testShorting =
false;
205 std::shared_ptr<SHAPE> otherShape_shared_ptr;
211 if( !
pad->FlashLayer( layer ) )
214 testClearance = testShorting =
false;
223 if( !
via->FlashLayer( layer ) )
227 if( !otherShape_shared_ptr )
230 SHAPE* otherShape = otherShape_shared_ptr.get();
236 std::swap( item, other );
237 std::swap( itemShape, otherShape );
238 std::swap( itemNet, otherNet );
241 if( testClearance || testShorting )
261 drcItem->SetItems( item, other );
276 else if(
actual == 0 && otherNet && testShorting )
278 int itemNetCode = itemNet ? itemNet->
GetNetCode() : 0;
279 int otherNetCode = otherNet ? otherNet->
GetNetCode() : 0;
282 drcItem->SetErrorDetail( wxString::Format(
_(
"(nets %s and %s)" ),
283 itemNetCode ? itemNet->
GetNetname() :
_(
"<no net>" ),
284 otherNetCode ? otherNet->
GetNetname() :
_(
"<no net>" ) ) );
285 drcItem->SetItems( item, other );
292 else if( testClearance )
295 drcItem->SetErrorDetail(
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
299 drcItem->SetItems( item, other );
312 std::array<BOARD_ITEM*, 2> a{ item, other };
313 std::array<BOARD_ITEM*, 2> b{ other, item };
314 std::array<NETINFO_ITEM*, 2> b_net{ otherNet, itemNet };
315 std::array<SHAPE*, 2> a_shape{ itemShape, otherShape };
317 for(
size_t ii = 0; ii < 2; ++ii )
319 std::shared_ptr<SHAPE_SEGMENT> holeShape;
323 if( b[ii]->GetLayerSet().Contains( layer ) )
330 if( b[ii]->HasHole() )
336 int netcode = b_net[ii] ? b_net[ii]->GetNetCode() : 0;
338 if( netcode &&
m_drcEngine->IsNetTieExclusion( netcode, layer, holeShape->Centre(), a[ii] ) )
352 :
_(
"(%s clearance %s; actual < 0)" ),
356 drcItem->SetItems( a[ii], b[ii] );
382 BOX2I worstCaseBBox = itemBBox;
394 std::set<PAD*> allowedNetTiePads;
400 if(
pad->IsOnLayer( aLayer ) )
401 allowedNetTiePads.insert(
pad );
405 if( other->IsOnLayer( aLayer ) )
406 allowedNetTiePads.insert( other );
411 if( !allowedNetTiePads.empty() )
415 for(
PAD*
pad : allowedNetTiePads )
417 if(
pad->GetBoundingBox( aLayer ).Intersects( itemBBox )
418 &&
pad->GetEffectiveShape( aLayer )->Collide( itemShape.get() ) )
429 if( !testClearance && !testHoles )
445 bool flashedPad =
pad->FlashLayer( aLayer );
448 if( !flashedPad && !platedHole )
449 testClearance =
false;
465 drcItem->SetErrorDetail(
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
469 drcItem->SetItems( aItem, aZone );
475 if( testHoles && aItem->
HasHole() )
477 std::shared_ptr<SHAPE_SEGMENT> holeShape;
499 drcItem->SetErrorDetail(
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
503 drcItem->SetItems( aItem, aZone );
527 if( !testClearance && !testShorts )
536 BOX2I worstCaseBBox = itemBBox;
550 if( *aInheritedNet ==
nullptr )
552 if( zoneTree->
QueryColliding( itemBBox, itemShape.get(), layer ) )
553 *aInheritedNet = aZone->
GetNet();
556 if( *aInheritedNet == aZone->
GetNet() )
568 std::shared_ptr<DRC_ITEM> drcItem;
570 if( testShorts &&
actual == 0 && *aInheritedNet )
572 int inheritedNetCode = ( *aInheritedNet )->GetNetCode();
573 const wxString& inheritedNetname = ( *aInheritedNet )->GetNetname();
577 drcItem->SetErrorDetail( wxString::Format(
_(
"(nets %s and %s)" ),
578 inheritedNetCode ? inheritedNetname :
_(
"<no net>" ),
579 zoneNetCode ? aZone->
GetNetname() :
_(
"<no net>" ) ) );
584 drcItem->SetErrorDetail(
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
590 drcItem->SetItems( aText, aZone );
600 std::map<BOARD_ITEM*, int> freePadsUsageMap;
601 std::mutex freePadsUsageMapMutex;
602 std::atomic<size_t> done( 0 );
603 size_t count =
m_board->Tracks().size();
605 REPORT_AUX( wxString::Format( wxT(
"Testing %d tracks & vias..." ), count ) );
610 [&](
const int trackIdx )
618 m_board->m_CopperItemRTreeCache->QueryColliding( track, layer, layer,
651 std::lock_guard<std::mutex> lock( freePadsUsageMapMutex );
652 auto it = freePadsUsageMap.find( other );
654 if( it == freePadsUsageMap.end() )
656 freePadsUsageMap[ other ] = track->
GetNetCode();
676 auto zoneIt =
m_board->m_DRCCopperZonesByLayer.find( layer );
678 if( zoneIt !=
m_board->m_DRCCopperZonesByLayer.end() )
680 for(
ZONE* zone : zoneIt->second )
695 auto track_futures =
tp.submit_loop( 0,
m_board->Tracks().size(), testTrack,
m_board->Tracks().size() );
697 while( done < count )
704 track_futures.wait();
708 track_futures.wait_for( std::chrono::milliseconds( 250 ) );
725 int padGroupIdx = padToNetTieGroupMap[
pad->GetNumber() ];
729 PAD* otherPad =
static_cast<PAD*
>( other );
731 if( padGroupIdx >= 0 && padGroupIdx == padToNetTieGroupMap[ otherPad->
GetNumber() ] )
732 testClearance = testShorting =
false;
734 if(
pad->SameLogicalPadAs( otherPad ) )
739 testClearance = testShorting =
false;
744 PAD* otherPad =
nullptr;
748 otherPad =
static_cast<PAD*
>( other );
751 otherVia =
static_cast<PCB_VIA*
>( other );
754 testClearance = testShorting =
false;
758 testClearance = testShorting =
false;
761 testClearance = testShorting =
false;
765 testClearance = testShorting =
false;
769 testClearance = testShorting =
false;
771 int padNet =
pad->GetNetCode();
772 int otherNet = otherCItem ? otherCItem->
GetNetCode() : 0;
775 if( otherNet && otherNet == padNet )
777 testClearance = testShorting =
false;
781 if( !(
pad->GetDrillSize().x > 0 )
783 && !( otherVia && otherVia->
GetDrill() > 0 ) )
788 if( !testClearance && !testShorting && !testHoles )
796 bool has_error =
false;
798 if( otherPad &&
pad->SameLogicalPadAs( otherPad ) )
808 if(
pad->GetShortNetname().StartsWith( wxS(
"unconnected-(" ) )
815 drcItem->SetErrorDetail( wxString::Format(
_(
"(nets %s and %s)" ),
816 padNet ?
pad->GetNetname() :
_(
"<no net>" ),
817 otherNet ? otherPad->
GetNetname() :
_(
"<no net>" ) ) );
819 drcItem->SetItems(
pad, otherPad );
827 if( testClearance || testShorting )
836 if(
m_drcEngine->IsNetTieExclusion(
pad->GetNetCode(), aLayer, pos, other ) )
841 else if(
actual == 0 && padNet && otherNet && testShorting )
844 drcItem->SetErrorDetail( wxString::Format(
_(
"(nets %s and %s)" ),
845 padNet ?
pad->GetNetname() :
_(
"<no net>" ),
846 otherNet ? otherPad->
GetNetname() :
_(
"<no net>" ) ) );
847 drcItem->SetItems(
pad, other );
852 else if( testClearance )
855 drcItem->SetErrorDetail(
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
859 drcItem->SetItems(
pad, other );
871 const std::shared_ptr<SHAPE_SEGMENT>& aOtherShape,
int aClearance )
873 if( shape->Collide( aOtherShape.get(),
sub_e( aClearance ), &
actual, &pos ) )
876 drcItem->SetErrorDetail(
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
879 drcItem->SetItems( item, otherItem );
895 if( testHoles && otherPad && otherPad->
HasHole() &&
pad->FlashLayer( aLayer ) )
908 if( testHoles &&
pad->HasHole() && otherPad && otherPad->
FlashLayer( aLayer ) )
919 if( testHoles && otherVia && otherVia->
HasHole() )
940 std::atomic<size_t> done( 1 );
944 const auto fp_check =
959 std::shared_ptr<SHAPE> padShape =
pad->GetEffectiveShape( layer );
961 m_board->m_CopperItemRTreeCache->QueryColliding(
983 auto zoneIt =
m_board->m_DRCCopperZonesByLayer.find( layer );
985 if( zoneIt !=
m_board->m_DRCCopperZonesByLayer.end() )
987 for(
ZONE* zone : zoneIt->second )
1001 size_t numFootprints =
m_board->Footprints().size();
1002 auto returns =
tp.submit_loop( 0, numFootprints, fp_check, numFootprints );
1005 for(
const std::future<void>& ret : returns )
1007 while( ret.wait_for( std::chrono::milliseconds( 250 ) ) != std::future_status::ready )
1016 size_t count =
m_board->Drawings().size();
1017 std::atomic<size_t> done( 1 );
1020 count += footprint->GraphicalItems().size() + footprint->GetFields().size();
1022 REPORT_AUX( wxString::Format( wxT(
"Testing %d graphics..." ), count ) );
1024 auto isKnockoutText =
1030 auto testGraphicAgainstZone =
1045 auto zoneIt =
m_board->m_DRCCopperZonesByLayer.find( layer );
1047 if( zoneIt !=
m_board->m_DRCCopperZonesByLayer.end() )
1049 for(
ZONE* zone : zoneIt->second )
1051 if( isKnockoutText( item ) )
1062 auto testCopperGraphic =
1067 m_board->m_CopperItemRTreeCache->QueryColliding( graphic, layer, layer,
1075 && graphic->GetParentFootprint()
1089 int graphicNet = graphic->IsConnected()
1096 if( graphicNet && graphicNet == otherNet )
1104 && graphic->m_Uuid > other->
m_Uuid )
1122 BS::multi_future<void> graphic_futures;
1126 graphic_futures.push_back(
tp.submit_task(
1127 [
this, item, &done, testGraphicAgainstZone, testCopperGraphic]()
1129 if( !m_drcEngine->IsCancelled() )
1131 testGraphicAgainstZone( item );
1133 if( ( item->Type() == PCB_SHAPE_T || item->Type() == PCB_BARCODE_T )
1134 && item->IsOnCopperLayer() )
1136 testCopperGraphic( static_cast<PCB_SHAPE*>( item ) );
1139 done.fetch_add( 1 );
1144 for(
FOOTPRINT* footprint : m_board->Footprints() )
1146 graphic_futures.push_back(
tp.submit_task(
1147 [
this, footprint, &done, testGraphicAgainstZone, testCopperGraphic]()
1149 for( BOARD_ITEM* item : footprint->GraphicalItems() )
1151 if( !m_drcEngine->IsCancelled() )
1153 testGraphicAgainstZone( item );
1155 if( ( item->Type() == PCB_SHAPE_T || item->Type() == PCB_BARCODE_T )
1156 && item->IsOnCopperLayer() )
1158 testCopperGraphic( static_cast<PCB_SHAPE*>( item ) );
1161 done.fetch_add( 1 );
1167 for(
PCB_FIELD* field : footprint->GetFields() )
1169 if( !m_drcEngine->IsCancelled() )
1171 testGraphicAgainstZone( field );
1172 done.fetch_add( 1 );
1180 for( std::future<void>& future : graphic_futures )
1184 reportProgress( done, count );
1185 }
while( future.wait_for( std::chrono::milliseconds( 250 ) ) != std::future_status::ready );
1204 auto zoneIt =
m_board->m_DRCCopperZonesByLayer.find( layer );
1206 if( zoneIt ==
m_board->m_DRCCopperZonesByLayer.end() )
1209 for(
ZONE* zone : zoneIt->second )
1211 if( zone == teardrop )
1233 std::vector<std::map<PCB_LAYER_ID, std::vector<SEG>>> poly_segments(
m_board->m_DRCCopperZones.size() );
1234 std::vector<std::map<PCB_LAYER_ID, SEG_RTREE>> seg_rtrees(
m_board->m_DRCCopperZones.size() );
1237 std::atomic<size_t> done( 0 );
1239 BS::multi_future<void> zone_futures;
1241 auto reportZoneZoneViolation =
1246 drcItem->SetErrorDetail(
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
1247 constraint.GetName(),
1248 constraint.GetValue().Min(),
1249 std::max(
actual, 0 ) ) );
1250 drcItem->SetItems( zoneA, zoneB );
1251 drcItem->SetViolatingRule( constraint.GetParentRule() );
1256 [
this, reportZoneZoneViolation, &poly_segments, &seg_rtrees, &done]
1257 (
size_t zoneA_idx,
size_t zoneB_idx,
PCB_LAYER_ID layer ) ->
void
1262 ZONE* zoneA =
m_board->m_DRCCopperZones[zoneA_idx];
1263 ZONE* zoneB =
m_board->m_DRCCopperZones[zoneB_idx];
1271 std::vector<SEG>& refSegments = poly_segments[zoneA_idx][layer];
1272 std::vector<SEG>& testSegments = poly_segments[zoneB_idx][layer];
1274 auto testIt = seg_rtrees[zoneB_idx].find( layer );
1276 if( testIt != seg_rtrees[zoneB_idx].
end() && !testIt->second.empty() )
1278 const SEG_RTREE& testTree = testIt->second;
1280 for(
SEG& refSegment : refSegments )
1286 int minX = std::min( refSegment.A.x, refSegment.B.x ) -
clearance;
1287 int minY = std::min( refSegment.A.y, refSegment.B.y ) -
clearance;
1288 int maxX = std::max( refSegment.A.x, refSegment.B.x ) +
clearance;
1289 int maxY = std::max( refSegment.A.y, refSegment.B.y ) +
clearance;
1290 int qmin[2] = { minX, minY };
1291 int qmax[2] = { maxX, maxY };
1295 [&](
size_t segIdx ) ->
bool
1297 SEG& testSegment = testSegments[segIdx];
1298 int64_t dist_sq = 0;
1301 refSegment.NearestPoints( testSegment, pt, other_pt, dist_sq );
1302 actual = std::floor( std::sqrt( dist_sq ) + 0.5 );
1313 testTree.Search( qmin, qmax, visitor );
1317 done.fetch_add( 1 );
1318 reportZoneZoneViolation( zoneA, zoneB, pt,
actual, constraint, layer );
1325 done.fetch_add( 1 );
1329 std::map<PCB_LAYER_ID, std::vector<size_t>> zone_idx_by_layer;
1331 for (
size_t ii = 0; ii <
m_board->m_DRCCopperZones.size(); ii++ )
1344 zone_idx_by_layer[layer].push_back( ii );
1351 if( !
m_board->IsLayerEnabled( layer ) )
1354 for(
size_t ii : zone_idx_by_layer[layer] )
1358 std::vector<SEG>& zone_layer_poly_segs = poly_segments[ii][layer];
1359 zone_layer_poly_segs.reserve( poly->FullPointCount() );
1361 for(
auto it = poly->IterateSegmentsWithHoles(); it; it++ )
1365 if( seg.
A.
x > seg.
B.
x )
1368 zone_layer_poly_segs.push_back( seg );
1371 SEG_RTREE::Builder builder;
1372 builder.Reserve( zone_layer_poly_segs.size() );
1374 for(
size_t si = 0; si < zone_layer_poly_segs.size(); ++si )
1376 const SEG& seg = zone_layer_poly_segs[si];
1377 int smin[2] = { std::min( seg.
A.
x, seg.
B.
x ), std::min( seg.
A.
y, seg.
B.
y ) };
1378 int smax[2] = { std::max( seg.
A.
x, seg.
B.
x ), std::max( seg.
A.
y, seg.
B.
y ) };
1379 builder.Add( smin, smax, si );
1382 seg_rtrees[ii][layer] = builder.Build();
1386 for(
auto it_a = zone_idx_by_layer[layer].begin(); it_a != zone_idx_by_layer[layer].end(); ++it_a )
1391 for(
auto it_a2 = std::next( it_a ); it_a2 != zone_idx_by_layer[layer].end(); ++it_a2 )
1393 size_t ia2 = *it_a2;
1415 zone_futures.push_back(
tp.submit_task(
1416 [checkZones, ia, ia2, layer]()
1418 checkZones( ia, ia2, layer );
1426 for( std::future<void>& future : zone_futures )
1431 }
while( future.wait_for( std::chrono::milliseconds( 250 ) ) != std::future_status::ready );
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
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual bool IsConnected() const
Returns information if the object is derived from BOARD_CONNECTED_ITEM.
virtual std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
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 > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
virtual bool HasHole() 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
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.
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.
int sub_e(int aClearance)
void testItemAgainstZone(BOARD_ITEM *aItem, ZONE *aZone, PCB_LAYER_ID aLayer)
void testTeardropClearances()
void testGraphicClearances()
void testTrackClearances()
virtual ~DRC_TEST_PROVIDER_COPPER_CLEARANCE()=default
virtual const wxString GetName() const override
void testKnockoutTextAgainstZone(BOARD_ITEM *aText, NETINFO_ITEM **aInheritedNet, ZONE *aZone)
bool testPadAgainstItem(PAD *pad, const std::shared_ptr< SHAPE > &padShape, PCB_LAYER_ID layer, BOARD_ITEM *other)
virtual bool reportPhase(const wxString &aStageName)
void reportTwoShapeGeometry(std::shared_ptr< DRC_ITEM > &aDrcItem, const VECTOR2I &aMarkerPos, const SHAPE *aShape1, const SHAPE *aShape2, PCB_LAYER_ID aLayer, int aDistance)
void reportTwoItemGeometry(std::shared_ptr< DRC_ITEM > &aDrcItem, const VECTOR2I &aMarkerPos, const BOARD_ITEM *aItem1, const BOARD_ITEM *aItem2, PCB_LAYER_ID aLayer, int aDistance)
void reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer, const std::function< void(PCB_MARKER *)> &aPathGenerator=[](PCB_MARKER *){})
void reportTwoPointGeometry(std::shared_ptr< DRC_ITEM > &aDrcItem, const VECTOR2I &aMarkerPos, const VECTOR2I &ptA, const VECTOR2I &ptB, PCB_LAYER_ID aLayer)
bool isInvisibleText(const BOARD_ITEM *aItem) const
wxString formatMsg(const wxString &aFormatString, const wxString &aSource, double aConstraint, double aActual, EDA_DATA_TYPE aDataType=EDA_DATA_TYPE::DISTANCE)
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.
Static (immutable) packed R-tree built via Hilbert-curve bulk loading.
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
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.
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
Return a SHAPE_SEGMENT object representing the pad's hole.
PAD_ATTRIB GetAttribute() const
const wxString & GetNumber() const
VECTOR2I GetPosition() const override
VECTOR2I GetDrillSize() const
bool HasHole() const override
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
int GetDrill() const
Return the local drill setting for this PCB_VIA.
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
bool HasHole() 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.
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
SHAPE_POLY_SET * GetFill(PCB_LAYER_ID aLayer)
bool IsTeardropArea() const
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
@ HOLE_CLEARANCE_CONSTRAINT
@ DEFAULT
Flashing follows connectivity.
bool IsCopperLayer(int aLayerId)
Test 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
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
@ PTH
Plated through hole pad.
std::optional< VECTOR2I > OPT_VECTOR2I
static bool Collide(const SHAPE_CIRCLE &aA, const SHAPE_CIRCLE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
thread_pool & GetKiCadThreadPool()
Get a reference to the current thread pool.
BS::priority_thread_pool thread_pool
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ 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_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap on a layer
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
@ PCB_BARCODE_T
class PCB_BARCODE, a barcode (graphic item)
@ 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