KiCad PCB EDA Suite
drc_test_provider_solder_mask.cpp File Reference
#include <common.h>
#include <board_design_settings.h>
#include <board_connected_item.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_track.h>
#include <zone.h>
#include <geometry/seg.h>
#include <drc/drc_engine.h>
#include <drc/drc_item.h>
#include <drc/drc_rule.h>
#include <drc/drc_test_provider_clearance_base.h>
#include <drc/drc_rtree.h>

Go to the source code of this file.

Classes

class  DRC_TEST_PROVIDER_SOLDER_MASK
 

Namespaces

namespace  detail
 

Functions

bool isNullAperture (BOARD_ITEM *aItem)
 
bool isMaskAperture (BOARD_ITEM *aItem)
 

Variables

static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_SOLDER_MASKdetail::dummy
 

Function Documentation

◆ isMaskAperture()

bool isMaskAperture ( BOARD_ITEM aItem)

Definition at line 324 of file drc_test_provider_solder_mask.cpp.

325{
326 if( aItem->Type() == PCB_PAD_T && static_cast<PAD*>( aItem )->IsFreePad() )
327 return true;
328
329 static const LSET saved( 2, F_Mask, B_Mask );
330
331 LSET maskLayers = aItem->GetLayerSet() & saved;
332 LSET otherLayers = aItem->GetLayerSet() & ~saved;
333
334 return maskLayers.count() > 0 && otherLayers.count() == 0;
335}
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
Definition: board_item.h:172
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:530
Definition: pad.h:58
bool IsFreePad() const
Definition: pad.cpp:167
@ B_Mask
Definition: layer_ids.h:106
@ F_Mask
Definition: layer_ids.h:107
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:87

References B_Mask, F_Mask, BOARD_ITEM::GetLayerSet(), PAD::IsFreePad(), PCB_PAD_T, and EDA_ITEM::Type().

Referenced by DRC_TEST_PROVIDER_SOLDER_MASK::testItemAgainstItems(), and DRC_TEST_PROVIDER_SOLDER_MASK::testMaskItemAgainstZones().

◆ isNullAperture()

bool isNullAperture ( BOARD_ITEM aItem)

Definition at line 299 of file drc_test_provider_solder_mask.cpp.

300{
301 if( aItem->Type() == PCB_PAD_T )
302 {
303 PAD* pad = static_cast<PAD*>( aItem );
304
305 if( pad->GetAttribute() == PAD_ATTRIB::NPTH
306 && ( pad->GetShape() == PAD_SHAPE::CIRCLE || pad->GetShape() == PAD_SHAPE::OVAL )
307 && pad->GetSize().x <= pad->GetDrillSize().x
308 && pad->GetSize().y <= pad->GetDrillSize().y )
309 {
310 return true;
311 }
312 }
313
314 return false;
315}
@ NPTH
like PAD_PTH, but not plated

References CIRCLE, NPTH, OVAL, pad, PCB_PAD_T, and EDA_ITEM::Type().

Referenced by DRC_TEST_PROVIDER_SOLDER_MASK::testItemAgainstItems(), and DRC_TEST_PROVIDER_SOLDER_MASK::testMaskBridges().