50 virtual bool Run()
override;
52 virtual const wxString
GetName()
const override {
return wxT(
"courtyard_clearance" ); }
70 if( !
reportPhase(
_(
"Checking footprint courtyard definitions..." ) ) )
75 if( !
reportPhase(
_(
"Gathering footprint courtyards..." ) ) )
80 REPORT_AUX( wxT(
"All courtyard violations ignored. Tests not run." ) );
84 const int progressDelta = 500;
101 drcItem->SetErrorDetail( msg );
102 drcItem->SetItems( footprint );
107 footprint->BuildCourtyardCaches( &errorHandler );
109 else if( footprint->GetCourtyard(
F_CrtYd ).OutlineCount() == 0
110 && footprint->GetCourtyard(
B_CrtYd ).OutlineCount() == 0 )
115 if( footprint->AllowMissingCourtyard() )
119 drcItem->SetItems( footprint );
124 footprint->GetCourtyard(
F_CrtYd ).BuildBBoxCaches();
125 footprint->GetCourtyard(
B_CrtYd ).BuildBBoxCaches();
135 if( !
reportPhase(
_(
"Checking footprints for overlapping courtyards..." ) ) )
138 const int progressDelta = 100;
143 std::vector<FOOTPRINT*> footprints;
145 footprints.insert( footprints.begin(),
m_board->Footprints().begin(),
148 std::sort( footprints.begin(), footprints.end(),
151 return a->m_Uuid < b->m_Uuid;
154 for(
auto itA = footprints.begin(); itA != footprints.end(); itA++ )
187 for(
auto itB = itA + 1; itB != footprints.end(); itB++ )
230 drcItem->SetErrorDetail(
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
237 drcItem->SetItems( fpA, fpB );
260 drcItem->SetErrorDetail(
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
267 drcItem->SetItems( fpA, fpB );
279 bool checkFront =
false;
280 bool checkBack =
false;
286 bool padCheckPossible =
292 if( padCheckPossible )
319 auto testPadAgainstCourtyards =
333 if(
m_drcEngine->IsErrorLimitExceeded( errorCode ) )
338 std::shared_ptr<SHAPE_SEGMENT> hole =
pad->GetEffectiveHoleShape();
345 drce->SetItems(
pad, fp );
351 drce->SetItems(
pad, fp );
360 for(
const PAD* padB : fpB->
Pads() )
361 testPadAgainstCourtyards( padB, fpA );
367 for(
const PAD* padA : fpA->
Pads() )
368 testPadAgainstCourtyards( padA, fpB );
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
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.
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
DRC_TEST_PROVIDER_COURTYARD_CLEARANCE()
bool testFootprintCourtyardDefinitions()
int m_largestCourtyardClearance
virtual ~DRC_TEST_PROVIDER_COURTYARD_CLEARANCE()=default
virtual const wxString GetName() const override
bool testCourtyardClearances()
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 reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer, const std::function< void(PCB_MARKER *)> &aPathGenerator=[](PCB_MARKER *){})
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)
Represent a set of closed polygons.
bool Collide(const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance,...
int OutlineCount() const
Return the number of outlines in the set.
const BOX2I BBoxFromCaches() const
const std::function< void(const wxString &msg, BOARD_ITEM *itemA, BOARD_ITEM *itemB, const VECTOR2I &pt)> OUTLINE_ERROR_HANDLER
@ DRCE_OVERLAPPING_FOOTPRINTS
@ DRCE_MALFORMED_COURTYARD
@ COURTYARD_CLEARANCE_CONSTRAINT
#define MALFORMED_COURTYARDS
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.
@ HEATSINK
a pad used as heat sink, usually in SMD footprints
VECTOR2< int32_t > VECTOR2I