52 virtual bool Run()
override;
54 virtual const wxString
GetName()
const override {
return wxT(
"silk_clearance" ); };
65 const int progressDelta = 500;
73 bool checkIndividualMaskItems =
m_board->GetDesignSettings().m_SolderMaskMinWidth <= 0;
87 if( !
reportPhase(
_(
"Checking silkscreen for overlapping items..." ) ) )
112 if( item->IsOnLayer( layer ) )
113 silkTree.
Insert( item, layer );
119 auto addToTargetTree =
126 targetTree.
Insert( item, layer );
137 REPORT_AUX( wxString::Format( wxT(
"Testing %d silkscreen features against %d board items." ),
139 targetTree.
size() ) );
141 const std::vector<DRC_RTREE::LAYER_PAIR> layerPairs =
170 const SHAPE* testShape = aTestItemShape->
shape;
172 std::shared_ptr<SHAPE> hole;
183 if( testItem->
IsTented( aLayers.first ) )
188 testShape = hole.get();
198 refItem, testItem, aLayers.second );
199 int minClearance = -1;
204 if( aLayers.second ==
F_Mask || aLayers.second ==
B_Mask )
206 if( checkIndividualMaskItems )
207 minClearance = std::max( minClearance, 0 );
212 if( minClearance < 0 || m_drcEngine->IsErrorLimitExceeded( errorCode ) )
228 if( aLayers.first == aLayers.second )
232 std::swap( refItem, testItem );
233 std::swap( refShape, testShape );
237 if( refShape->
Collide( testShape, minClearance, &
actual, &pos ) )
241 if( minClearance > 0 )
243 wxString msg =
formatMsg(
_(
"(%s clearance %s; actual %s)" ),
248 drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS(
" " ) + msg );
251 drcItem->SetItems( refItem, testItem );
256 *aCollisionDetected =
true;
262 [&](
int aCount,
int aSize ) ->
bool
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
FOOTPRINT * GetParentFootprint() const
virtual bool IsTented(PCB_LAYER_ID aLayer) const
Checks if the given object is tented (its copper shape is covered by solder mask) on a given side of ...
virtual std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const
virtual bool HasHole() const
Information pertinent to a Pcbnew printed circuit board.
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.
void Insert(BOARD_ITEM *aItem, PCB_LAYER_ID aLayer, int aWorstClearance=0)
Insert an item into the tree on a particular layer with an optional worst clearance.
size_t size() const
Return the number of items in the tree.
std::pair< PCB_LAYER_ID, PCB_LAYER_ID > LAYER_PAIR
int QueryCollidingPairs(DRC_RTREE *aRefTree, std::vector< LAYER_PAIR > aLayerPairs, std::function< bool(const LAYER_PAIR &, ITEM_WITH_SHAPE *, ITEM_WITH_SHAPE *, bool *aCollision)> aVisitor, int aMaxClearance, std::function< bool(int, int)> aProgressReporter) const
virtual const wxString GetName() const override
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
DRC_TEST_PROVIDER_SILK_CLEARANCE()
virtual ~DRC_TEST_PROVIDER_SILK_CLEARANCE()=default
virtual bool reportPhase(const wxString &aStageName)
int forEachGeometryItem(const std::vector< KICAD_T > &aTypes, const LSET &aLayers, const std::function< bool(BOARD_ITEM *)> &aFunc)
static std::vector< KICAD_T > s_allBasicItems
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer, const std::vector< PCB_SHAPE > &aShapes={})
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)
KICAD_T Type() const
Returns the type of object.
LSET is a set of PCB_LAYER_IDs.
static const LSET & FrontMask()
Return a mask holding all technical layers and the external CU layer on front side.
static const LSET & BackMask()
Return a mask holding all technical layers and the external CU layer on back side.
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,...
@ DRCE_SILK_MASK_CLEARANCE
@ SILK_CLEARANCE_CONSTRAINT
PCB_LAYER_ID
A quick note on layer IDs:
static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_ANNULAR_WIDTH > dummy
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
VECTOR2< int32_t > VECTOR2I